Project: JDT
Bug 121862 [clean up][infrastructure] Do not reference compare IJavaElements in CleanUpRefactoring
Reported: 2005-12-22 04:16:53 | Status: resolved fixed

Just had a look at your code (CleanUpRefactoring). I noticed that your trying to compare Java element handles using == or !=. This might work for some particular cases but in general Java element handles must never be compared using reference equality. Handles are not unique objects, and there are several different handles denoting the same object. Always use xxx.equals(yyy).

Files changed in fix:
org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CleanUpRefactoring.java