Bug 456360

Summary: BUG - Use of Wrong Operator in String Comparison - Version 1.8.4 , 1.6.8 and 1.6.9
Product: [Tools] AspectJ Reporter: david camilo espitia manrique <dcespitiam>
Component: LibraryAssignee: aspectj inbox <aspectj-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: aclement
Version: 1.8.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description david camilo espitia manrique CLA 2014-12-30 11:50:14 EST
We are currently using aspectjweaver-1.6.9.jar and during veracode analysis, this scanner found this bug in ClassLoaderRepository.java (Line 317) in the version 1.6.8, 1.6.9 and 1.8.4:

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.


Thanks.
Comment 1 Andrew Clement CLA 2015-01-07 19:42:13 EST
I can't see where this refers to. This is the file:

https://github.com/eclipse/org.aspectj/blob/93c58e39cf0512d0920c37a40026a6aa5f1ff26b/bcel-builder/src/org/aspectj/apache/bcel/util/ClassLoaderRepository.java

line 317 doesn't use ==