Inspectopedia 2024.3 Help

Numeric issues

'char' expression used in arithmetic context   New in this release

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

'equals()' called on 'BigDecimal'   New in this release

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

'long' literal ending with 'l' instead of 'L'   New in this release

Reports long literals ending with lowercase 'l'.

Call to 'BigDecimal' method without a rounding mode argument   New in this release

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

Comparison of 'short' and 'char' values   New in this release

Reports equality comparisons between short and char values.

Comparison to 'Double.NaN' or 'Float.NaN'   New in this release

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

Confusing floating-point literal   New in this release

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'   New in this release

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   New in this release

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

Implicit numeric conversion   New in this release

Reports implicit conversion between numeric types.

Integer division in floating-point context   New in this release

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

Negative int hexadecimal constant in long context   New in this release

Reports negative int hexadecimal constants in long context.

Non-reproducible call to 'Math'   New in this release

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

Number constructor call with primitive argument   New in this release

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

Numeric overflow   New in this release

Reports expressions that overflow during computation.

Octal and decimal integers in same array   New in this release

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   New in this release

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

Suspicious oddness check   New in this release

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

Suspicious underscore in number literal   New in this release

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

Unary plus   New in this release

Reports usages of the + unary operator.

Underscores in numeric literal   New in this release

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

Unnecessary unary minus   New in this release

Reports unnecessary unary minuses.

Unpredictable 'BigDecimal' constructor call   New in this release

Reports calls to BigDecimal constructors that accept a double value.

Unreadable numeric literal   New in this release

Reports long numeric literals without underscores and suggests adding them.

Cast  

Sub-group of 5 inspections that provide checks for Cast

Last modified: 11 September 2024