Inspectopedia Help

Numeric issues

'char' expression used in arithmetic context  

Reports expressions of the char type used in addition or subtraction expressions.

'equals()' called on 'BigDecimal'  

Reports equals() calls that compare two java.math.BigDecimal numbers.

'long' literal ending with 'l' instead of 'L'  

Reports long literals ending with lowercase 'l'.

Call to 'BigDecimal' method without a rounding mode argument  

Reports calls to divide() or setScale() without a rounding mode argument.

Comparison of 'short' and 'char' values  

Reports equality comparisons between short and char values.

Comparison to 'Double.NaN' or 'Float.NaN'  

Reports any comparisons to Double.NaN or Float.NaN.

Confusing floating-point literal  

Reports any floating point numbers that don't have a decimal point, numbers before the decimal point, or numbers after the decimal point.

Constant call to 'Math'  

Reports calls to java.lang.Math or java.lang.StrictMath methods that can be replaced with simple compile-time constants.

Division by zero  

Reports division by zero or remainder by zero.

Floating-point equality comparison  

Reports floating-point values that are being compared using the == or != operator.

Implicit numeric conversion  

Reports implicit conversion between numeric types.

Integer division in floating-point context  

Reports integer divisions where the result is used as a floating-point number.

Negative int hexadecimal constant in long context  

Reports negative int hexadecimal constants in long context.

Non-reproducible call to 'Math'  

Reports calls to java.lang.Math methods, which results are not guaranteed to be reproduced precisely.

Number constructor call with primitive argument  

Reports instantiations of new Long, Integer, Short, or Byte objects that have a primitive long, integer, short, or byte argument.

Numeric overflow  

Reports expressions that overflow during computation.

Octal and decimal integers in same array  

Reports mixed octal and decimal integer literals in a single array initializer.

Octal integer  

Reports octal integer literals.

Overly complex arithmetic expression  

Reports arithmetic expressions with the excessive number of terms.

Pointless arithmetic expression  

Reports pointless arithmetic expressions.

Possibly lossy implicit cast in compound assignment  

Reports compound assignments if the type of the right-hand operand is not assignment compatible with the type of the variable.

Suspicious oddness check  

Reports odd-even checks of the following form: x % 2 == 1.

Suspicious underscore in number literal  

Reports decimal number literals that use the underscore numeric separator with groups where the number of digits is not three.

Unary plus  

Reports usages of the + unary operator.

Underscores in numeric literal  

Reports numeric literals with underscores and suggests removing them with a quick-fix.

Unnecessary unary minus  

Reports unnecessary unary minuses.

Unpredictable 'BigDecimal' constructor call  

Reports calls to BigDecimal constructors that accept a double value.

Unreadable numeric literal  

Reports long numeric literals without underscores and suggests adding them.


Sub-group of 5 inspections that provide checks for Cast

Last modified: 18 June 2024