private List<ClassSymbol> enterNewClassFiles(Context currentContext) { ClassReader reader = ClassReader.instance(currentContext); Name.Table names = Name.Table.instance(currentContext); List<ClassSymbol> list = List.nil(); for (Map.Entry<String,JavaFileObject> entry : filer.getGeneratedClasses().entrySet()) { Name name = names.fromString(entry.getKey()); JavaFileObject file = entry.getValue(); if (file.getKind() != JavaFileObject.Kind.CLASS) throw new AssertionError(file); ClassSymbol cs; if (isPkgInfo(file, JavaFileObject.Kind.CLASS)) { Name packageName = Convert.packagePart(name); PackageSymbol p = reader.enterPackage(packageName); if (p.package_info == null) p.package_info = reader.enterClass(Convert.shortName(name), p); cs = p.package_info; if (cs.classfile == null) cs.classfile = file; } else cs = reader.enterClass(name, file); list = list.prepend(cs); } return list.reverse(); }
switch (tag) { case CONSTANT_Utf8: poolObj[i] = names.fromUtf(buf, index + 3, getChar(index + 1)); break; case CONSTANT_Unicode:
return sigEnterPhase ? Type.noType : findTypeVar(names.fromUtf(signature, start, sigp - 1 - start)); case '+': { sigp++;
return sigEnterPhase ? Type.noType : findTypeVar(names.fromUtf(signature, start, sigp - 1 - start)); case '+': { sigp++;
poolbuf.appendChar(pool.put(typeSig(c.type))); } else { poolbuf.appendChar(pool.put(names.fromUtf(externalize(c.flatname)))); enterInner(c); } else if (value instanceof String) { poolbuf.appendByte(CONSTANT_String); poolbuf.appendChar(pool.put(names.fromString((String)value))); } else if (value instanceof Type) { Type type = (Type)value;
poolbuf.appendChar(pool.put(typeSig(c.type))); } else { poolbuf.appendChar(pool.put(names.fromUtf(externalize(c.flatname)))); enterInner(c); } else if (value instanceof String) { poolbuf.appendByte(CONSTANT_String); poolbuf.appendChar(pool.put(names.fromString((String)value))); } else if (value instanceof Type) { Type type = (Type)value;
switch (tag) { case CONSTANT_Utf8: poolObj[i] = names.fromUtf(buf, index + 3, getChar(index + 1)); break; case CONSTANT_Unicode:
} finally { if (names != null && disposeNames) names.dispose(); names = null;
} finally { if (names != null && disposeNames) names.dispose(); names = null;
/** Convert (implicit) signature to type parameter. */ Type sigToTypeParam() { int start = sigp; while (signature[sigp] != ':') sigp++; Name name = names.fromUtf(signature, start, sigp - start); TypeVar tvar; if (sigEnterPhase) { tvar = new TypeVar(name, currentOwner, syms.botType); typevars.enter(tvar.tsym); } else { tvar = (TypeVar)findTypeVar(name); } List<Type> bounds = List.nil(); Type st = null; if (signature[sigp] == ':' && signature[sigp+1] == ':') { sigp++; st = syms.objectType; } while (signature[sigp] == ':') { sigp++; bounds = bounds.prepend(sigToType()); } if (!sigEnterPhase) { types.setBounds(tvar, bounds.reverse(), st); } return tvar; }
/** Convert (implicit) signature to type parameter. */ Type sigToTypeParam() { int start = sigp; while (signature[sigp] != ':') sigp++; Name name = names.fromUtf(signature, start, sigp - start); TypeVar tvar; if (sigEnterPhase) { tvar = new TypeVar(name, currentOwner); typevars.enter(tvar.tsym); } else { tvar = (TypeVar)findTypeVar(name); } List<Type> bounds = List.nil(); Type st = null; if (signature[sigp] == ':' && signature[sigp+1] == ':') { sigp++; st = syms.objectType; } while (signature[sigp] == ':') { sigp++; bounds = bounds.prepend(sigToType()); } if (!sigEnterPhase) { types.setBounds(tvar, bounds.reverse(), st); } return tvar; }
protected Lower(Context context) { context.put(lowerKey, this); names = Name.Table.instance(context); log = Log.instance(context); syms = Symtab.instance(context); rs = Resolve.instance(context); chk = Check.instance(context); attr = Attr.instance(context); make = TreeMaker.instance(context); writer = ClassWriter.instance(context); reader = ClassReader.instance(context); cfolder = ConstFold.instance(context); target = Target.instance(context); source = Source.instance(context); allowEnums = source.allowEnums(); dollarAssertionsDisabled = names. fromString(target.syntheticNameChar() + "assertionsDisabled"); classDollar = names. fromString("class" + target.syntheticNameChar()); types = Types.instance(context); Options options = Options.instance(context); debugLower = options.get("debuglower") != null; }
protected Lower(Context context) { context.put(lowerKey, this); names = Name.Table.instance(context); log = Log.instance(context); syms = Symtab.instance(context); rs = Resolve.instance(context); chk = Check.instance(context); attr = Attr.instance(context); make = TreeMaker.instance(context); writer = ClassWriter.instance(context); reader = ClassReader.instance(context); cfolder = ConstFold.instance(context); target = Target.instance(context); source = Source.instance(context); allowEnums = source.allowEnums(); dollarAssertionsDisabled = names. fromString(target.syntheticNameChar() + "assertionsDisabled"); classDollar = names. fromString("class" + target.syntheticNameChar()); types = Types.instance(context); Options options = Options.instance(context); debugLower = options.get("debuglower") != null; }
protected Check(Context context) { context.put(checkKey, this); names = Name.Table.instance(context); log = Log.instance(context); syms = Symtab.instance(context); infer = Infer.instance(context); this.types = Types.instance(context); Options options = Options.instance(context); target = Target.instance(context); source = Source.instance(context); lint = Lint.instance(context); treeinfo = TreeInfo.instance(context); Source source = Source.instance(context); allowGenerics = source.allowGenerics(); allowAnnotations = source.allowAnnotations(); complexInference = options.get("-complexinference") != null; skipAnnotations = options.get("skipAnnotations") != null; boolean verboseDeprecated = lint.isEnabled(LintCategory.DEPRECATION); boolean verboseUnchecked = lint.isEnabled(LintCategory.UNCHECKED); deprecationHandler = new MandatoryWarningHandler(log,verboseDeprecated, "deprecated"); uncheckedHandler = new MandatoryWarningHandler(log, verboseUnchecked, "unchecked"); }
protected Enter(Context context) { context.put(enterKey, this); log = Log.instance(context); reader = ClassReader.instance(context); make = TreeMaker.instance(context); syms = Symtab.instance(context); chk = Check.instance(context); memberEnter = MemberEnter.instance(context); annotate = Annotate.instance(context); lint = Lint.instance(context); names = Name.Table.instance(context); predefClassDef = make.ClassDef( make.Modifiers(PUBLIC), syms.predefClass.name, null, null, null, null); predefClassDef.sym = syms.predefClass; todo = Todo.instance(context); fileManager = context.get(JavaFileManager.class); }
protected MemberEnter(Context context) { context.put(memberEnterKey, this); names = Name.Table.instance(context); enter = Enter.instance(context); log = Log.instance(context); chk = Check.instance(context); attr = Attr.instance(context); syms = Symtab.instance(context); make = TreeMaker.instance(context); reader = ClassReader.instance(context); todo = Todo.instance(context); annotate = Annotate.instance(context); types = Types.instance(context); target = Target.instance(context); skipAnnotations = Options.instance(context).get("skipAnnotations") != null; }