chaokunyang commented on code in PR #1892:
URL: https://github.com/apache/fury/pull/1892#discussion_r1809137802
##########
java/fury-core/src/main/java/org/apache/fury/serializer/EnumSerializer.java:
##########
@@ -20,40 +20,69 @@
package org.apache.fury.serializer;
import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
import org.apache.fury.Fury;
import org.apache.fury.memory.MemoryBuffer;
+import org.apache.fury.meta.MetaString;
+import org.apache.fury.resolver.MetaStringResolver;
import org.apache.fury.util.Preconditions;
@SuppressWarnings("rawtypes")
-public final class EnumSerializer extends ImmutableSerializer<Enum> {
+public class EnumSerializer extends ImmutableSerializer<Enum> {
+ private static final MetaStringResolver META_STRING_RESOLVER = new
MetaStringResolver();
private final Enum[] enumConstants;
+ private final Map<String, Enum> enumStringRepresentation;
Review Comment:
If key is MetaStringBytes, could you use IdentityMap instead?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]