mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-11 10:15:39 +02:00
[182454] improve getAbsoluteName() documentation
This commit is contained in:
parent
acd39c3849
commit
5db36e801e
1 changed files with 8 additions and 7 deletions
|
@ -4354,14 +4354,15 @@ public class SystemView extends SafeTreeViewer
|
||||||
String absName = ident.getAbsoluteName(element);
|
String absName = ident.getAbsoluteName(element);
|
||||||
if(absName!=null) return absName.hashCode();
|
if(absName!=null) return absName.hashCode();
|
||||||
//Since one adapter is typically used for many elements in RSE,
|
//Since one adapter is typically used for many elements in RSE,
|
||||||
//performance is better if the original Element's hashCode
|
//performance would be better if the original Element's hashCode
|
||||||
//is used rather than the adapter's hashCode. The problem with
|
//were used rather than the adapter's hashCode. The problem with
|
||||||
//this is, that if the remote object changes, it cannot be
|
//this is, that if the remote object changes, it cannot be
|
||||||
//identified any more. But by returning null for the absolute
|
//identified any more.
|
||||||
//name, the extender has agreed that the remote object's
|
//Note that even if the SAME object is modified during refresh
|
||||||
//equals() and hashCode() methods will always work properly.
|
//(so object a==b), the hashCode of the object can change
|
||||||
|
//over time if properties are modified. Therefore, play it
|
||||||
//return ident.hashCode();
|
//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
|
if (element != null) { // adding check because I hit a null exception here once at startup
|
||||||
|
|
Loading…
Add table
Reference in a new issue