chaokunyang commented on code in PR #1701:
URL: https://github.com/apache/fury/pull/1701#discussion_r1676803198
##########
java/fury-core/src/main/java/org/apache/fury/serializer/collection/SynchronizedSerializers.java:
##########
@@ -105,11 +106,23 @@ public Collection read(MemoryBuffer buffer) {
public static final class SynchronizedMapSerializer extends
MapSerializer<Map> {
private final Function factory;
private final long offset;
+ private final boolean isSortedMap;
public SynchronizedMapSerializer(Fury fury, Class cls, Function factory,
long offset) {
super(fury, cls, false);
this.factory = factory;
this.offset = offset;
+ this.isSortedMap = SortedMap.class.isAssignableFrom(cls);
+ }
+
+ @Override
+ public Map newMap(Map map) {
Review Comment:
Why not just:
```java
public Map copy(Map object) {
Object unwrapped = Platform.getObject(object, offset);
synchronized (object) {
return factory.apply(fury.copy(unwrapped));
}
}
```
--
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]