Lines 33-38
Link Here
|
33 |
import org.eclipse.jdt.internal.compiler.parser.Parser; |
33 |
import org.eclipse.jdt.internal.compiler.parser.Parser; |
34 |
import org.eclipse.jdt.internal.compiler.parser.RecoveryScanner; |
34 |
import org.eclipse.jdt.internal.compiler.parser.RecoveryScanner; |
35 |
import org.eclipse.jdt.internal.compiler.util.HashtableOfObject; |
35 |
import org.eclipse.jdt.internal.compiler.util.HashtableOfObject; |
|
|
36 |
import org.eclipse.jdt.internal.compiler.util.HashtableOfObjectToInt; |
36 |
import org.eclipse.jdt.internal.core.util.ReferenceInfoAdapter; |
37 |
import org.eclipse.jdt.internal.core.util.ReferenceInfoAdapter; |
37 |
import org.eclipse.jdt.internal.core.util.Util; |
38 |
import org.eclipse.jdt.internal.core.util.Util; |
38 |
|
39 |
|
Lines 63-68
Link Here
|
63 |
* info objects. |
64 |
* info objects. |
64 |
*/ |
65 |
*/ |
65 |
protected Map newElements; |
66 |
protected Map newElements; |
|
|
67 |
|
68 |
/* |
69 |
* A table from a handle (with occurenceCount == 1) to the current occurence count for this handle |
70 |
*/ |
71 |
private HashtableOfObjectToInt occurenceCounts; |
66 |
|
72 |
|
67 |
/** |
73 |
/** |
68 |
* Stack of parent scope info objects. The info on the |
74 |
* Stack of parent scope info objects. The info on the |
Lines 115-120
Link Here
|
115 |
this.unit = unit; |
121 |
this.unit = unit; |
116 |
this.unitInfo = unitInfo; |
122 |
this.unitInfo = unitInfo; |
117 |
this.newElements = newElements; |
123 |
this.newElements = newElements; |
|
|
124 |
this.occurenceCounts = new HashtableOfObjectToInt(); |
118 |
} |
125 |
} |
119 |
/** |
126 |
/** |
120 |
* @see ISourceElementRequestor |
127 |
* @see ISourceElementRequestor |
Lines 618-628
Link Here
|
618 |
} |
625 |
} |
619 |
/** |
626 |
/** |
620 |
* Resolves duplicate handles by incrementing the occurrence count |
627 |
* Resolves duplicate handles by incrementing the occurrence count |
621 |
* of the handle being created until there is no conflict. |
628 |
* of the handle being created. |
622 |
*/ |
629 |
*/ |
623 |
protected void resolveDuplicates(SourceRefElement handle) { |
630 |
protected void resolveDuplicates(SourceRefElement handle) { |
624 |
while (this.newElements.containsKey(handle)) { |
631 |
int occurenceCount = this.occurenceCounts.get(handle); |
625 |
handle.occurrenceCount++; |
632 |
if (occurenceCount == -1) |
|
|
633 |
this.occurenceCounts.put(handle, 1); |
634 |
else { |
635 |
this.occurenceCounts.put(handle, ++occurenceCount); |
636 |
handle.occurrenceCount = occurenceCount; |
626 |
} |
637 |
} |
627 |
} |
638 |
} |
628 |
protected IMemberValuePair getMemberValuePair(MemberValuePair memberValuePair) { |
639 |
protected IMemberValuePair getMemberValuePair(MemberValuePair memberValuePair) { |