Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 0 additions & 4 deletions src/main/java/com/jsoniter/ReflectionObjectDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public ReflectionObjectDecoder(ClassInfo classInfo) {

protected final void init(ClassInfo classInfo) throws Exception {

System.out.println("INIT");
Class clazz = classInfo.clazz;
ClassDescriptor desc = ClassDescriptor.getDecodingClassDescriptor(classInfo, true);
for (Binding param : desc.ctor.parameters) {
Expand Down Expand Up @@ -118,7 +117,6 @@ public class OnlyField implements Decoder {

public Object decode(JsonIterator iter) throws IOException {
try {
System.out.println("ONLY FIELD");
return decode_(iter);
} catch (RuntimeException e) {
throw e;
Expand Down Expand Up @@ -184,7 +182,6 @@ public class WithCtor implements Decoder {
@Override
public Object decode(JsonIterator iter) throws IOException {
try {
System.out.println("WITH CTOR");
return decode_(iter);
} catch (RuntimeException e) {
throw e;
Expand Down Expand Up @@ -264,7 +261,6 @@ public class WithWrapper implements Decoder {
@Override
public Object decode(JsonIterator iter) throws IOException {
try {
System.out.println("WITH WRAPPER");
return decode_(iter);
} catch (RuntimeException e) {
throw e;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/jsoniter/ReflectionRecordDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public class OnlyFieldRecord implements Decoder {
public Object decode(JsonIterator iter) throws IOException {

try {
System.out.println("ONLY FIELD RECORD");
return decode_(iter);
} catch (RuntimeException e) {
throw e;
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/jsoniter/spi/ClassDescriptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,6 @@ private static ConstructorDescriptor getRecordCtor(Class<?> clazz) {
ConstructorDescriptor cctor = new ConstructorDescriptor();
try {
Class<?>[] canonicalParameterTypes = Arrays.stream(clazz.getRecordComponents()).map(RecordComponent::getType).toArray(Class<?>[]::new);
System.out.println("Canonical Parameter Types : ");
System.out.println(Arrays.toString(canonicalParameterTypes));
cctor.ctor = clazz.getDeclaredConstructor(canonicalParameterTypes);
} catch (Exception e) {
cctor.ctor = null;
Expand Down
11 changes: 8 additions & 3 deletions src/test/java/com/jsoniter/TestRecord.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
import junit.framework.TestCase;

import java.io.IOException;
import java.lang.reflect.*;
import java.util.Arrays;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Map;

public class TestRecord extends TestCase {
Expand All @@ -25,7 +27,8 @@ public TestRecord0() {
}
}

public void test_print_record_reflection_info() {
// remove "disabled" to run the function
public void disabled_test_print_record_reflection_info() {

Class<TestRecord1> clazz = TestRecord1.class;

Expand Down Expand Up @@ -189,6 +192,7 @@ public void test_record_2_constructors_withOnlyFieldDecoder() throws IOException
record TestRecord6(long val) {

public TestRecord6(int valInt) {

this(Long.valueOf(valInt));
}
}
Expand All @@ -207,6 +211,7 @@ record TestRecord6(long val) {

@JsonCreator
public TestRecord6(@JsonProperty("valInt") int valInt) {

this(Long.valueOf(valInt));
}
}
Expand Down