When only the keys from a map are needed in a loop, iterating the keySet makes sense. But when both the key and the value are needed, it's more efficient to iterate the entrySet, which will give access to both the key and value, instead. Noncompliant…
bug类型: 1.".equals()" should not be used to test the values of "Atomic" classes. bug 主要 不要使用equals方法对AtomicXXX进行是否相等的判断 Atomic变量永远只会和自身相等,Atomic变量没有覆写equals()方法.2."=+" should not be used instead of "+=" bug…
bug类型: 1.".equals()" should not be used to test the values of "Atomic" classes. bug 主要 不要使用equals方法对AtomicXXX进行是否相等的判断 Atomic变量永远只会和自身相等,Atomic变量没有覆写equals()方法.2."=+" should not be used instead of "+=" bug 主要 "…
格式:问题名字+问题出现的次数 Resources should be closed2 资源未关闭,打开发现有两处用到的IO流没有关闭 Conditions should not unconditionally evaluate to "TRUE" or to "FALSE"1 if/else判断里出现了重复判断,比如在if(a>10)的执行体里面又判断if(a<0),而后者肯定不会是true Exception handlers should pres…