提交 535a7b99 编写于 作者: M mcimadamore

7133238: Merge proto-kind and proto-type into a single result class

Summary: Restructure attribution code so that the check-logic can be encapsulated into a single class
Reviewed-by: jjg, dlsmith
上级 b8aba9ef
......@@ -529,24 +529,17 @@ public class MemberEnter extends JCTree.Visitor implements Completer {
// 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 @@ public class MemberEnter extends JCTree.Visitor implements Completer {
// 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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册