Skip to content

List.of for jdk >= 9 not deserialized OK #173

@laurgarn

Description

@laurgarn
diff --git a/src/test/groovy/com/cedarsoftware/util/io/TestCollection.groovy b/src/test/groovy/com/cedarsoftware/util/io/TestCollection.groovy
index 7c3c51b..7284a9f 100644
--- a/src/test/groovy/com/cedarsoftware/util/io/TestCollection.groovy
+++ b/src/test/groovy/com/cedarsoftware/util/io/TestCollection.groovy
@@ -79,6 +79,8 @@ class TestCollection {
         private Set _strs_c;
         private Set _strs_d;
         private HashSet _typedSet;
+        private List<String> _imm_lst_0;
+        private List<String> _imm_lst_1;
 
         private void init() {
             Collection array = new ArrayList()
@@ -191,6 +193,10 @@ class TestCollection {
             _typedSet.add(true)
             _typedSet.add(17.76)
             _typedSet.add(TimeZone.getTimeZone("PST"))
+
+            _imm_lst_0 = List.of();
+            _imm_lst_1 = List.of("One");
+
         }
     }

causes :

com.cedarsoftware.util.io.JsonIoException: 
null
Last read: neInfo","zone":"PST"},{"@type":"java.math.BigDecimal","value":"17.76"},{"@type":"date","value":19},"string",true],"_imm_lst_0":{"@type":"java.util.ImmutableCollections$ListN"},"_imm_lst_1":{"@type":"java.util.ImmutableCollections$List12","@items":["One"]}}
line: 1, col: 3263
        at com.cedarsoftware.util.io.TestCollection.testReconstituteCollection2(TestCollection.groovy:366)
Caused by: java.lang.UnsupportedOperationException
        at com.cedarsoftware.util.io.TestCollection.testReconstituteCollection2(TestCollection.groovy:366)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions