< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java

Print this page

 363                 toAnnotate.flags_field |= (Flags.DEPRECATED | Flags.DEPRECATED_ANNOTATION);
 364                 if (isAttributeTrue(c.member(names.forRemoval))) {
 365                     toAnnotate.flags_field |= Flags.DEPRECATED_REMOVAL;
 366                 }
 367             }
 368 
 369             if (!c.type.isErroneous()
 370                     && types.isSameType(c.type, syms.previewFeatureType)) {
 371                 toAnnotate.flags_field |= Flags.PREVIEW_API;
 372                 if (isAttributeTrue(c.member(names.reflective))) {
 373                     toAnnotate.flags_field |= Flags.PREVIEW_REFLECTIVE;
 374                 }
 375             }
 376 
 377             if (!c.type.isErroneous()
 378                     && toAnnotate.kind == TYP
 379                     && types.isSameType(c.type, syms.valueBasedType)) {
 380                 toAnnotate.flags_field |= Flags.VALUE_BASED;
 381             }
 382 















 383             if (!c.type.isErroneous()
 384                     && types.isSameType(c.type, syms.restrictedType)) {
 385                 toAnnotate.flags_field |= Flags.RESTRICTED;
 386             }
 387 
 388             if (!c.type.isErroneous()
 389                     && toAnnotate.kind == VAR
 390                     && types.isSameType(c.type, syms.requiresIdentityType)) {
 391                 toAnnotate.flags_field |= Flags.REQUIRES_IDENTITY;
 392             }
 393         }
 394 
 395         List<T> buf = List.nil();
 396         for (ListBuffer<T> lb : annotated.values()) {
 397             if (lb.size() == 1) {
 398                 buf = buf.prepend(lb.first());
 399             } else {
 400                 AnnotationContext<T> ctx = new AnnotationContext<>(env, annotated, pos, typeAnnotations);
 401                 T res = makeContainerAnnotation(lb.toList(), ctx, toAnnotate, isTypeParam);
 402                 if (res != null)

 363                 toAnnotate.flags_field |= (Flags.DEPRECATED | Flags.DEPRECATED_ANNOTATION);
 364                 if (isAttributeTrue(c.member(names.forRemoval))) {
 365                     toAnnotate.flags_field |= Flags.DEPRECATED_REMOVAL;
 366                 }
 367             }
 368 
 369             if (!c.type.isErroneous()
 370                     && types.isSameType(c.type, syms.previewFeatureType)) {
 371                 toAnnotate.flags_field |= Flags.PREVIEW_API;
 372                 if (isAttributeTrue(c.member(names.reflective))) {
 373                     toAnnotate.flags_field |= Flags.PREVIEW_REFLECTIVE;
 374                 }
 375             }
 376 
 377             if (!c.type.isErroneous()
 378                     && toAnnotate.kind == TYP
 379                     && types.isSameType(c.type, syms.valueBasedType)) {
 380                 toAnnotate.flags_field |= Flags.VALUE_BASED;
 381             }
 382 
 383             if (!c.type.isErroneous()
 384                     && toAnnotate.kind == TYP
 385                     && types.isSameType(c.type, syms.migratedValueClassType)) {
 386                 toAnnotate.flags_field |= Flags.MIGRATED_VALUE_CLASS;
 387             }
 388 
 389             if (!c.type.isErroneous()
 390                     && toAnnotate.kind == VAR
 391                     && toAnnotate.owner.kind == TYP
 392                     && types.isSameType(c.type, syms.strictType)) {
 393                 toAnnotate.flags_field |= Flags.STRICT;
 394                 // temporary hack to indicate that a class has at least one strict field
 395                 toAnnotate.owner.flags_field |= Flags.HAS_STRICT;
 396             }
 397 
 398             if (!c.type.isErroneous()
 399                     && types.isSameType(c.type, syms.restrictedType)) {
 400                 toAnnotate.flags_field |= Flags.RESTRICTED;
 401             }
 402 
 403             if (!c.type.isErroneous()
 404                     && toAnnotate.kind == VAR
 405                     && types.isSameType(c.type, syms.requiresIdentityType)) {
 406                 toAnnotate.flags_field |= Flags.REQUIRES_IDENTITY;
 407             }
 408         }
 409 
 410         List<T> buf = List.nil();
 411         for (ListBuffer<T> lb : annotated.values()) {
 412             if (lb.size() == 1) {
 413                 buf = buf.prepend(lb.first());
 414             } else {
 415                 AnnotationContext<T> ctx = new AnnotationContext<>(env, annotated, pos, typeAnnotations);
 416                 T res = makeContainerAnnotation(lb.toList(), ctx, toAnnotate, isTypeParam);
 417                 if (res != null)
< prev index next >