A numeric literal ends in a lower case l, f or d, and l looks like the digit 1
What it finds
10l is easily read as 101. Upper case suffixes, 10L, 1.5F, 2D, cannot be mistaken for digits.
Reported is an integer literal ending in l and a floating-point literal ending in f or d, outside hexadecimal literals. The fix writes the suffix in upper case.
From the rule's source, lowercase_literal_suffix.rs.
class Literals { long a = 10l;tx0 reports: suffix of this literal is in lower case long b = 10L; float c = 1.5f;tx0 reports: lower case int d = 0xff;} Turn it on, off or suppress it
The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/java:lowercase-literal-suffix" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/java:lowercase-literal-suffix] reason="..."tx0 explain tx0/java:lowercase-literal-suffix shows the same in the terminal. Found a false positive? Report it.