.getEnv(ASTHelpers.getSymbol(state.findEnclosing(ClassTree.class)));
return resolve.resolveInternalMethod( enter.getEnv(base), base.type, name,
/** * Returns a symbol's enter environment, or null if it has none. */ private Env<AttrContext> getEnterEnv(Symbol sym) { // Get enclosing class of sym, or sym itself if it is a class // or package. TypeSymbol ts = (sym.kind != Kinds.PCK) ? sym.enclClass() : (PackageSymbol) sym; return (ts != null) ? enter.getEnv(ts) : null; }
public Env<AttrContext> getClassEnv(TypeSymbol sym) { Env<AttrContext> localEnv = getEnv(sym); Env<AttrContext> lintEnv = localEnv; while (lintEnv.info.lint == null) lintEnv = lintEnv.next; localEnv.info.lint = lintEnv.info.lint.augment(sym); return localEnv; }
public Env<AttrContext> getClassEnv(TypeSymbol sym) { Env<AttrContext> localEnv = getEnv(sym); Env<AttrContext> lintEnv = localEnv; while (lintEnv.info.lint == null) lintEnv = lintEnv.next; localEnv.info.lint = lintEnv.info.lint.augment(sym); return localEnv; }
/** * Returns a symbol's enter environment, or null if it has none. */ private Env<AttrContext> getEnterEnv(Symbol sym) { // Get enclosing class of sym, or sym itself if it is a class // or package. TypeSymbol ts = (sym.kind != Kinds.PCK) ? sym.enclClass() : (PackageSymbol) sym; return (ts != null) ? enter.getEnv(ts) : null; }
/** * Returns a symbol's enter environment, or null if it has none. */ private Env<AttrContext> getEnterEnv(Symbol sym) { // Get enclosing class of sym, or sym itself if it is a class // or package. TypeSymbol ts = (sym.kind != Kinds.PCK) ? sym.enclClass() : (PackageSymbol) sym; return (ts != null) ? enter.getEnv(ts) : null; }
/** * Returns a symbol's enter environment, or null if it has none. */ private Env<AttrContext> getEnterEnv(Symbol sym) { // Get enclosing class of sym, or sym itself if it is a class // or package. TypeSymbol ts = (sym.kind != Kinds.PCK) ? sym.enclClass() : (PackageSymbol) sym; return (ts != null) ? enter.getEnv(ts) : null; }
public Env<AttrContext> getClassEnv(TypeSymbol sym) { Env<AttrContext> localEnv = getEnv(sym); Env<AttrContext> lintEnv = localEnv; while (lintEnv.info.lint == null) lintEnv = lintEnv.next; localEnv.info.lint = lintEnv.info.lint.augment(sym.attributes_field, sym.flags()); return localEnv; }
public Env<AttrContext> getClassEnv(TypeSymbol sym) { Env<AttrContext> localEnv = getEnv(sym); Env<AttrContext> lintEnv = localEnv; while (lintEnv.info.lint == null) lintEnv = lintEnv.next; localEnv.info.lint = lintEnv.info.lint.augment(sym.attributes_field, sym.flags()); return localEnv; }
/** Return first abstract member of class `sym'. */ public MethodSymbol firstUnimplementedAbstract(ClassSymbol sym) { try { return firstUnimplementedAbstractImpl(sym, sym); } catch (CompletionFailure ex) { chk.completionError(enter.getEnv(sym).tree.pos(), ex); return null; } } //where:
public void markAbstractIfNeeded(Types types) { if (types.enter.getEnv(this) != null && (flags() & ENUM) != 0 && types.supertype(type).tsym == types.syms.enumSym && (flags() & (FINAL | ABSTRACT)) == 0) { if (types.firstUnimplementedAbstract(this) != null) // add the ABSTRACT flag to an enum flags_field |= ABSTRACT; } } }
private boolean pendingBridges(ClassSymbol origin, TypeSymbol s) { //a symbol will be completed from a classfile if (a) symbol has //an associated file object with CLASS kind and (b) the symbol has //not been entered if (origin.classfile != null && origin.classfile.getKind() == JavaFileObject.Kind.CLASS && enter.getEnv(origin) == null) { return false; } if (origin == s) { return true; } for (Type t : interfaces(origin.type)) { if (pendingBridges((ClassSymbol)t.tsym, s)) { return true; } } return false; } // </editor-fold>
private boolean pendingBridges(ClassSymbol origin, TypeSymbol s) { //a symbol will be completed from a classfile if (a) symbol has //an associated file object with CLASS kind and (b) the symbol has //not been entered if (origin.classfile != null && origin.classfile.getKind() == JavaFileObject.Kind.CLASS && enter.getEnv(origin) == null) { return false; } if (origin == s) { return true; } for (Type t : interfaces(origin.type)) { if (pendingBridges((ClassSymbol)t.tsym, s)) { return true; } } return false; } // </editor-fold>
public JCTree getTree(Element element) { Symbol symbol = (Symbol) element; TypeSymbol enclosing = symbol.enclClass(); Env<AttrContext> env = enter.getEnv(enclosing); if (env == null) return null; JCClassDecl classNode = env.enclClass; if (classNode != null) { if (TreeInfo.symbolFor(classNode) == element) return classNode; for (JCTree node : classNode.getMembers()) if (TreeInfo.symbolFor(node) == element) return node; } return null; }
public JCTree getTree(Element element) { Symbol symbol = (Symbol) element; TypeSymbol enclosing = symbol.enclClass(); Env<AttrContext> env = enter.getEnv(enclosing); if (env == null) return null; JCClassDecl classNode = env.enclClass; if (classNode != null) { if (TreeInfo.symbolFor(classNode) == element) return classNode; for (JCTree node : classNode.getMembers()) if (TreeInfo.symbolFor(node) == element) return node; } return null; }
public JCTree getTree(Element element) { Symbol symbol = (Symbol) element; TypeSymbol enclosing = symbol.enclClass(); Env<AttrContext> env = enter.getEnv(enclosing); if (env == null) return null; JCClassDecl classNode = env.enclClass; if (classNode != null) { if (TreeInfo.symbolFor(classNode) == element) return classNode; for (JCTree node : classNode.getMembers()) if (TreeInfo.symbolFor(node) == element) return node; } return null; }
public JCTree getTree(Element element) { Symbol symbol = (Symbol) element; TypeSymbol enclosing = symbol.enclClass(); Env<AttrContext> env = enter.getEnv(enclosing); if (env == null) return null; JCClassDecl classNode = env.enclClass; if (classNode != null) { if (TreeInfo.symbolFor(classNode) == element) return classNode; for (JCTree node : classNode.getMembers()) if (TreeInfo.symbolFor(node) == element) return node; } return null; }
private void checkSymbol(DiagnosticPosition pos, Symbol sym) { if (sym != null && sym.kind == TYP) { Env<AttrContext> classEnv = enter.getEnv((TypeSymbol)sym); if (classEnv != null) { DiagnosticSource prevSource = log.currentSource(); try { log.useSource(classEnv.toplevel.sourcefile); scan(classEnv.tree); } finally { log.useSource(prevSource.getFile()); } } else if (sym.kind == TYP) { checkClass(pos, sym, List.<JCTree>nil()); } } else { //not completed yet partialCheck = true; } }
private void checkSymbol(DiagnosticPosition pos, Symbol sym) { if (sym != null && sym.kind == TYP) { Env<AttrContext> classEnv = enter.getEnv((TypeSymbol)sym); if (classEnv != null) { DiagnosticSource prevSource = log.currentSource(); try { log.useSource(classEnv.toplevel.sourcefile); scan(classEnv.tree); } finally { log.useSource(prevSource.getFile()); } } else if (sym.kind == TYP) { checkClass(pos, sym, List.<JCTree>nil()); } } else { //not completed yet partialCheck = true; } }