The following issues were found
src/test/java/com/alibaba/json/bvt/GetSetNotMatchTest.java
2 issues
Line: 11
public class GetSetNotMatchTest extends TestCase {
public void test_0() throws Exception {
VO vo = new VO();
vo.setValue(1);
String text = JSON.toJSONString(vo);
Assert.assertEquals("{\"value\":true}", text);
Reported by PMD.
Line: 19
Assert.assertEquals("{\"value\":true}", text);
VO vo1 = JSON.parseObject(text, VO.class);
Assert.assertEquals(vo.getValue(), vo1.getValue());
}
public static class VO {
private int value;
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Issue127.java
2 issues
Line: 9
public class Issue127 extends TestCase {
public void test_for_issue_127() throws Exception {
String text = "{_BillId:\"X20140106S0110\",_Status:1,_PayStatus:0,_RunEmpId:undefined}";
JSON.parseObject(text);
}
}
Reported by PMD.
Line: 9
public class Issue127 extends TestCase {
public void test_for_issue_127() throws Exception {
String text = "{_BillId:\"X20140106S0110\",_Status:1,_PayStatus:0,_RunEmpId:undefined}";
JSON.parseObject(text);
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/JavaBeanMappingTest.java
2 issues
Line: 10
@SuppressWarnings("deprecation")
public class JavaBeanMappingTest extends TestCase {
public void test_0 () throws Exception {
ParserConfig.getGlobalInstance();
}
}
Reported by PMD.
Line: 10
@SuppressWarnings("deprecation")
public class JavaBeanMappingTest extends TestCase {
public void test_0 () throws Exception {
ParserConfig.getGlobalInstance();
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Issue141.java
2 issues
Line: 11
public class Issue141 extends TestCase {
public void test_for_issue() throws Exception {
Assert.assertFalse(TypeUtils.castToBoolean("0").booleanValue());
}
}
Reported by PMD.
Line: 12
public class Issue141 extends TestCase {
public void test_for_issue() throws Exception {
Assert.assertFalse(TypeUtils.castToBoolean("0").booleanValue());
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Issue143.java
2 issues
Line: 15
public class Issue143 extends TestCase {
public void test_for_issue() throws Exception {
String text = "{\"rec\":[{},{}]}";
JsonStroe store = new JsonStroe();
JSONReader reader = new JSONReader(new StringReader(text));
Reported by PMD.
Line: 55
}
}
public static class KeyValue {
private String key;
private String value;
public String getKey() {
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Issue153.java
2 issues
Line: 12
public class Issue153 extends TestCase {
public void test_for_issue() throws Exception {
String text = "[{\"url_short\":\"http://t.cn/8soWK4z\",\"url_long\":\"http://wenshao.com\",\"type\":0}]";
JSON.parseObject(text, new TypeReference<HashMap<String, Object>[]>(){});
}
}
Reported by PMD.
Line: 12
public class Issue153 extends TestCase {
public void test_for_issue() throws Exception {
String text = "[{\"url_short\":\"http://t.cn/8soWK4z\",\"url_long\":\"http://wenshao.com\",\"type\":0}]";
JSON.parseObject(text, new TypeReference<HashMap<String, Object>[]>(){});
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/PublicFieldLongTest.java
2 issues
Line: 12
public static class VO {
public long id;
}
public void test_codec() throws Exception {
VO vo = new VO();
vo.id = 1234;
Reported by PMD.
Line: 15
public long id;
}
public void test_codec() throws Exception {
VO vo = new VO();
vo.id = 1234;
String str = JSON.toJSONString(vo);
Reported by PMD.
src/test/java/com/alibaba/fastjson/deserializer/issues3796/bean/ObjectY_A.java
2 issues
Line: 8
public class ObjectY_A {
private int a = 0;
Reported by PMD.
Line: 11
public class ObjectY_A {
private int a = 0;
private int b;
Reported by PMD.
src/test/java/com/alibaba/json/bvt/FinalTest.java
2 issues
Line: 10
import junit.framework.TestCase;
public class FinalTest extends TestCase {
public void test_final() throws Exception {
VO vo = new VO();
String text = JSON.toJSONString(vo);
Assert.assertEquals("{\"value\":1001}", text);
JSON.parseObject(text, VO.class);
JSON.parseObject("{\"id\":1001,\"value\":1001}", VO.class);
Reported by PMD.
Line: 21
public static class VO {
public final static int id = 1001;
public final int value = 1001;
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/IntKeyMapTest.java
2 issues
Line: 9
public class IntKeyMapTest extends TestCase {
public void test_0() throws Exception {
JSON.parse("{1:\"AA\",2:{}}");
}
}
Reported by PMD.
Line: 9
public class IntKeyMapTest extends TestCase {
public void test_0() throws Exception {
JSON.parse("{1:\"AA\",2:{}}");
}
}
Reported by PMD.