1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-04 07:35:24 +02:00

[182454] improve getAbsoluteName() documentation

This commit is contained in:
Martin Oberhuber 2007-04-25 11:51:55 +00:00
parent acd39c3849
commit 5db36e801e

View file

@ -4354,14 +4354,15 @@ public class SystemView extends SafeTreeViewer
String absName = ident.getAbsoluteName(element);
if(absName!=null) return absName.hashCode();
//Since one adapter is typically used for many elements in RSE,
//performance is better if the original Element's hashCode
//is used rather than the adapter's hashCode. The problem with
//performance would be better if the original Element's hashCode
//were used rather than the adapter's hashCode. The problem with
//this is, that if the remote object changes, it cannot be
//identified any more. But by returning null for the absolute
//name, the extender has agreed that the remote object's
//equals() and hashCode() methods will always work properly.
//return ident.hashCode();
//identified any more.
//Note that even if the SAME object is modified during refresh
//(so object a==b), the hashCode of the object can change
//over time if properties are modified. Therefore, play it
//safe and return the adapter's hashCode which won't ever change.
return ident.hashCode();
}
}
if (element != null) { // adding check because I hit a null exception here once at startup