1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

2004-09-02 Alain Magloire

Deal with WorkingCopy vs TranslationUnit in the hashCode.
	* src/org/eclipse/cdt/internal/ui/cview/CViewElementComparer.java
This commit is contained in:
Alain Magloire 2004-09-02 17:04:25 +00:00
parent 5737282b4c
commit 69ecf16572
2 changed files with 11 additions and 8 deletions

View file

@ -1,3 +1,8 @@
2004-09-02 Alain Magloire
Deal with WorkingCopy vs TranslationUnit in the hashCode.
* src/org/eclipse/cdt/internal/ui/cview/CViewElementComparer.java
2004-09-02 Bogdan Gheorghe
Fix for 72816: [Search] Selection Search For Working Set

View file

@ -58,15 +58,13 @@ public class CViewElementComparer implements IElementComparer {
ICElement c1= (o1 instanceof ICElement) ? (ICElement)o1 : null;
if (c1 == null)
return o1.hashCode();
if (c1 instanceof ITranslationUnit) {
ITranslationUnit t1= (ITranslationUnit)c1;
if (t1.isWorkingCopy()) {
c1= ((IWorkingCopy)t1).getOriginalElement();
}
}
if (c1 == null) {
ITranslationUnit u1= (ITranslationUnit)c1.getAncestor(ICElement.C_UNIT);
if (u1 == null || !u1.isWorkingCopy())
return o1.hashCode();
// From here on c1 is a working copy.
c1= ((IWorkingCopy)u1).getOriginal(c1);
if (c1 == null)
return o1.hashCode();
}
return c1.hashCode();
}
}