The warning message associated with UC_USELESS_CONDITION annotates some of the integer literals with their character literal equivalents, e.g, 'Z' for 90 and '2' for 50. Is it because the literal's type is not available in the .class file, so that any integer that might be an ASCII character is annotated in this manner?
% java -jar findbugs-3.0.1/lib/findbugs.jar -textui -longBugCodes -low UselessConditionTest.class
L D UC_USELESS_CONDITION UC: Useless condition: it's known that r >= 50 ('2') at this point At UselessConditionTest.java:[line 7]
L D UC_USELESS_CONDITION UC: Useless condition: it's known that r < 90 ('Z') at this point At UselessConditionTest.java:[line 7]
L D UC_USELESS_CONDITION UC: Useless condition: it's known that r >= 0 at this point At UselessConditionTest.java:[line 5]
% more UselessConditionTest.java
public class UselessConditionTest {
public static void main(String[] args) {
int r = Integer.parseInt(args[0]);
if (r >= 0 && r < 90) {
if (r >= 0 && r < 50)
System.out.println("Hello");
else if (r >= 50 && r < 90)
System.out.println("World");
}
}
}