/** * Finds the field in the given type that matches the given name. */ public static VarSymbol findFieldDeclaration(ClassSymbol classSymbol, Name name) { if (classSymbol == null) { return null; } Iterator<Symbol> it = classSymbol.members_field.getElementsByName(name, (symbol) -> { return symbol instanceof VarSymbol; }).iterator(); if (it.hasNext()) { return (VarSymbol) it.next(); } else { if (classSymbol.getSuperclass().tsym instanceof ClassSymbol) { return findFieldDeclaration((ClassSymbol) classSymbol.getSuperclass().tsym, name); } else { return null; } } }
public Iterable<Symbol> getElementsByName(Name name) { return getElementsByName(name, noFilter); }
public Iterable<Symbol> getElementsByName(Name name) { return getElementsByName(name, noFilter); }
@Override public Iterable<Symbol> getMembersByName( Symbol.ClassSymbol classSym, Name call ) { return classSym.members().getElementsByName( call ); }
Symbol findMethodInScope(Env<AttrContext> env, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes, Scope sc, Symbol bestSoFar, boolean allowBoxing, boolean useVarargs, boolean operator, boolean abstractok) { for (Symbol s : sc.getElementsByName(name, new LookupFilter(abstractok))) { bestSoFar = selectBest(env, site, argtypes, typeargtypes, s, bestSoFar, allowBoxing, useVarargs, operator); } return bestSoFar; } //where
Symbol findMethodInScope(Env<AttrContext> env, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes, Scope sc, Symbol bestSoFar, boolean allowBoxing, boolean useVarargs, boolean operator, boolean abstractok) { for (Symbol s : sc.getElementsByName(name, new LookupFilter(abstractok))) { bestSoFar = selectBest(env, site, argtypes, typeargtypes, s, bestSoFar, allowBoxing, useVarargs, operator); } return bestSoFar; } //where
} else { for (Symbol s : csym.members_field.getElementsByName(names.init)) { return s;
} else { for (Symbol s : csym.members_field.getElementsByName(names.init)) { return s;
MethodSymbol valueMethod = null; for (final Symbol symbol : classSymbol.members_field .getElementsByName(this.names.value)) { valueMethod = (MethodSymbol)symbol;
/** Find or create an implicit method of exactly the given type (after erasure). * Searches in a side table, not the main scope of the site. * This emulates the lookup process required by JSR 292 in JVM. * @param env Attribution environment * @param spMethod signature polymorphic method - i.e. MH.invokeExact * @param argtypes The required argument types */ Symbol findPolymorphicSignatureInstance(Env<AttrContext> env, final Symbol spMethod, List<Type> argtypes) { Type mtype = infer.instantiatePolymorphicSignatureInstance(env, (MethodSymbol)spMethod, currentResolutionContext, argtypes); for (Symbol sym : polymorphicSignatureScope.getElementsByName(spMethod.name)) { if (types.isSameType(mtype, sym.type)) { return sym; } } // create the desired method long flags = ABSTRACT | HYPOTHETICAL | spMethod.flags() & Flags.AccessFlags; Symbol msym = new MethodSymbol(flags, spMethod.name, mtype, spMethod.owner) { @Override public Symbol baseSymbol() { return spMethod; } }; polymorphicSignatureScope.enter(msym); return msym; }
/** Find or create an implicit method of exactly the given type (after erasure). * Searches in a side table, not the main scope of the site. * This emulates the lookup process required by JSR 292 in JVM. * @param env Attribution environment * @param spMethod signature polymorphic method - i.e. MH.invokeExact * @param argtypes The required argument types */ Symbol findPolymorphicSignatureInstance(Env<AttrContext> env, final Symbol spMethod, List<Type> argtypes) { Type mtype = infer.instantiatePolymorphicSignatureInstance(env, (MethodSymbol)spMethod, currentResolutionContext, argtypes); for (Symbol sym : polymorphicSignatureScope.getElementsByName(spMethod.name)) { if (types.isSameType(mtype, sym.type)) { return sym; } } // create the desired method long flags = ABSTRACT | HYPOTHETICAL | spMethod.flags() & Flags.AccessFlags; Symbol msym = new MethodSymbol(flags, spMethod.name, mtype, spMethod.owner) { @Override public Symbol baseSymbol() { return spMethod; } }; if (!mtype.isErroneous()) { // Cache only if kosher. polymorphicSignatureScope.enter(msym); } return msym; }
for (Symbol s : enclClass.members_field.getElementsByName(names.init)) { lambdaEnv.info.scope.owner = s; break;
for (Symbol s : enclClass.members_field.getElementsByName(names.init)) { lambdaEnv.info.scope.owner = s; break;
int nr_value_elems = 0; boolean error = false; for(Symbol elm : scope.getElementsByName(names.value)) { nr_value_elems++;
int nr_value_elems = 0; boolean error = false; for(Symbol elm : scope.getElementsByName(names.value)) { nr_value_elems++;