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

changeset 573
005bec70ca27
parent 554
9d9f26857129
parent 571
f0e3ec1f9d9f
child 591
d1d7595fa824
equal deleted inserted replaced
570:ab1356297c67 573:005bec70ca27
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; 122 public final Type methodHandleType;
123 public final Type polymorphicSignatureType;
123 public final Type invokeDynamicType; 124 public final Type invokeDynamicType;
124 public final Type throwableType; 125 public final Type throwableType;
125 public final Type errorType; 126 public final Type errorType;
126 public final Type illegalArgumentExceptionType; 127 public final Type illegalArgumentExceptionType;
127 public final Type exceptionType; 128 public final Type exceptionType;
283 try { 284 try {
284 completer.complete(sym); 285 completer.complete(sym);
285 } catch (CompletionFailure e) { 286 } catch (CompletionFailure e) {
286 sym.flags_field |= (PUBLIC | INTERFACE); 287 sym.flags_field |= (PUBLIC | INTERFACE);
287 ((ClassType) sym.type).supertype_field = objectType; 288 ((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
306 } 289 }
307 } 290 }
308 }; 291 };
309 } 292 }
310 } 293 }
424 stringBuilderType = enterClass("java.lang.StringBuilder"); 407 stringBuilderType = enterClass("java.lang.StringBuilder");
425 cloneableType = enterClass("java.lang.Cloneable"); 408 cloneableType = enterClass("java.lang.Cloneable");
426 throwableType = enterClass("java.lang.Throwable"); 409 throwableType = enterClass("java.lang.Throwable");
427 serializableType = enterClass("java.io.Serializable"); 410 serializableType = enterClass("java.io.Serializable");
428 methodHandleType = enterClass("java.dyn.MethodHandle"); 411 methodHandleType = enterClass("java.dyn.MethodHandle");
412 polymorphicSignatureType = enterClass("java.dyn.MethodHandle$PolymorphicSignature");
429 invokeDynamicType = enterClass("java.dyn.InvokeDynamic"); 413 invokeDynamicType = enterClass("java.dyn.InvokeDynamic");
430 errorType = enterClass("java.lang.Error"); 414 errorType = enterClass("java.lang.Error");
431 illegalArgumentExceptionType = enterClass("java.lang.IllegalArgumentException"); 415 illegalArgumentExceptionType = enterClass("java.lang.IllegalArgumentException");
432 exceptionType = enterClass("java.lang.Exception"); 416 exceptionType = enterClass("java.lang.Exception");
433 runtimeExceptionType = enterClass("java.lang.RuntimeException"); 417 runtimeExceptionType = enterClass("java.lang.RuntimeException");
461 inheritedType = enterClass("java.lang.annotation.Inherited"); 445 inheritedType = enterClass("java.lang.annotation.Inherited");
462 systemType = enterClass("java.lang.System"); 446 systemType = enterClass("java.lang.System");
463 447
464 synthesizeEmptyInterfaceIfMissing(cloneableType); 448 synthesizeEmptyInterfaceIfMissing(cloneableType);
465 synthesizeEmptyInterfaceIfMissing(serializableType); 449 synthesizeEmptyInterfaceIfMissing(serializableType);
466 synthesizeMHTypeIfMissing(methodHandleType); 450 synthesizeEmptyInterfaceIfMissing(polymorphicSignatureType);
467 synthesizeMHTypeIfMissing(invokeDynamicType);
468 synthesizeBoxTypeIfMissing(doubleType); 451 synthesizeBoxTypeIfMissing(doubleType);
469 synthesizeBoxTypeIfMissing(floatType); 452 synthesizeBoxTypeIfMissing(floatType);
470 synthesizeBoxTypeIfMissing(voidType); 453 synthesizeBoxTypeIfMissing(voidType);
471 454
472 // Enter a synthetic class that is used to mark Sun 455 // Enter a synthetic class that is used to mark Sun

mercurial