310 new ClassSymbol(
311 PUBLIC, names.fromString(name), type, rootPackage));
312 }
313
314 public void initType(Type type, String name, String bname) {
315 initType(type, name);
316 boxedName[type.getTag().ordinal()] = names.fromString("java.lang." + bname);
317 }
318
319 /** The class symbol that owns all predefined symbols.
320 */
321 public final ClassSymbol predefClass;
322
323 /** Enter a class into symbol table.
324 * @param s The name of the class.
325 */
326 private Type enterClass(String s) {
327 return enterClass(java_base, names.fromString(s)).type;
328 }
329
330 public void synthesizeEmptyInterfaceIfMissing(final Type type) {
331 final Completer completer = type.tsym.completer;
332 type.tsym.completer = new Completer() {
333 @Override
334 public void complete(Symbol sym) throws CompletionFailure {
335 try {
336 completer.complete(sym);
337 } catch (CompletionFailure e) {
338 sym.flags_field |= (PUBLIC | INTERFACE);
339 ((ClassType) sym.type).supertype_field = objectType;
340 }
341 }
342
343 @Override
344 public boolean isTerminal() {
345 return completer.isTerminal();
346 }
347 };
348 }
349
|
310 new ClassSymbol(
311 PUBLIC, names.fromString(name), type, rootPackage));
312 }
313
314 public void initType(Type type, String name, String bname) {
315 initType(type, name);
316 boxedName[type.getTag().ordinal()] = names.fromString("java.lang." + bname);
317 }
318
319 /** The class symbol that owns all predefined symbols.
320 */
321 public final ClassSymbol predefClass;
322
323 /** Enter a class into symbol table.
324 * @param s The name of the class.
325 */
326 private Type enterClass(String s) {
327 return enterClass(java_base, names.fromString(s)).type;
328 }
329
330 /** Enter a class into symbol table.
331 * @param s The name of the class.
332 */
333 public Type enterClass(ModuleSymbol moduleSymbol, String s) {
334 try {
335 return enterClass(moduleSymbol, names.fromString(s)).type;
336 } catch (Throwable ex) {
337 ex.printStackTrace();
338 return Type.noType;
339 }
340 }
341
342 public void synthesizeEmptyInterfaceIfMissing(final Type type) {
343 final Completer completer = type.tsym.completer;
344 type.tsym.completer = new Completer() {
345 @Override
346 public void complete(Symbol sym) throws CompletionFailure {
347 try {
348 completer.complete(sym);
349 } catch (CompletionFailure e) {
350 sym.flags_field |= (PUBLIC | INTERFACE);
351 ((ClassType) sym.type).supertype_field = objectType;
352 }
353 }
354
355 @Override
356 public boolean isTerminal() {
357 return completer.isTerminal();
358 }
359 };
360 }
361
|