Skip to content

Commit

Permalink
fix register serializer for xlang
Browse files Browse the repository at this point in the history
  • Loading branch information
chaokunyang committed Sep 26, 2024
1 parent 2fef88c commit 7ade4c2
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.Collection;
import java.util.List;
import org.apache.fury.Fury;
import org.apache.fury.config.Language;
import org.apache.fury.logging.Logger;
import org.apache.fury.logging.LoggerFactory;
import org.apache.fury.memory.MemoryBuffer;
Expand Down Expand Up @@ -66,6 +67,7 @@ private interface Stub {}
cls = Class.forName("java.util.ImmutableCollections.SubList");
} catch (ClassNotFoundException e) {
class ImmutableSubListStub implements Stub {}

cls = ImmutableSubListStub.class;
}
ImmutableSubListClass = cls;
Expand All @@ -76,7 +78,7 @@ public static void registerSerializers(Fury fury, boolean preserveView) {
new Class[] {
SubListClass, RandomAccessSubListClass, ArrayListSubListClass, ImmutableSubListClass
}) {
if (preserveView) {
if (preserveView && fury.getConfig().getLanguage() == Language.JAVA) {
fury.registerSerializer(cls, new SubListViewSerializer(fury, (Class<List>) cls));
} else {
fury.registerSerializer(cls, new SubListSerializer(fury, (Class<List>) cls));
Expand Down

0 comments on commit 7ade4c2

Please sign in to comment.