The following issues were found
src/test/java/com/alibaba/json/bvt/parser/taobao/DoubleObjectFieldTest.java
2 issues
Line: 10
import junit.framework.TestCase;
public class DoubleObjectFieldTest extends TestCase {
public void test_0 () throws Exception {
VO vo = JSON.parseObject("{\"value\":1001}", VO.class);
Assert.assertTrue(1001D == vo.value);
}
public static class VO {
Reported by PMD.
Line: 16
}
public static class VO {
public Double value;
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/parser/taobao/FloatObjectFieldTest.java
2 issues
Line: 10
import junit.framework.TestCase;
public class FloatObjectFieldTest extends TestCase {
public void test_0 () throws Exception {
VO vo = JSON.parseObject("{\"value\":1001}", VO.class);
Assert.assertTrue(1001F == vo.value);
}
public static class VO {
Reported by PMD.
Line: 16
}
public static class VO {
public Float value;
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/parser/taobao/IntAsStringTest.java
2 issues
Line: 10
import junit.framework.TestCase;
public class IntAsStringTest extends TestCase {
public void test_0 () throws Exception {
VO vo = JSON.parseObject("{\"value\":\"1001\"}", VO.class);
Assert.assertEquals(1001, vo.value);
}
public static class VO {
Reported by PMD.
Line: 16
}
public static class VO {
public int value;
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/parser/taobao/LongAsStringTest.java
2 issues
Line: 10
import junit.framework.TestCase;
public class LongAsStringTest extends TestCase {
public void test_0 () throws Exception {
VO vo = JSON.parseObject("{\"value\":\"1001\"}", VO.class);
Assert.assertEquals(1001L, vo.value);
}
public static class VO {
Reported by PMD.
Line: 16
}
public static class VO {
public long value;
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/parser/deser/generic/GenericArrayTest5.java
2 issues
Line: 11
public class GenericArrayTest5 extends TestCase {
public void test_generic() throws Exception {
VO vo = new VO();
vo.values = new Number[] {1, 1};
String text = JSON.toJSONString(vo);
VO vo1 = JSON.parseObject(text, VO.class);
Reported by PMD.
Line: 24
}
public static class A<T extends Number> {
public T[] values;
}
public static class VO<T extends Number> extends A<T> {
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/parser/deser/generic/GenericArrayTest2.java
2 issues
Line: 11
public class GenericArrayTest2 extends TestCase {
public void test_generic() throws Exception {
VO vo = new VO();
vo.values = new String[] {"a", "b"};
String text = JSON.toJSONString(vo);
VO vo1 = JSON.parseObject(text, VO.class);
Reported by PMD.
Line: 24
}
public static class A<T> {
public T[] values;
}
public static class VO extends A {
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/parser/deser/generic/GenericArrayTest.java
2 issues
Line: 11
public class GenericArrayTest extends TestCase {
public void test_generic() throws Exception {
VO vo = new VO();
vo.values = new Number[] {1, 1};
String text = JSON.toJSONString(vo);
VO vo1 = JSON.parseObject(text, VO.class);
Reported by PMD.
Line: 24
}
public static class A<T extends Number> {
public T[] values;
}
public static class VO extends A {
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/parser/deser/extra/ExtraTest.java
2 issues
Line: 10
* Created by wenshao on 30/03/2017.
*/
public class ExtraTest extends TestCase {
public void test_0() throws Exception {
JSON.parseObject("{\"ID\":123}", Model.class);
}
public static class Model {
public int id;
Reported by PMD.
Line: 10
* Created by wenshao on 30/03/2017.
*/
public class ExtraTest extends TestCase {
public void test_0() throws Exception {
JSON.parseObject("{\"ID\":123}", Model.class);
}
public static class Model {
public int id;
Reported by PMD.
src/test/java/com/alibaba/json/bvt/path/JSONPath_field_access.java
2 issues
Line: 11
public class JSONPath_field_access extends TestCase {
public void test_list_map() throws Exception {
Entity entity = new Entity(123, "wenshao");
JSONPath path = new JSONPath("$['id']");
Assert.assertSame(entity.getId(), path.eval(entity));
}
Reported by PMD.
Line: 18
Assert.assertSame(entity.getId(), path.eval(entity));
}
public static class Entity {
private Integer id;
private String name;
public Entity(Integer id, String name){
Reported by PMD.
src/test/java/com/alibaba/json/bvt/parser/creator/JSONCreatorTest_error2.java
2 issues
Line: 14
public class JSONCreatorTest_error2 extends TestCase {
public void test_create() throws Exception {
Exception error = null;
try {
JSON.parseObject("{\"id\":123,\"name\":\"abc\"}", Entity.class);
} catch (JSONException ex) {
error = ex;
Reported by PMD.
Line: 15
public class JSONCreatorTest_error2 extends TestCase {
public void test_create() throws Exception {
Exception error = null;
try {
JSON.parseObject("{\"id\":123,\"name\":\"abc\"}", Entity.class);
} catch (JSONException ex) {
error = ex;
}
Reported by PMD.