idea警告:'xxx==false' can be simplified to '!xxx'
来源:互联网 发布:阿里云 百度云 知乎 编辑:程序博客网 时间:2024/06/01 10:41
1. 当程序中存在类似如下判断代码时
if ( label == true ){ ... ...}
2. idea或部分ide检测代码时会出现此警告
'label==false' can be simplified to '!label' less... (Ctrl+F1) Reports pointless or pointlessly complicated boolean expressions. Such expressions include anding with true, oring with false, equality comparison with a boolean literal, or negation of a boolean literal. Such expressions may be the result of automated refactorings not completely followed through to completion, and in any case are unlikely to be what the developer intended to do.
3. 修改:
if ( label ){ ... ...}
4. 参考地址:
http://www.itwendao.com/article/detail/66036.html
5. 其他参考:
https://github.com/eslint/eslint/issues/667
阅读全文
0 0
- idea警告:'xxx==false' can be simplified to '!xxx'
- Only a type can be imported. com.xxx.xxx.XXX resolves to a package 解决方法
- Only a type can be imported. com.xxx.xxx.XXX resolves to a package 解决方法
- Only a type can be imported. com.xxx.xxx.XXX resolves to a package 解决方法 .
- SSH的 The authenticity of host xxx.xxx.xxx.xxx can't be established. 问题
- XXX calss can not be resolved
- ERROR 2003 (HY000): Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (111)
- Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (3)
- Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (10061),错误代码2003
- only a type can be imported: XXX resolves to a package
- JSP中报错only a type can be imported: XXX resolves to package
- ubuntu package XXX needs to be reinstalled, but I can't find an archive 修复
- [dfs基础]XXX+XXX=XXX
- java.util.LinkedHashMap cannot be cast to com.XXX.XXX
- springmvc中关于@RequestParam(value="xxx",required=false) int xxx的一个坑
- 原生js document.getElementById("XXX").disabled="false";无效
- xxx cannot be resolved to a type
- xxx cannot be resolved to a type
- linux 7
- Android 系统默认打开文件的方法
- spring mvc demo案例
- 8051 系列单片机内部结构
- 远程连接mysql报错1130,is not allowed to connect to...
- idea警告:'xxx==false' can be simplified to '!xxx'
- 小程序
- Java中常用数据结构
- Java中使用注解
- SSM入门项目-0-前言
- Python基础教程第九章学习笔记——魔法方法、属性和迭代器
- iOS远程真机之iOS-remote 安装使用完全指南
- 【LeetCode】C# 33、Search in Rotated Sorted Array
- HTML基础笔记