Lines 12-18
Link Here
|
12 |
package org.eclipse.jdt.core.dom.rewrite; |
12 |
package org.eclipse.jdt.core.dom.rewrite; |
13 |
|
13 |
|
14 |
import java.util.ArrayList; |
14 |
import java.util.ArrayList; |
|
|
15 |
import java.util.HashMap; |
15 |
import java.util.List; |
16 |
import java.util.List; |
|
|
17 |
import java.util.Map; |
16 |
|
18 |
|
17 |
import org.eclipse.core.runtime.CoreException; |
19 |
import org.eclipse.core.runtime.CoreException; |
18 |
import org.eclipse.core.runtime.IProgressMonitor; |
20 |
import org.eclipse.core.runtime.IProgressMonitor; |
Lines 122-127
Link Here
|
122 |
|
124 |
|
123 |
private final boolean restoreExistingImports; |
125 |
private final boolean restoreExistingImports; |
124 |
private final List existingImports; |
126 |
private final List existingImports; |
|
|
127 |
private final Map kindImports; |
125 |
|
128 |
|
126 |
private String[] importOrder; |
129 |
private String[] importOrder; |
127 |
private int importOnDemandThreshold; |
130 |
private int importOnDemandThreshold; |
Lines 232-237
Link Here
|
232 |
this.importOrder= CharOperation.NO_STRINGS; |
235 |
this.importOrder= CharOperation.NO_STRINGS; |
233 |
this.importOnDemandThreshold= 99; |
236 |
this.importOnDemandThreshold= 99; |
234 |
this.staticImportOnDemandThreshold= 99; |
237 |
this.staticImportOnDemandThreshold= 99; |
|
|
238 |
|
239 |
this.kindImports = new HashMap(); |
235 |
} |
240 |
} |
236 |
|
241 |
|
237 |
|
242 |
|
Lines 345-351
Link Here
|
345 |
int res= compareImport(prefix, qualifier, name, curr); |
350 |
int res= compareImport(prefix, qualifier, name, curr); |
346 |
if (res != ImportRewriteContext.RES_NAME_UNKNOWN) { |
351 |
if (res != ImportRewriteContext.RES_NAME_UNKNOWN) { |
347 |
if (!allowAmbiguity || res == ImportRewriteContext.RES_NAME_FOUND) { |
352 |
if (!allowAmbiguity || res == ImportRewriteContext.RES_NAME_FOUND) { |
348 |
return res; |
353 |
if (prefix != 's' |
|
|
354 |
|| (this.kindImports.get(curr.substring(1)).equals(this.kindImports.get(qualifier + "." + name)))) { |
355 |
return res; |
356 |
} |
349 |
} |
357 |
} |
350 |
} |
358 |
} |
351 |
} |
359 |
} |
Lines 839-844
Link Here
|
839 |
context= this.defaultContext; |
847 |
context= this.defaultContext; |
840 |
} |
848 |
} |
841 |
int kind= isField ? ImportRewriteContext.KIND_STATIC_FIELD : ImportRewriteContext.KIND_STATIC_METHOD; |
849 |
int kind= isField ? ImportRewriteContext.KIND_STATIC_FIELD : ImportRewriteContext.KIND_STATIC_METHOD; |
|
|
850 |
this.kindImports.put(declaringTypeName + "." + simpleName, new Integer(kind)); |
842 |
int res= context.findInContext(declaringTypeName, simpleName, kind); |
851 |
int res= context.findInContext(declaringTypeName, simpleName, kind); |
843 |
if (res == ImportRewriteContext.RES_NAME_CONFLICT) { |
852 |
if (res == ImportRewriteContext.RES_NAME_CONFLICT) { |
844 |
return declaringTypeName + '.' + simpleName; |
853 |
return declaringTypeName + '.' + simpleName; |