The following issues were found
src/test/java/com/alibaba/fastjson/deserializer/issues3796/bean/ObjectJ1_A.java
6 issues
Line: 9
import java.util.List;
public class ObjectJ1_A {
private int a = 0;
private int b = 0;
Reported by PMD.
Line: 11
public class ObjectJ1_A {
private int a = 0;
private int b = 0;
private int c = 0;
Reported by PMD.
Line: 13
private int a = 0;
private int b = 0;
private int c = 0;
private int d = 0;
Reported by PMD.
Line: 15
private int b = 0;
private int c = 0;
private int d = 0;
private int e = 0;
Reported by PMD.
Line: 17
private int c = 0;
private int d = 0;
private int e = 0;
private List<CommonObject> f;
Reported by PMD.
Line: 19
private int d = 0;
private int e = 0;
private List<CommonObject> f;
private List<ObjectJ1_C> g;
Reported by PMD.
src/test/java/com/alibaba/fastjson/deserializer/issues3796/bean/ObjectJ1_C.java
6 issues
Line: 8
public class ObjectJ1_C {
private int a = 0;
private int b = 0;
Reported by PMD.
Line: 10
public class ObjectJ1_C {
private int a = 0;
private int b = 0;
private int c = 0;
Reported by PMD.
Line: 12
private int a = 0;
private int b = 0;
private int c = 0;
private int d = 0;
Reported by PMD.
Line: 14
private int b = 0;
private int c = 0;
private int d = 0;
private boolean e = false;
Reported by PMD.
Line: 16
private int c = 0;
private int d = 0;
private boolean e = false;
public int getA() {
return a;
Reported by PMD.
Line: 18
private int d = 0;
private boolean e = false;
public int getA() {
return a;
}
Reported by PMD.
src/test/java/com/alibaba/fastjson/deserializer/issues3796/bean/ObjectT.java
6 issues
Line: 9
import java.util.List;
public class ObjectT {
private int a = 0;
private int b = 0;
Reported by PMD.
Line: 11
public class ObjectT {
private int a = 0;
private int b = 0;
private int c = 0;
Reported by PMD.
Line: 14
private int a = 0;
private int b = 0;
private int c = 0;
private List<ObjectT_A> d;
Reported by PMD.
Line: 16
private int b = 0;
private int c = 0;
private List<ObjectT_A> d;
Reported by PMD.
Line: 22
private List<ObjectT_A> d;
private int e = 0;
private int f;
Reported by PMD.
Line: 40
private int j;
private boolean k = false;
public int getA() {
return a;
}
Reported by PMD.
src/test/java/com/alibaba/fastjson/deserializer/issues3796/bean/ObjectY.java
6 issues
Line: 10
import java.util.List;
public class ObjectY {
private List<ObjectY_A> a;
private long b;
Reported by PMD.
Line: 18
private long b;
private int c = 0;
private boolean d = false;
Reported by PMD.
Line: 21
private int c = 0;
private boolean d = false;
private int e = -1;
Reported by PMD.
Line: 27
private int e = -1;
private int f = 0;
private int g = 0;
Reported by PMD.
Line: 30
private int f = 0;
private int g = 0;
private int h;
Reported by PMD.
Line: 37
private int h;
private boolean i =false;
private List<Integer> j;
private List<Integer> k;
Reported by PMD.
src/test/java/com/alibaba/fastjson/serializer/issue3084/TestRefWithQuote.java
6 issues
Line: 15
public class TestRefWithQuote {
public static class X {
private String x;
public X(String x) {
this.x = x;
}
Reported by PMD.
Line: 40
try {
String json = JSON.toJSONString(origin, true);
JSONObject root = JSON.parseObject(json);
assertSame(root.get("bbbb\\"), root.get("aaaa\\"));
} catch (Exception e) {
fail("should not fail !!!");
}
}
}
Reported by PMD.
Line: 40
try {
String json = JSON.toJSONString(origin, true);
JSONObject root = JSON.parseObject(json);
assertSame(root.get("bbbb\\"), root.get("aaaa\\"));
} catch (Exception e) {
fail("should not fail !!!");
}
}
}
Reported by PMD.
Line: 40
try {
String json = JSON.toJSONString(origin, true);
JSONObject root = JSON.parseObject(json);
assertSame(root.get("bbbb\\"), root.get("aaaa\\"));
} catch (Exception e) {
fail("should not fail !!!");
}
}
}
Reported by PMD.
Line: 41
String json = JSON.toJSONString(origin, true);
JSONObject root = JSON.parseObject(json);
assertSame(root.get("bbbb\\"), root.get("aaaa\\"));
} catch (Exception e) {
fail("should not fail !!!");
}
}
}
Reported by PMD.
Line: 10
import java.util.HashMap;
import java.util.Map;
import static org.junit.Assert.*;
public class TestRefWithQuote {
public static class X {
private String x;
Reported by PMD.
src/test/java/com/alibaba/json/bvt/ArrayListFieldTest_1.java
6 issues
Line: 14
public class ArrayListFieldTest_1 extends TestCase {
public void test_var() throws Exception {
JSON.parseObject("{\"value\":[{}]}", V0.class);
V0<A> v1 = JSON.parseObject("{\"value\":[{}]}", new TypeReference<V0<A>>() {
});
Assert.assertTrue(v1.getValue().get(0) instanceof A);
Reported by PMD.
Line: 18
JSON.parseObject("{\"value\":[{}]}", V0.class);
V0<A> v1 = JSON.parseObject("{\"value\":[{}]}", new TypeReference<V0<A>>() {
});
Assert.assertTrue(v1.getValue().get(0) instanceof A);
V0<B> v2 = JSON.parseObject("{\"value\":[{}]}", new TypeReference<V0<B>>() {
});
Assert.assertTrue(v2.getValue().get(0) instanceof B);
}
Reported by PMD.
Line: 22
V0<B> v2 = JSON.parseObject("{\"value\":[{}]}", new TypeReference<V0<B>>() {
});
Assert.assertTrue(v2.getValue().get(0) instanceof B);
}
private static class V<T> {
}
Reported by PMD.
Line: 31
private static class V0<T> extends V<T> {
private ArrayList<T> value;
public ArrayList<T> getValue() {
return value;
}
Reported by PMD.
Line: 33
private ArrayList<T> value;
public ArrayList<T> getValue() {
return value;
}
public void setValue(ArrayList<T> value) {
this.value = value;
Reported by PMD.
Line: 37
return value;
}
public void setValue(ArrayList<T> value) {
this.value = value;
}
}
public static class A {
Reported by PMD.
src/test/java/com/alibaba/json/bvt/ArrayListFloatFieldTest.java
6 issues
Line: 19
user.getValue().add(1F);
String text = JSON.toJSONString(user);
System.out.println(text);
User user1 = JSON.parseObject(text, User.class);
Assert.assertEquals(user.getValue(), user1.getValue());
}
Reported by PMD.
Line: 13
public class ArrayListFloatFieldTest extends TestCase {
public void test_codec() throws Exception {
User user = new User();
user.setValue(new ArrayList<Float>());
user.getValue().add(1F);
String text = JSON.toJSONString(user);
Reported by PMD.
Line: 16
public void test_codec() throws Exception {
User user = new User();
user.setValue(new ArrayList<Float>());
user.getValue().add(1F);
String text = JSON.toJSONString(user);
System.out.println(text);
User user1 = JSON.parseObject(text, User.class);
Reported by PMD.
Line: 23
User user1 = JSON.parseObject(text, User.class);
Assert.assertEquals(user.getValue(), user1.getValue());
}
public static class User {
private ArrayList<Float> value;
Reported by PMD.
Line: 28
public static class User {
private ArrayList<Float> value;
public User() {
}
Reported by PMD.
Line: 38
return value;
}
public void setValue(ArrayList<Float> value) {
this.value = value;
}
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/BooleanArrayFieldTest.java
6 issues
Line: 12
public class BooleanArrayFieldTest extends TestCase {
public void test_codec_null() throws Exception {
V0 v = new V0();
SerializeConfig mapping = new SerializeConfig();
mapping.setAsmEnable(false);
Reported by PMD.
Line: 23
V0 v1 = JSON.parseObject(text, V0.class);
Assert.assertEquals(v1.getValue(), v.getValue());
}
public void test_codec_null_1() throws Exception {
V0 v = new V0();
Reported by PMD.
Line: 26
Assert.assertEquals(v1.getValue(), v.getValue());
}
public void test_codec_null_1() throws Exception {
V0 v = new V0();
SerializeConfig mapping = new SerializeConfig();
mapping.setAsmEnable(false);
Reported by PMD.
Line: 41
private Boolean[] value;
public Boolean[] getValue() {
return value;
}
public void setValue(Boolean[] value) {
this.value = value;
}
Reported by PMD.
Line: 44
return value;
}
public void setValue(Boolean[] value) {
this.value = value;
}
}
}
Reported by PMD.
Line: 44
return value;
}
public void setValue(Boolean[] value) {
this.value = value;
}
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/ByteArrayFieldTest_1.java
6 issues
Line: 12
public class ByteArrayFieldTest_1 extends TestCase {
public void test_array() throws Exception {
Assert.assertEquals("\"AQ==\"", JSON.toJSONString(new byte[] { 1 }));
}
public void test_codec_null() throws Exception {
Reported by PMD.
Line: 17
}
public void test_codec_null() throws Exception {
V0 v = new V0();
SerializeConfig mapping = new SerializeConfig();
mapping.setAsmEnable(false);
Reported by PMD.
Line: 28
V0 v1 = JSON.parseObject(text, V0.class);
Assert.assertEquals(v1.getValue(), v.getValue());
}
public void test_codec_null_1() throws Exception {
V0 v = new V0();
Reported by PMD.
Line: 31
Assert.assertEquals(v1.getValue(), v.getValue());
}
public void test_codec_null_1() throws Exception {
V0 v = new V0();
SerializeConfig mapping = new SerializeConfig();
mapping.setAsmEnable(false);
Reported by PMD.
Line: 46
private byte[] value;
public byte[] getValue() {
return value;
}
public void setValue(byte[] value) {
this.value = value;
}
Reported by PMD.
Line: 49
return value;
}
public void setValue(byte[] value) {
this.value = value;
}
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/ByteArrayFieldTest_4.java
6 issues
Line: 14
public class ByteArrayFieldTest_4 extends TestCase {
public void test_0() throws Exception {
Model model = new Model();
model.value = "ABCDEG".getBytes();
String json = JSON.toJSONString(model);
Reported by PMD.
Line: 21
String json = JSON.toJSONString(model);
assertEquals("{\"value\":x'414243444547'}", json);
Model model1 = JSON.parseObject(json, Model.class);
Assert.assertArrayEquals(model.value, model1.value);
}
Reported by PMD.
Line: 31
private static class Model {
@JSONField(format = "hex")
public byte[] value;
}
}
Reported by PMD.
Line: 4
package com.alibaba.json.bvt;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.json.test.TestUtils;
import junit.framework.TestCase;
import org.junit.Assert;
Reported by PMD.
Line: 6
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.json.test.TestUtils;
import junit.framework.TestCase;
import org.junit.Assert;
import java.io.UnsupportedEncodingException;
Reported by PMD.
Line: 10
import junit.framework.TestCase;
import org.junit.Assert;
import java.io.UnsupportedEncodingException;
public class ByteArrayFieldTest_4 extends TestCase {
public void test_0() throws Exception {
Model model = new Model();
Reported by PMD.