RFR: 8303431: [JVMCI] libgraal annotation API [v7]

Joe Darcy darcy at openjdk.org
Tue Apr 18 01:09:56 UTC 2023


On Mon, 17 Apr 2023 20:33:30 GMT, Doug Simon <dnsimon at openjdk.org> wrote:

>> src/java.base/share/classes/jdk/internal/vm/VMSupport.java line 234:
>> 
>>> 232:      * Encodes a list of annotations to a byte array. The byte array can be decoded with {@link #decodeAnnotations(byte[], AnnotationDecoder)}.
>>> 233:      */
>>> 234:     public static byte[] encodeAnnotations(Collection<Annotation> annotations) {
>> 
>> I don't think it matters much in this use case, but it looks like  encodeAnnotations could be changed to take a List rather than a Collection, as the comment implies.
>
> Just above (line 228) you can see a call to this method where the argument comes from `Map.values()` whose type is `Collection` so I'd prefer to leave it as is rather than have to convert the argument to a `List`.

In that case, I think the comment on line 232 should be updated to not say "list".

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/12810#discussion_r1169391239


More information about the core-libs-dev mailing list