src/share/classes/com/sun/tools/javac/code/Symtab.java

changeset 267
e2722bd43f3a
parent 136
8eafba4f61be
child 357
abe992640c5a
equal deleted inserted replaced
263:825f23a4f262 267:e2722bd43f3a
117 public final Type stringType; 117 public final Type stringType;
118 public final Type stringBufferType; 118 public final Type stringBufferType;
119 public final Type stringBuilderType; 119 public final Type stringBuilderType;
120 public final Type cloneableType; 120 public final Type cloneableType;
121 public final Type serializableType; 121 public final Type serializableType;
122 public final Type methodHandleType;
123 public final Type invokeDynamicType;
122 public final Type throwableType; 124 public final Type throwableType;
123 public final Type errorType; 125 public final Type errorType;
124 public final Type illegalArgumentExceptionType; 126 public final Type illegalArgumentExceptionType;
125 public final Type exceptionType; 127 public final Type exceptionType;
126 public final Type runtimeExceptionType; 128 public final Type runtimeExceptionType;
281 try { 283 try {
282 completer.complete(sym); 284 completer.complete(sym);
283 } catch (CompletionFailure e) { 285 } catch (CompletionFailure e) {
284 sym.flags_field |= (PUBLIC | INTERFACE); 286 sym.flags_field |= (PUBLIC | INTERFACE);
285 ((ClassType) sym.type).supertype_field = objectType; 287 ((ClassType) sym.type).supertype_field = objectType;
288 }
289 }
290 };
291 }
292 }
293
294 public void synthesizeMHTypeIfMissing(final Type type) {
295 final Completer completer = type.tsym.completer;
296 if (completer != null) {
297 type.tsym.completer = new Completer() {
298 public void complete(Symbol sym) throws CompletionFailure {
299 try {
300 completer.complete(sym);
301 } catch (CompletionFailure e) {
302 sym.flags_field |= (PUBLIC | ABSTRACT);
303 ((ClassType) sym.type).supertype_field = objectType;
304 // do not bother to create MH.type if not visibly declared
305 // this sym just accumulates invoke(...) methods
286 } 306 }
287 } 307 }
288 }; 308 };
289 } 309 }
290 } 310 }
403 stringBufferType = enterClass("java.lang.StringBuffer"); 423 stringBufferType = enterClass("java.lang.StringBuffer");
404 stringBuilderType = enterClass("java.lang.StringBuilder"); 424 stringBuilderType = enterClass("java.lang.StringBuilder");
405 cloneableType = enterClass("java.lang.Cloneable"); 425 cloneableType = enterClass("java.lang.Cloneable");
406 throwableType = enterClass("java.lang.Throwable"); 426 throwableType = enterClass("java.lang.Throwable");
407 serializableType = enterClass("java.io.Serializable"); 427 serializableType = enterClass("java.io.Serializable");
428 methodHandleType = enterClass("java.dyn.MethodHandle");
429 invokeDynamicType = enterClass("java.dyn.InvokeDynamic");
408 errorType = enterClass("java.lang.Error"); 430 errorType = enterClass("java.lang.Error");
409 illegalArgumentExceptionType = enterClass("java.lang.IllegalArgumentException"); 431 illegalArgumentExceptionType = enterClass("java.lang.IllegalArgumentException");
410 exceptionType = enterClass("java.lang.Exception"); 432 exceptionType = enterClass("java.lang.Exception");
411 runtimeExceptionType = enterClass("java.lang.RuntimeException"); 433 runtimeExceptionType = enterClass("java.lang.RuntimeException");
412 classNotFoundExceptionType = enterClass("java.lang.ClassNotFoundException"); 434 classNotFoundExceptionType = enterClass("java.lang.ClassNotFoundException");
439 inheritedType = enterClass("java.lang.annotation.Inherited"); 461 inheritedType = enterClass("java.lang.annotation.Inherited");
440 systemType = enterClass("java.lang.System"); 462 systemType = enterClass("java.lang.System");
441 463
442 synthesizeEmptyInterfaceIfMissing(cloneableType); 464 synthesizeEmptyInterfaceIfMissing(cloneableType);
443 synthesizeEmptyInterfaceIfMissing(serializableType); 465 synthesizeEmptyInterfaceIfMissing(serializableType);
466 synthesizeMHTypeIfMissing(methodHandleType);
467 synthesizeMHTypeIfMissing(invokeDynamicType);
444 synthesizeBoxTypeIfMissing(doubleType); 468 synthesizeBoxTypeIfMissing(doubleType);
445 synthesizeBoxTypeIfMissing(floatType); 469 synthesizeBoxTypeIfMissing(floatType);
446 470
447 // Enter a synthetic class that is used to mark Sun 471 // Enter a synthetic class that is used to mark Sun
448 // proprietary classes in ct.sym. This class does not have a 472 // proprietary classes in ct.sym. This class does not have a

mercurial