Java Code Examples for com.sun.tools.javac.code.Symbol.Completer#NULL_COMPLETER
The following examples show how to use
com.sun.tools.javac.code.Symbol.Completer#NULL_COMPLETER .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Symtab.java From lua-for-android with BSD 3-Clause "New" or "Revised" License | 5 votes |
private Type enterSyntheticAnnotation(String name) { // for now, leave the module null, to prevent problems from synthesizing the // existence of a class in any specific module, including noModule ClassType type = (ClassType)enterClass(java_base, names.fromString(name)).type; ClassSymbol sym = (ClassSymbol)type.tsym; sym.completer = Completer.NULL_COMPLETER; sym.flags_field = PUBLIC|ACYCLIC|ANNOTATION|INTERFACE; sym.erasure_field = type; sym.members_field = WriteableScope.create(sym); type.typarams_field = List.nil(); type.allparams_field = List.nil(); type.supertype_field = annotationType; type.interfaces_field = List.nil(); return type; }
Example 2
Source File: Lower.java From lua-for-android with BSD 3-Clause "New" or "Revised" License | 5 votes |
JCClassDecl makeEmptyClass(long flags, ClassSymbol owner, Name flatname, boolean addToDefs) { // Create class symbol. ClassSymbol c = syms.defineClass(names.empty, owner); if (flatname != null) { c.flatname = flatname; } else { c.flatname = chk.localClassName(c); } c.sourcefile = owner.sourcefile; c.completer = Completer.NULL_COMPLETER; c.members_field = WriteableScope.create(c); c.flags_field = flags; ClassType ctype = (ClassType) c.type; ctype.supertype_field = syms.objectType; ctype.interfaces_field = List.nil(); JCClassDecl odef = classDef(owner); // Enter class symbol in owner scope and compiled table. enterSynthetic(odef.pos(), c, owner.members()); chk.putCompiled(c); // Create class definition tree. JCClassDecl cdef = make.ClassDef( make.Modifiers(flags), names.empty, List.nil(), null, List.nil(), List.nil()); cdef.sym = c; cdef.type = c.type; // Append class definition tree to owner's definitions. if (addToDefs) odef.defs = odef.defs.prepend(cdef); return cdef; }
Example 3
Source File: Symtab.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private Type enterSyntheticAnnotation(String name) { // for now, leave the module null, to prevent problems from synthesizing the // existence of a class in any specific module, including noModule ClassType type = (ClassType)enterClass(java_base, names.fromString(name)).type; ClassSymbol sym = (ClassSymbol)type.tsym; sym.completer = Completer.NULL_COMPLETER; sym.flags_field = PUBLIC|ACYCLIC|ANNOTATION|INTERFACE; sym.erasure_field = type; sym.members_field = WriteableScope.create(sym); type.typarams_field = List.nil(); type.allparams_field = List.nil(); type.supertype_field = annotationType; type.interfaces_field = List.nil(); return type; }
Example 4
Source File: ModuleFinder.java From lua-for-android with BSD 3-Clause "New" or "Revised" License | 4 votes |
private ModuleSymbol readModule(JavaFileObject fo) throws IOException { Name name; switch (fo.getKind()) { case SOURCE: name = moduleNameFromSourceReader.readModuleName(fo); if (name == null) { JCDiagnostic diag = diags.fragment(Fragments.FileDoesNotContainModule); ClassSymbol errModuleInfo = syms.defineClass(names.module_info, syms.errModule); throw new ClassFinder.BadClassFile(errModuleInfo, fo, diag, diags); } break; case CLASS: try { name = names.fromString(readModuleName(fo)); } catch (BadClassFile | IOException ex) { //fillIn will report proper errors: name = names.error; } break; default: Assert.error(); name = names.error; break; } ModuleSymbol msym = syms.enterModule(name); msym.module_info.classfile = fo; if (fileManager.hasLocation(StandardLocation.PATCH_MODULE_PATH) && name != names.error) { msym.patchLocation = fileManager.getLocationForModule(StandardLocation.PATCH_MODULE_PATH, name.toString()); if (msym.patchLocation != null) { JavaFileObject patchFO = getModuleInfoFromLocation(StandardLocation.CLASS_OUTPUT, Kind.CLASS); patchFO = preferredFileObject(getModuleInfoFromLocation(msym.patchLocation, Kind.CLASS), patchFO); patchFO = preferredFileObject(getModuleInfoFromLocation(msym.patchLocation, Kind.SOURCE), patchFO); if (patchFO != null) { msym.module_info.classfile = patchFO; } } } msym.completer = Completer.NULL_COMPLETER; classFinder.fillIn(msym.module_info); return msym; }
Example 5
Source File: ModuleFinder.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
private ModuleSymbol readModule(JavaFileObject fo) throws IOException { Name name; switch (fo.getKind()) { case SOURCE: name = moduleNameFromSourceReader.readModuleName(fo); if (name == null) { JCDiagnostic diag = diags.fragment("file.does.not.contain.module"); ClassSymbol errModuleInfo = syms.defineClass(names.module_info, syms.errModule); throw new ClassFinder.BadClassFile(errModuleInfo, fo, diag, diags); } break; case CLASS: try { name = names.fromString(readModuleName(fo)); } catch (BadClassFile | IOException ex) { //fillIn will report proper errors: name = names.error; } break; default: Assert.error(); name = names.error; break; } ModuleSymbol msym = syms.enterModule(name); msym.module_info.classfile = fo; if (fileManager.hasLocation(StandardLocation.PATCH_MODULE_PATH) && name != names.error) { msym.patchLocation = fileManager.getLocationForModule(StandardLocation.PATCH_MODULE_PATH, name.toString()); if (msym.patchLocation != null) { JavaFileObject patchFO = getModuleInfoFromLocation(StandardLocation.CLASS_OUTPUT, Kind.CLASS); patchFO = preferredFileObject(getModuleInfoFromLocation(msym.patchLocation, Kind.CLASS), patchFO); patchFO = preferredFileObject(getModuleInfoFromLocation(msym.patchLocation, Kind.SOURCE), patchFO); if (patchFO != null) { msym.module_info.classfile = patchFO; } } } msym.completer = Completer.NULL_COMPLETER; classFinder.fillIn(msym.module_info); return msym; }