JD.RC.EXPR.CHECKJD.RC.EXPR.CHECK is triggered when a local variable is checked even though that check will always result in a 'true' value, so the block of code will always execute under this condition. Vulnerability and riskLogic flaw. Checks should only be done for properties that are not known in compile time. Mitigation and preventionMake sure that you are checking the right variables for the right values. Example 113 void handleEvent(AWTEvent event) { 14 if (event instanceof MouseEvent) { 15 if (event != null) { 16 handleMouseEvent((MouseEvent) event); 17 } 18 } 19 } JD.RC.EXPR.CHECK is reported for the check on line 15, since the check on line 14 guarantees that 'event' is not null; Example 213 void handleEvent(AWTEvent event) { 14 if (event != null) { 15 if (event instanceof MouseEvent) { 16 handleMouseEvent((MouseEvent) event); 17 } 18 } 19 } JD.RC.EXPR.CHECK is not reported for the snippet: the null check on line 14 does not guarantee that the 'event' is an instance of the MouseEvent class. Related checkers |