Skip to content

Records support, Java 17 and jigsaw modules #325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e598ce7
feat - migrated maven project to java 16 (#1)
mxyns Mar 2, 2022
fc8c4d8
Merge pull request #2 from noahra/issue/#1
mxyns Mar 2, 2022
fff39bd
test - failing test for unsupported Record (#3)
mxyns Mar 2, 2022
7fc8851
Merge pull request #4 from noahra/issue/#3
mxyns Mar 2, 2022
4766703
test - add serialization test (#7)
lnsandnkth Mar 2, 2022
0d893a4
Merge pull request #8 from noahra/issue/#7
lnsandnkth Mar 2, 2022
da40903
test - fix added assertion (#3)
lnsandnkth Mar 2, 2022
6927007
Merge pull request #10 from noahra/issue/#3
lnsandnkth Mar 2, 2022
077c4d5
feat - record support with canonical constructor (#5) (PR #13)
yuxin-miao Mar 4, 2022
149b796
feat - handle multiple record constructors by using canonical constru…
mxyns Mar 4, 2022
4b7c1f0
test - add tests for any wrap and stream (#15)
lnsandnkth Mar 4, 2022
ac59b48
Merge pull request #17 from noahra/issue/#15
lnsandnkth Mar 4, 2022
8dc32ff
test - example of use of another constructor for record decoding (#16)
mxyns Mar 6, 2022
f921396
clean - reemoved syso/sout (#19)
mxyns Mar 6, 2022
2d2ff04
clean - removed unsused imports (#19)
mxyns Mar 6, 2022
37a6755
test - add tests for getRecordCtor (#21)
Mar 6, 2022
dc3a7af
Modularized, Java17, dependency-updates.
Aug 13, 2022
e736444
trying source and target tags to try to fix jitpack.io compilation
Aug 13, 2022
bdbd720
java.lang.module.FindException: Module com.fasterxml.jackson.databind
Aug 13, 2022
6a90a5a
transitive module Javassist not found
Aug 13, 2022
1652d87
revert transitive and open for more tests
Aug 13, 2022
0451822
fixed module-info using "requires static" for optional and test-only
Aug 16, 2022
26eab37
opened module
Aug 16, 2022
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);
}
}