@@ -179,6 +179,7 @@ private boolean isComment(String var, int index, String sourceCode) {
179179 public TreeSet <DataNode > getOccurrences (String s , Position p ) {
180180 TreeSet <DataNode > returnList = new TreeSet <DataNode >();
181181 String binding = null ;
182+ String bindingKey = null ;
182183 String key = null ;
183184
184185 for (Entry <String , TreeSet <DataNode >> entry : map .entrySet ()) {
@@ -193,14 +194,15 @@ public TreeSet<DataNode> getOccurrences(String s, Position p) {
193194 if (dn .getStartPosition () == p .offset ) {
194195 foundNode = dn ;
195196 binding = dn .getBinding ();
197+ bindingKey = dn .getKey ();
196198 break ;
197199 }
198200 }
199201 list = entry .getValue ();
200202 for (DataNode dn : list ) {
201203 // TODO distinguish between class and local variables of
202204 // same name
203- if (dn .getBinding ().equals (binding )) {
205+ if (dn .getKey ().equals (bindingKey )) {
204206 returnList .add (dn );
205207 }
206208 }
@@ -210,14 +212,15 @@ public TreeSet<DataNode> getOccurrences(String s, Position p) {
210212 for (DataNode dn : list ) {
211213 if (dn .getStartPosition () == p .offset ) {
212214 binding = dn .getBinding ();
215+ bindingKey = dn .getKey ();
213216 break ;
214217 }
215218 }
216219 list = entry .getValue ();
217220 for (DataNode dn : list ) {
218221 // TODO distinguish between class and local variables of
219222 // same name
220- if (dn .getBinding ().equals (binding )) {
223+ if (dn .getKey ().equals (bindingKey )) {
221224 returnList .add (dn );
222225 }
223226 }
0 commit comments