Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/main/java/com/jsoniter/ReflectionDecoderFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public static Decoder create(ClassInfo classAndArgs) {
if (clazz.isEnum()) {
return new ReflectionEnumDecoder(clazz);
}
if (clazz.isRecord()) {
return new ReflectionRecordDecoder(clazz, typeArgs);
}
return new ReflectionObjectDecoder(classAndArgs).create();
}
}
18 changes: 18 additions & 0 deletions src/test/java/com/jsoniter/TestRecord.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.jsoniter;

import junit.framework.TestCase;

import java.io.IOException;

public class TestRecord extends TestCase {

record TestRecord1(long field1) {

}

public void test_record_error() throws IOException {

JsonIterator iter = JsonIterator.parse("{ 'field1' : 1".replace('\'', '"'));
iter.read(TestRecord1.class);
}
}