We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents fc8c4d8 + fff39bd commit 7fc8851Copy full SHA for 7fc8851
2 files changed
src/main/java/com/jsoniter/ReflectionDecoderFactory.java
@@ -23,6 +23,9 @@ public static Decoder create(ClassInfo classAndArgs) {
23
if (clazz.isEnum()) {
24
return new ReflectionEnumDecoder(clazz);
25
}
26
+ if (clazz.isRecord()) {
27
+ return new ReflectionRecordDecoder(clazz, typeArgs);
28
+ }
29
return new ReflectionObjectDecoder(classAndArgs).create();
30
31
src/test/java/com/jsoniter/TestRecord.java
@@ -0,0 +1,18 @@
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
+}
0 commit comments