Inspectopedia Help

Java 5

'BigDecimal' legacy method called  

Reports calls to BigDecimal.divide() or BigDecimal.setScale() that use integer constants to specify the rounding mode.

'String.indexOf()' expression can be replaced with 'contains()'  

Reports comparisons with String.indexOf() calls that can be replaced with a call to the String.contains() method.

'StringBuffer' may be 'StringBuilder'  

Reports variables declared as StringBuffer and suggests replacing them with StringBuilder.

'for' loop can be replaced with enhanced for loop  

Reports for loops that iterate over collections or arrays, and can be automatically replaced with an enhanced for loop (foreach iteration syntax).

'while' loop can be replaced with enhanced 'for' loop  

Reports while loops that iterate over collections and can be replaced with enhanced for loops (foreach iteration syntax).

Method can have varargs parameter  

Reports methods that can be converted to variable arity methods.

Raw use of parameterized class  

Reports generic classes with omitted type parameters.

Reference to empty collection field can be replaced with method call  

Reports usages of java.util.Collections fields: EMPTY_LIST, EMPTY_MAP or EMPTY_SET.

Unnecessary boxing  

Reports explicit boxing, that is wrapping of primitive values in objects.

Unnecessary unboxing  

Reports unboxing, that is explicit unwrapping of wrapped primitive values.

Last modified: 18 June 2024