File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ public static Decoder create(ClassInfo classAndArgs) {
23
23
if (clazz .isEnum ()) {
24
24
return new ReflectionEnumDecoder (clazz );
25
25
}
26
+ if (clazz .isRecord ()) {
27
+ return new ReflectionRecordDecoder (clazz , typeArgs );
28
+ }
26
29
return new ReflectionObjectDecoder (classAndArgs ).create ();
27
30
}
28
31
}
Original file line number Diff line number Diff line change
1
+ package com .jsoniter ;
2
+
3
+ import junit .framework .TestCase ;
4
+
5
+ import java .io .IOException ;
6
+
7
+ public class TestRecord extends TestCase {
8
+
9
+ record TestRecord1 (long field1 ) {
10
+
11
+ }
12
+
13
+ public void test_record_error () throws IOException {
14
+
15
+ JsonIterator iter = JsonIterator .parse ("{ 'field1' : 1" .replace ('\'' , '"' ));
16
+ iter .read (TestRecord1 .class );
17
+ }
18
+ }
You can’t perform that action at this time.
0 commit comments