|
Lines 14-19
Link Here
|
| 14 |
import java.util.HashMap; |
14 |
import java.util.HashMap; |
| 15 |
import java.util.Iterator; |
15 |
import java.util.Iterator; |
| 16 |
import java.util.Map; |
16 |
import java.util.Map; |
|
|
17 |
import java.util.Map.Entry; |
| 17 |
|
18 |
|
| 18 |
import org.eclipse.core.runtime.IProgressMonitor; |
19 |
import org.eclipse.core.runtime.IProgressMonitor; |
| 19 |
import org.eclipse.core.runtime.OperationCanceledException; |
20 |
import org.eclipse.core.runtime.OperationCanceledException; |
|
Lines 44-50
Link Here
|
| 44 |
import org.eclipse.jdt.internal.compiler.problem.AbortCompilation; |
45 |
import org.eclipse.jdt.internal.compiler.problem.AbortCompilation; |
| 45 |
import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory; |
46 |
import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory; |
| 46 |
import org.eclipse.jdt.internal.compiler.problem.ProblemReporter; |
47 |
import org.eclipse.jdt.internal.compiler.problem.ProblemReporter; |
| 47 |
import org.eclipse.jdt.internal.compiler.util.HashtableOfObject; |
|
|
| 48 |
import org.eclipse.jdt.internal.compiler.util.HashtableOfObjectToInt; |
48 |
import org.eclipse.jdt.internal.compiler.util.HashtableOfObjectToInt; |
| 49 |
import org.eclipse.jdt.internal.compiler.util.Messages; |
49 |
import org.eclipse.jdt.internal.compiler.util.Messages; |
| 50 |
import org.eclipse.jdt.internal.core.BinaryMember; |
50 |
import org.eclipse.jdt.internal.core.BinaryMember; |
|
Lines 76-88
Link Here
|
| 76 |
* The sources that were requested. |
76 |
* The sources that were requested. |
| 77 |
* Map from file name (char[]) to ICompilationUnit. |
77 |
* Map from file name (char[]) to ICompilationUnit. |
| 78 |
*/ |
78 |
*/ |
| 79 |
HashtableOfObject requestedSources; |
79 |
HashMap requestedSources; |
| 80 |
|
80 |
|
| 81 |
/* |
81 |
/* |
| 82 |
* The binding keys that were requested. |
82 |
* The binding keys that were requested. |
| 83 |
* Map from file name (char[]) to BindingKey (or ArrayList if multiple keys in the same file). |
83 |
* Map from file name (char[]) to BindingKey (or ArrayList if multiple keys in the same file). |
| 84 |
*/ |
84 |
*/ |
| 85 |
HashtableOfObject requestedKeys; |
85 |
HashMap requestedKeys; |
| 86 |
|
86 |
|
| 87 |
DefaultBindingResolver.BindingTables bindingTables; |
87 |
DefaultBindingResolver.BindingTables bindingTables; |
| 88 |
|
88 |
|
|
Lines 165-171
Link Here
|
| 165 |
int index = 0; |
165 |
int index = 0; |
| 166 |
|
166 |
|
| 167 |
// walks the source units |
167 |
// walks the source units |
| 168 |
this.requestedSources = new HashtableOfObject(); |
168 |
this.requestedSources = new HashMap(); |
| 169 |
for (int i = 0; i < sourceLength; i++) { |
169 |
for (int i = 0; i < sourceLength; i++) { |
| 170 |
org.eclipse.jdt.internal.compiler.env.ICompilationUnit sourceUnit = sourceUnits[i]; |
170 |
org.eclipse.jdt.internal.compiler.env.ICompilationUnit sourceUnit = sourceUnits[i]; |
| 171 |
CompilationUnitDeclaration parsedUnit; |
171 |
CompilationUnitDeclaration parsedUnit; |
|
Lines 198-204
Link Here
|
| 198 |
} |
198 |
} |
| 199 |
|
199 |
|
| 200 |
// walk the binding keys |
200 |
// walk the binding keys |
| 201 |
this.requestedKeys = new HashtableOfObject(); |
201 |
this.requestedKeys = new HashMap(); |
| 202 |
for (int i = 0; i < keyLength; i++) { |
202 |
for (int i = 0; i < keyLength; i++) { |
| 203 |
BindingKeyResolver resolver = new BindingKeyResolver(bindingKeys[i], this, this.lookupEnvironment); |
203 |
BindingKeyResolver resolver = new BindingKeyResolver(bindingKeys[i], this, this.lookupEnvironment); |
| 204 |
resolver.parse(true/*pause after fully qualified name*/); |
204 |
resolver.parse(true/*pause after fully qualified name*/); |
|
Lines 741-748
Link Here
|
| 741 |
} |
741 |
} |
| 742 |
|
742 |
|
| 743 |
// remove at the end so that we don't resolve twice if a source and a key for the same file name have been requested |
743 |
// remove at the end so that we don't resolve twice if a source and a key for the same file name have been requested |
| 744 |
this.requestedSources.removeKey(fileName); |
744 |
this.requestedSources.remove(fileName); |
| 745 |
this.requestedKeys.removeKey(fileName); |
745 |
this.requestedKeys.remove(fileName); |
| 746 |
} finally { |
746 |
} finally { |
| 747 |
// cleanup compilation unit result |
747 |
// cleanup compilation unit result |
| 748 |
unit.cleanUp(); |
748 |
unit.cleanUp(); |
|
Lines 753-766
Link Here
|
| 753 |
|
753 |
|
| 754 |
// remaining binding keys |
754 |
// remaining binding keys |
| 755 |
DefaultBindingResolver resolver = new DefaultBindingResolver(this.lookupEnvironment, owner, this.bindingTables, (flags & ICompilationUnit.ENABLE_BINDINGS_RECOVERY) != 0); |
755 |
DefaultBindingResolver resolver = new DefaultBindingResolver(this.lookupEnvironment, owner, this.bindingTables, (flags & ICompilationUnit.ENABLE_BINDINGS_RECOVERY) != 0); |
| 756 |
Object[] keys = this.requestedKeys.valueTable; |
756 |
for (Iterator iEntry = this.requestedKeys.entrySet().iterator(); iEntry.hasNext(); ) { |
| 757 |
for (int j = 0, keysLength = keys.length; j < keysLength; j++) { |
757 |
Entry e = (Entry)iEntry.next(); |
| 758 |
BindingKeyResolver keyResolver = (BindingKeyResolver) keys[j]; |
758 |
BindingKeyResolver keyResolver = (BindingKeyResolver) e.getValue(); |
| 759 |
if (keyResolver == null) continue; |
759 |
if (keyResolver == null) continue; |
| 760 |
Binding compilerBinding = keyResolver.getCompilerBinding(); |
760 |
Binding compilerBinding = keyResolver.getCompilerBinding(); |
| 761 |
IBinding binding = compilerBinding == null ? null : resolver.getBinding(compilerBinding); |
761 |
IBinding binding = compilerBinding == null ? null : resolver.getBinding(compilerBinding); |
| 762 |
// pass it to requestor |
762 |
// pass it to requestor |
| 763 |
astRequestor.acceptBinding(((BindingKeyResolver) this.requestedKeys.valueTable[j]).getKey(), binding); |
763 |
astRequestor.acceptBinding(keyResolver.getKey(), binding); |
| 764 |
worked(1); |
764 |
worked(1); |
| 765 |
} |
765 |
} |
| 766 |
} catch (OperationCanceledException e) { |
766 |
} catch (OperationCanceledException e) { |