Community
Participate
Working Groups
We are currently using aspectjweaver-1.6.9.jar and during veracode analysis, this scanner found this bug in WildAnnotationTypePattern.java(line 1211,1213,1285,1288,1291,1296,1299,1302,1305,1309,1335,1783,1808 and 1819) : Type: Use of Wrong Operator in String Comparison Description: Using '==' to compare two strings for equality or '!=' for inequality actually compares the object references rather than their values. It is unlikely that this reflects the intended application logic. Recommendations Use the equals() method to compare strings, not the '==' or '!=' operator.
We are currently using aspectjweaver-1.6.9.jar and during veracode analysis, this scanner found this bug in PatternParser.java(line 1211,1213,1285,1288,1291,1296,1299,1302,1305,1309,1335,1783,1808 and 1819) : Type: Use of Wrong Operator in String Comparison Description: Using '==' to compare two strings for equality or '!=' for inequality actually compares the object references rather than their values. It is unlikely that this reflects the intended application logic. Recommendations Use the equals() method to compare strings, not the '==' or '!=' operator.
(In reply to david camilo espitia manrique from comment #0) > We are currently using aspectjweaver-1.6.9.jar and during veracode analysis, > this scanner found this bug in PatternParser.java(line > 1211,1213,1285,1288,1291,1296,1299,1302,1305,1309,1335,1783,1808 and 1819) : > > Type: Use of Wrong Operator in String Comparison > > Description: > Using '==' to compare two strings for equality or '!=' for inequality > actually compares the object references rather than > their values. It is unlikely that this reflects the intended application > logic. > > Recommendations > Use the equals() method to compare strings, not the '==' or '!=' operator.
I think these aren't a real problem due to a mixture of using constants and string interning going on. There are thousands of testcases that exercise the pattern parser, and from what I can tell it is complaining about here, if these were a problem AspectJ really wouldn't be working.