From ef3d014acb29262e17aa802e494cc3c0420d837a Mon Sep 17 00:00:00 2001 From: Lev Leontev Date: Tue, 26 Nov 2024 15:24:42 +0100 Subject: [PATCH] Use correct types in EnumMapCodec to avoid red highlighting in IntelliJ --- .../build/lib/skyframe/serialization/EnumMapCodec.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/serialization/EnumMapCodec.java b/src/main/java/com/google/devtools/build/lib/skyframe/serialization/EnumMapCodec.java index 86eed40226886f..8559f0a7553459 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/serialization/EnumMapCodec.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/serialization/EnumMapCodec.java @@ -81,7 +81,7 @@ public EnumMap deserializeAsync(AsyncDeserializationContext context, CodedInputS MapBuffer buffer = new MapBuffer(result, size); - Object[] enums = clazz.getEnumConstants(); + Enum[] enums = (Enum[]) clazz.getEnumConstants(); for (int i = 0; i < size; i++) { int ordinal = codedIn.readInt32(); buffer.setEnum(i, enums[ordinal]); @@ -97,14 +97,14 @@ public EnumMap deserializeAsync(AsyncDeserializationContext context, CodedInputS /** Buffers the entry elements and populates the map once all values are done. */ private static class MapBuffer implements Runnable { private final EnumMap result; - private final Object[] enums; + private final Enum[] enums; private final Object[] values; private final AtomicInteger remaining; private MapBuffer(EnumMap result, int size) { this.result = result; - this.enums = new Object[size]; + this.enums = new Enum[size]; this.values = new Object[size]; this.remaining = new AtomicInteger(size); } @@ -118,7 +118,7 @@ public void run() { } } - private void setEnum(int index, Object enumKey) { + private void setEnum(int index, Enum enumKey) { enums[index] = enumKey; } }