--- a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java Tue Mar 06 13:28:05 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java Tue Mar 06 13:29:45 2012 +0000
@@ -529,24 +529,17 @@
// process the non-static imports and the static imports of types.
public void visitImport(JCImport tree) {
- JCTree imp = tree.qualid;
+ JCFieldAccess imp = (JCFieldAccess)tree.qualid;
Name name = TreeInfo.name(imp);
- TypeSymbol p;
// Create a local environment pointing to this tree to disable
// effects of other imports in Resolve.findGlobalType
Env<AttrContext> localEnv = env.dup(tree);
- // Attribute qualifying package or class.
- JCFieldAccess s = (JCFieldAccess) imp;
- p = attr.
- attribTree(s.selected,
- localEnv,
- tree.staticImport ? TYP : (TYP | PCK),
- Type.noType).tsym;
+ TypeSymbol p = attr.attribImportQualifier(tree, localEnv).tsym;
if (name == names.asterisk) {
// Import on demand.
- chk.checkCanonical(s.selected);
+ chk.checkCanonical(imp.selected);
if (tree.staticImport)
importStaticAll(tree.pos, p, env);
else
@@ -555,7 +548,7 @@
// Named type import.
if (tree.staticImport) {
importNamedStatic(tree.pos(), p, name, localEnv);
- chk.checkCanonical(s.selected);
+ chk.checkCanonical(imp.selected);
} else {
TypeSymbol c = attribImportType(imp, localEnv).tsym;
chk.checkCanonical(imp);