void run(Queue<Env<AttrContext>> list, Iterable<? extends TypeElement> classes) { Set<TypeElement> set = new HashSet<TypeElement>(); for (TypeElement item: classes) set.add(item); ListBuffer<Env<AttrContext>> defer = ListBuffer.<Env<AttrContext>>lb(); while (list.peek() != null) { Env<AttrContext> env = list.remove(); ClassSymbol csym = env.enclClass.sym; if (csym != null && set.contains(csym.outermostClass())) process(env); else defer = defer.append(env); } list.addAll(defer); }
void run(Queue<Env<AttrContext>> list, Iterable<? extends TypeElement> classes) { Set<TypeElement> set = new HashSet<TypeElement>(); for (TypeElement item: classes) set.add(item); ListBuffer<Env<AttrContext>> defer = new ListBuffer<>(); while (list.peek() != null) { Env<AttrContext> env = list.remove(); ClassSymbol csym = env.enclClass.sym; if (csym != null && set.contains(csym.outermostClass())) process(env); else defer = defer.append(env); } list.addAll(defer); }
void run(Queue<Env<AttrContext>> list, Iterable<? extends TypeElement> classes) { Set<TypeElement> set = new HashSet<TypeElement>(); for (TypeElement item: classes) set.add(item); ListBuffer<Env<AttrContext>> defer = new ListBuffer<>(); while (list.peek() != null) { Env<AttrContext> env = list.remove(); ClassSymbol csym = env.enclClass.sym; if (csym != null && set.contains(csym.outermostClass())) process(env); else defer = defer.append(env); } list.addAll(defer); }
case PRIVATE: isAccessible = env.enclClass.sym.outermostClass() == c.owner.outermostClass(); break;
case PRIVATE: isAccessible = env.enclClass.sym.outermostClass() == c.owner.outermostClass(); break;
case PRIVATE: return env.enclClass.sym.outermostClass() == c.owner.outermostClass(); case 0:
case PRIVATE: return env.enclClass.sym.outermostClass() == c.owner.outermostClass(); case 0:
/** * Create a symbol for a class that implements a given functional interface * and overrides its functional descriptor. This routine is used for two * main purposes: (i) checking well-formedness of a functional interface; * (ii) perform functional interface bridge calculation. */ public ClassSymbol makeFunctionalInterfaceClass(Env<AttrContext> env, Name name, List<Type> targets, long cflags) { if (targets.isEmpty() || !isFunctionalInterface(targets.head)) { return null; } Symbol descSym = findDescriptorSymbol(targets.head.tsym); Type descType = findDescriptorType(targets.head); ClassSymbol csym = new ClassSymbol(cflags, name, env.enclClass.sym.outermostClass()); csym.completer = null; csym.members_field = new Scope(csym); MethodSymbol instDescSym = new MethodSymbol(descSym.flags(), descSym.name, descType, csym); csym.members_field.enter(instDescSym); Type.ClassType ctype = new Type.ClassType(Type.noType, List.<Type>nil(), csym); ctype.supertype_field = syms.objectType; ctype.interfaces_field = targets; csym.type = ctype; csym.sourcefile = ((ClassSymbol)csym.owner).sourcefile; return csym; }
/** * Create a symbol for a class that implements a given functional interface * and overrides its functional descriptor. This routine is used for two * main purposes: (i) checking well-formedness of a functional interface; * (ii) perform functional interface bridge calculation. */ public ClassSymbol makeFunctionalInterfaceClass(Env<AttrContext> env, Name name, List<Type> targets, long cflags) { if (targets.isEmpty()) { return null; } Symbol descSym = findDescriptorSymbol(targets.head.tsym); Type descType = findDescriptorType(targets.head); ClassSymbol csym = new ClassSymbol(cflags, name, env.enclClass.sym.outermostClass()); csym.completer = null; csym.members_field = new Scope(csym); MethodSymbol instDescSym = new MethodSymbol(descSym.flags(), descSym.name, descType, csym); csym.members_field.enter(instDescSym); Type.ClassType ctype = new Type.ClassType(Type.noType, List.<Type>nil(), csym); ctype.supertype_field = syms.objectType; ctype.interfaces_field = targets; csym.type = ctype; csym.sourcefile = ((ClassSymbol)csym.owner).sourcefile; return csym; }
/** Anon inner classes are used as access constructor tags. * accessConstructorTag will use an existing anon class if one is available, * and synthethise a class (with makeEmptyClass) if one is not available. * However, there is a small possibility that an existing class will not * be generated as expected if it is inside a conditional with a constant * expression. If that is found to be the case, create an empty class tree here. */ private void checkAccessConstructorTags() { for (List<ClassSymbol> l = accessConstrTags; l.nonEmpty(); l = l.tail) { ClassSymbol c = l.head; if (isTranslatedClassAvailable(c)) continue; // Create class definition tree. JCClassDecl cdec = makeEmptyClass(STATIC | SYNTHETIC, c.outermostClass(), c.flatname, false); swapAccessConstructorTag(c, cdec.sym); translated.append(cdec); } } // where
/** Anon inner classes are used as access constructor tags. * accessConstructorTag will use an existing anon class if one is available, * and synthethise a class (with makeEmptyClass) if one is not available. * However, there is a small possibility that an existing class will not * be generated as expected if it is inside a conditional with a constant * expression. If that is found to be the case, create an empty class tree here. */ private void checkAccessConstructorTags() { for (List<ClassSymbol> l = accessConstrTags; l.nonEmpty(); l = l.tail) { ClassSymbol c = l.head; if (isTranslatedClassAvailable(c)) continue; // Create class definition tree. JCClassDecl cdec = makeEmptyClass(STATIC | SYNTHETIC, c.outermostClass(), c.flatname, false); swapAccessConstructorTag(c, cdec.sym); translated.append(cdec); } } // where
/** Return an anonymous class nested in this toplevel class. */ ClassSymbol accessConstructorTag() { ClassSymbol topClass = currentClass.outermostClass(); Name flatname = names.fromString("" + topClass.getQualifiedName() + target.syntheticNameChar() + "1"); ClassSymbol ctag = chk.compiled.get(flatname); if (ctag == null) ctag = makeEmptyClass(STATIC | SYNTHETIC, topClass).sym; // keep a record of all tags, to verify that all are generated as required accessConstrTags = accessConstrTags.prepend(ctag); return ctag; }
void run(ListBuffer<Env<AttrContext>> list, Iterable<? extends TypeElement> classes) { Set<TypeElement> set = new HashSet<TypeElement>(); for (TypeElement item: classes) set.add(item); List<Env<AttrContext>> defer = List.<Env<AttrContext>>nil(); while (list.nonEmpty()) { Env<AttrContext> env = list.next(); ClassSymbol csym = env.enclClass.sym; if (csym != null && set.contains(csym.outermostClass())) process(env); else defer = defer.prepend(env); } for (List<Env<AttrContext>> l = defer; l.nonEmpty(); l = l.tail) list.prepend(l.head); }
/** Return an anonymous class nested in this toplevel class. */ ClassSymbol accessConstructorTag() { ClassSymbol topClass = currentClass.outermostClass(); Name flatname = names.fromString("" + topClass.getQualifiedName() + target.syntheticNameChar() + "1"); ClassSymbol ctag = chk.compiled.get(flatname); if (ctag == null) ctag = makeEmptyClass(STATIC | SYNTHETIC, topClass).sym; // keep a record of all tags, to verify that all are generated as required accessConstrTags = accessConstrTags.prepend(ctag); return ctag; }
public static UClassIdent create(ClassSymbol sym) { return create(sym.outermostClass().getQualifiedName(), sym.getQualifiedName()); }
/** Return an anonymous class nested in this toplevel class. */ ClassSymbol accessConstructorTag() { ClassSymbol topClass = currentClass.outermostClass(); Name flatname = names.fromString("" + topClass.getQualifiedName() + target.syntheticNameChar() + "1"); ClassSymbol ctag = chk.compiled.get(flatname); if (ctag == null) ctag = makeEmptyClass(STATIC | SYNTHETIC, topClass); return ctag; }
public boolean needsHeader(ClassSymbol c) { if (c.isLocal() || (c.flags() & Flags.SYNTHETIC) != 0) return false; if (checkAll) return needsHeader(c.outermostClass(), true); else return needsHeader(c, false); }
/** Return an anonymous class nested in this toplevel class. */ ClassSymbol accessConstructorTag() { ClassSymbol topClass = currentClass.outermostClass(); Name flatname = names.fromString("" + topClass.getQualifiedName() + target.syntheticNameChar() + "1"); ClassSymbol ctag = chk.compiled.get(flatname); if (ctag == null) ctag = makeEmptyClass(STATIC | SYNTHETIC, topClass); return ctag; }
public boolean needsHeader(ClassSymbol c) { if (c.isLocal() || (c.flags() & Flags.SYNTHETIC) != 0) return false; if (checkAll) return needsHeader(c.outermostClass(), true); else return needsHeader(c, false); }
public static UClassIdent create(ClassSymbol sym) { return create(sym.outermostClass().getQualifiedName(), sym.getQualifiedName()); }