< 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 
 389         List<T> buf = List.nil();
 390         for (ListBuffer<T> lb : annotated.values()) {
 391             if (lb.size() == 1) {
 392                 buf = buf.prepend(lb.first());
 393             } else {
 394                 AnnotationContext<T> ctx = new AnnotationContext<>(env, annotated, pos, typeAnnotations);
 395                 T res = makeContainerAnnotation(lb.toList(), ctx, toAnnotate, isTypeParam);
 396                 if (res != null)
 397                     buf = buf.prepend(res);
 398             }
 399         }
 400 
 401         if (typeAnnotations) {
 402             @SuppressWarnings("unchecked")

 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             }
 395 
 396             if (!c.type.isErroneous()
 397                     && types.isSameType(c.type, syms.restrictedType)) {
 398                 toAnnotate.flags_field |= Flags.RESTRICTED;
 399             }
 400         }
 401 
 402         List<T> buf = List.nil();
 403         for (ListBuffer<T> lb : annotated.values()) {
 404             if (lb.size() == 1) {
 405                 buf = buf.prepend(lb.first());
 406             } else {
 407                 AnnotationContext<T> ctx = new AnnotationContext<>(env, annotated, pos, typeAnnotations);
 408                 T res = makeContainerAnnotation(lb.toList(), ctx, toAnnotate, isTypeParam);
 409                 if (res != null)
 410                     buf = buf.prepend(res);
 411             }
 412         }
 413 
 414         if (typeAnnotations) {
 415             @SuppressWarnings("unchecked")
< prev index next >