idea忽略java错误_Idea忽略不必要的警告

1、拼写警告

表象:当自定义变量不是一个单词时,会有以下警告,

Inspection info: Spellchecker inspection helps locate typos and misspelling in your code, comments and literals, and fix them in one click

翻译后:拼写检查器检查可以帮助查找拼写错误和拼写错误在您的代码、注释和文本、并修复它们中一次点击

解决办法1:

双击下面有虚线的单词——>鼠标右键——>spelling——>save 'xxx' to distionary

解决办法2:如图,preferences->Editor->Inspections-Spelling->Typo,取消勾选

ffda108a127741ff465af5e8a3fab45b.png

2、Method is never used

表象:类,对象,方法,变量不分权限全部提醒

解决办法:私有对象,私有方法,变量需要警告,共有的不需要警告

preferences->Editor->Inspections->Java->Declaration redundancy->Unsed declaration。设置类,方法,对象,变量的访问权限

0f1d61e94e2c79e025aa8d62f47b8459.png

3、代码重复提醒

表象:重复代码,会提示Finds duplicated code

解决办法1:对重复功能进行封装

解决办法2:preferences->Editor->Inspections->General->Duplicated  Code 取消勾选

64a7fd29dc9f41dc14cf5d41a97f3c63.png

4、 错误标签(Wrong tag)

表象:- no javadoc where it is required  - required tag is missing  - invalid or incomplete tag  - javadoc description is missing or incomplete

解决:preferences->Editor->Inspections->JavaDoc  取消勾选

6998a68598cbb9dc577a1d5a65239af4.png

5、变量重新分配地址或参数

表象:变量下有__

d5666bb401c57e6706e090284ab3c607.png

解决办法:preferences->Editor->Color Scheme->language Defaults->...  如图

6c633776e71e48c9b55d58414ea1201a.png

6、XML错误警告

表象:References to the non-instantiable classes ,References to the classes that do not extend required class ,References to classes with inappropriate scope ,Empty tag and attribute values,

Tag and attribute values that do not match required pattern (e.g. Java Identifiers),Tags that do not include required children tags or attributes,Tags that define objects with duplicate names

c31b3c3c126b7db24d1fa30b5e544c61.png

解决办法:preferences->Editor->Inspections->General

013176caeca822f62991559a18cf507e.png

7、创建类时,偶尔出现Cannot create Class,Unable to parse template

解决办法:Help->Edit Custom VM Options...

在文件末尾增加:-Djdk.util.zip.ensureTrailingSlash=false,重启idea

ed155e49a9e28b93ac3f3b3b74a55773.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值