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