private static Symbol.MethodSymbol resolveMethod( JCDiagnostic.DiagnosticPosition pos, Context ctx, JCTree.JCCompilationUnit compUnit, Name name, Type qual, List<Type> args ) { Resolve rs = Resolve.instance( ctx ); AttrContext attrContext = new AttrContext(); Env<AttrContext> env = new AttrContextEnv( pos.getTree(), attrContext ); env.toplevel = compUnit; return rs.resolveInternalMethod( pos, env, qual, name, args, null ); } }
private static Symbol.MethodSymbol resolveMethod( JCDiagnostic.DiagnosticPosition pos, Context ctx, JCTree.JCCompilationUnit compUnit, Name name, Type qual, List<Type> args ) { Resolve rs = Resolve.instance( ctx ); AttrContext attrContext = new AttrContext(); Env<AttrContext> env = new AttrContextEnv( pos.getTree(), attrContext ); env.toplevel = compUnit; return rs.resolveInternalMethod( pos, env, qual, name, args, null ); } }
/** Create a fresh environment for a variable's initializer. * If the variable is a field, the owner of the environment's scope * is be the variable itself, otherwise the owner is the method * enclosing the variable definition. * * @param tree The variable definition. * @param env The environment current outside of the variable definition. */ Env<AttrContext> initEnv(JCVariableDecl tree, Env<AttrContext> env) { Env<AttrContext> localEnv = env.dupto(new AttrContextEnv(tree, env.info.dup())); if (tree.sym.owner.kind == TYP) { localEnv.info.scope = new Scope.DelegatedScope(env.info.scope); localEnv.info.scope.owner = tree.sym; } if ((tree.mods.flags & STATIC) != 0 || (env.enclClass.sym.flags() & INTERFACE) != 0) localEnv.info.staticLevel++; return localEnv; }
/** Create a fresh environment for a variable's initializer. * If the variable is a field, the owner of the environment's scope * is be the variable itself, otherwise the owner is the method * enclosing the variable definition. * * @param tree The variable definition. * @param env The environment current outside of the variable definition. */ Env<AttrContext> initEnv(JCVariableDecl tree, Env<AttrContext> env) { Env<AttrContext> localEnv = env.dupto(new AttrContextEnv(tree, env.info.dup())); if (tree.sym.owner.kind == TYP) { localEnv.info.scope = env.info.scope.dupUnshared(); localEnv.info.scope.owner = tree.sym; } if ((tree.mods.flags & STATIC) != 0 || ((env.enclClass.sym.flags() & INTERFACE) != 0 && env.enclMethod == null)) localEnv.info.staticLevel++; return localEnv; }
/** Create a fresh environment for a variable's initializer. * If the variable is a field, the owner of the environment's scope * is be the variable itself, otherwise the owner is the method * enclosing the variable definition. * * @param tree The variable definition. * @param env The environment current outside of the variable definition. */ Env<AttrContext> initEnv(JCVariableDecl tree, Env<AttrContext> env) { Env<AttrContext> localEnv = env.dupto(new AttrContextEnv(tree, env.info.dup())); if (tree.sym.owner.kind == TYP) { localEnv.info.scope = env.info.scope.dupUnshared(); localEnv.info.scope.owner = tree.sym; } if ((tree.mods.flags & STATIC) != 0 || ((env.enclClass.sym.flags() & INTERFACE) != 0 && env.enclMethod == null)) localEnv.info.staticLevel++; return localEnv; }
/** Create a fresh environment for a variable's initializer. * If the variable is a field, the owner of the environment's scope * is be the variable itself, otherwise the owner is the method * enclosing the variable definition. * * @param tree The variable definition. * @param env The environment current outside of the variable definition. */ Env<AttrContext> initEnv(JCVariableDecl tree, Env<AttrContext> env) { Env<AttrContext> localEnv = env.dupto(new AttrContextEnv(tree, env.info.dup())); if (tree.sym.owner.kind == TYP) { localEnv.info.scope = new Scope.DelegatedScope(env.info.scope); localEnv.info.scope.owner = tree.sym; } if ((tree.mods.flags & STATIC) != 0 || (env.enclClass.sym.flags() & INTERFACE) != 0) localEnv.info.staticLevel++; return localEnv; }