Skip to content

Commit cdbbf45

Browse files
committed
Resolve merge conflict
due to changes to the internal TypeMetadata API for JDK-8303820
1 parent 4c03b6e commit cdbbf45

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2464,10 +2464,14 @@ private <T extends Type> Type reannotate(T t, BiFunction<T, Void, Type> f) {
24642464
}
24652465
// Runtime-visible and -invisible annotations are completed separately, so if the same
24662466
// type has annotations from both it will get annotated twice.
2467-
TypeMetadata.Annotations existing = mapped.getMetadata(TypeMetadata.Annotations.class);
2467+
TypeMetadata metadata = mapped.getMetadata();
2468+
TypeMetadata.Annotations existing =
2469+
(TypeMetadata.Annotations) metadata.get(TypeMetadata.Entry.Kind.ANNOTATIONS);
24682470
if (existing != null) {
2469-
existing.annotationBuffer().addAll(attributes);
2470-
return mapped;
2471+
TypeMetadata.Annotations combined = new TypeMetadata.Annotations(
2472+
existing.getAnnotations().appendList(attributes));
2473+
return mapped.cloneWithMetadata(
2474+
metadata.without(TypeMetadata.Entry.Kind.ANNOTATIONS).combine(combined));
24712475
}
24722476
return mapped.annotatedType(attributes);
24732477
}

0 commit comments

Comments
 (0)