The following issues were found
src/test/java/com/alibaba/json/bvt/bug/Bug_for_primitive_byte.java
6 issues
Line: 9
public class Bug_for_primitive_byte extends TestCase {
public void test_emptyStr() throws Exception {
JSON.parseObject("{\"value\":\"\"}", VO.class);
}
public void test_null() throws Exception {
JSON.parseObject("{\"value\":null}", VO.class);
Reported by PMD.
Line: 9
public class Bug_for_primitive_byte extends TestCase {
public void test_emptyStr() throws Exception {
JSON.parseObject("{\"value\":\"\"}", VO.class);
}
public void test_null() throws Exception {
JSON.parseObject("{\"value\":null}", VO.class);
Reported by PMD.
Line: 13
JSON.parseObject("{\"value\":\"\"}", VO.class);
}
public void test_null() throws Exception {
JSON.parseObject("{\"value\":null}", VO.class);
}
public void test_strNull() throws Exception {
JSON.parseObject("{\"value\":\"null\"}", VO.class);
Reported by PMD.
Line: 13
JSON.parseObject("{\"value\":\"\"}", VO.class);
}
public void test_null() throws Exception {
JSON.parseObject("{\"value\":null}", VO.class);
}
public void test_strNull() throws Exception {
JSON.parseObject("{\"value\":\"null\"}", VO.class);
Reported by PMD.
Line: 17
JSON.parseObject("{\"value\":null}", VO.class);
}
public void test_strNull() throws Exception {
JSON.parseObject("{\"value\":\"null\"}", VO.class);
}
public static class VO {
Reported by PMD.
Line: 17
JSON.parseObject("{\"value\":null}", VO.class);
}
public void test_strNull() throws Exception {
JSON.parseObject("{\"value\":\"null\"}", VO.class);
}
public static class VO {
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_for_primitive_double.java
6 issues
Line: 9
public class Bug_for_primitive_double extends TestCase {
public void test_emptyStr() throws Exception {
JSON.parseObject("{\"value\":\"\"}", VO.class);
}
public void test_null() throws Exception {
JSON.parseObject("{\"value\":null}", VO.class);
Reported by PMD.
Line: 9
public class Bug_for_primitive_double extends TestCase {
public void test_emptyStr() throws Exception {
JSON.parseObject("{\"value\":\"\"}", VO.class);
}
public void test_null() throws Exception {
JSON.parseObject("{\"value\":null}", VO.class);
Reported by PMD.
Line: 13
JSON.parseObject("{\"value\":\"\"}", VO.class);
}
public void test_null() throws Exception {
JSON.parseObject("{\"value\":null}", VO.class);
}
public void test_strNull() throws Exception {
JSON.parseObject("{\"value\":\"null\"}", VO.class);
Reported by PMD.
Line: 13
JSON.parseObject("{\"value\":\"\"}", VO.class);
}
public void test_null() throws Exception {
JSON.parseObject("{\"value\":null}", VO.class);
}
public void test_strNull() throws Exception {
JSON.parseObject("{\"value\":\"null\"}", VO.class);
Reported by PMD.
Line: 17
JSON.parseObject("{\"value\":null}", VO.class);
}
public void test_strNull() throws Exception {
JSON.parseObject("{\"value\":\"null\"}", VO.class);
}
public static class VO {
Reported by PMD.
Line: 17
JSON.parseObject("{\"value\":null}", VO.class);
}
public void test_strNull() throws Exception {
JSON.parseObject("{\"value\":\"null\"}", VO.class);
}
public static class VO {
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_for_primitive_float.java
6 issues
Line: 9
public class Bug_for_primitive_float extends TestCase {
public void test_emptyStr() throws Exception {
JSON.parseObject("{\"value\":\"\"}", VO.class);
}
public void test_null() throws Exception {
JSON.parseObject("{\"value\":null}", VO.class);
Reported by PMD.
Line: 9
public class Bug_for_primitive_float extends TestCase {
public void test_emptyStr() throws Exception {
JSON.parseObject("{\"value\":\"\"}", VO.class);
}
public void test_null() throws Exception {
JSON.parseObject("{\"value\":null}", VO.class);
Reported by PMD.
Line: 13
JSON.parseObject("{\"value\":\"\"}", VO.class);
}
public void test_null() throws Exception {
JSON.parseObject("{\"value\":null}", VO.class);
}
public void test_strNull() throws Exception {
JSON.parseObject("{\"value\":\"null\"}", VO.class);
Reported by PMD.
Line: 13
JSON.parseObject("{\"value\":\"\"}", VO.class);
}
public void test_null() throws Exception {
JSON.parseObject("{\"value\":null}", VO.class);
}
public void test_strNull() throws Exception {
JSON.parseObject("{\"value\":\"null\"}", VO.class);
Reported by PMD.
Line: 17
JSON.parseObject("{\"value\":null}", VO.class);
}
public void test_strNull() throws Exception {
JSON.parseObject("{\"value\":\"null\"}", VO.class);
}
public static class VO {
Reported by PMD.
Line: 17
JSON.parseObject("{\"value\":null}", VO.class);
}
public void test_strNull() throws Exception {
JSON.parseObject("{\"value\":\"null\"}", VO.class);
}
public static class VO {
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_for_primitive_int.java
6 issues
Line: 9
public class Bug_for_primitive_int extends TestCase {
public void test_emptyStr() throws Exception {
JSON.parseObject("{\"value\":\"\"}", VO.class);
}
public void test_null() throws Exception {
JSON.parseObject("{\"value\":null}", VO.class);
Reported by PMD.
Line: 9
public class Bug_for_primitive_int extends TestCase {
public void test_emptyStr() throws Exception {
JSON.parseObject("{\"value\":\"\"}", VO.class);
}
public void test_null() throws Exception {
JSON.parseObject("{\"value\":null}", VO.class);
Reported by PMD.
Line: 13
JSON.parseObject("{\"value\":\"\"}", VO.class);
}
public void test_null() throws Exception {
JSON.parseObject("{\"value\":null}", VO.class);
}
public void test_strNull() throws Exception {
JSON.parseObject("{\"value\":\"null\"}", VO.class);
Reported by PMD.
Line: 13
JSON.parseObject("{\"value\":\"\"}", VO.class);
}
public void test_null() throws Exception {
JSON.parseObject("{\"value\":null}", VO.class);
}
public void test_strNull() throws Exception {
JSON.parseObject("{\"value\":\"null\"}", VO.class);
Reported by PMD.
Line: 17
JSON.parseObject("{\"value\":null}", VO.class);
}
public void test_strNull() throws Exception {
JSON.parseObject("{\"value\":\"null\"}", VO.class);
}
public static class VO {
Reported by PMD.
Line: 17
JSON.parseObject("{\"value\":null}", VO.class);
}
public void test_strNull() throws Exception {
JSON.parseObject("{\"value\":\"null\"}", VO.class);
}
public static class VO {
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_for_primitive_long.java
6 issues
Line: 9
public class Bug_for_primitive_long extends TestCase {
public void test_emptyStr() throws Exception {
JSON.parseObject("{\"value\":\"\"}", VO.class);
}
public void test_null() throws Exception {
JSON.parseObject("{\"value\":null}", VO.class);
Reported by PMD.
Line: 9
public class Bug_for_primitive_long extends TestCase {
public void test_emptyStr() throws Exception {
JSON.parseObject("{\"value\":\"\"}", VO.class);
}
public void test_null() throws Exception {
JSON.parseObject("{\"value\":null}", VO.class);
Reported by PMD.
Line: 13
JSON.parseObject("{\"value\":\"\"}", VO.class);
}
public void test_null() throws Exception {
JSON.parseObject("{\"value\":null}", VO.class);
}
public void test_strNull() throws Exception {
JSON.parseObject("{\"value\":\"null\"}", VO.class);
Reported by PMD.
Line: 13
JSON.parseObject("{\"value\":\"\"}", VO.class);
}
public void test_null() throws Exception {
JSON.parseObject("{\"value\":null}", VO.class);
}
public void test_strNull() throws Exception {
JSON.parseObject("{\"value\":\"null\"}", VO.class);
Reported by PMD.
Line: 17
JSON.parseObject("{\"value\":null}", VO.class);
}
public void test_strNull() throws Exception {
JSON.parseObject("{\"value\":\"null\"}", VO.class);
}
public static class VO {
Reported by PMD.
Line: 17
JSON.parseObject("{\"value\":null}", VO.class);
}
public void test_strNull() throws Exception {
JSON.parseObject("{\"value\":\"null\"}", VO.class);
}
public static class VO {
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_for_smoothrat8.java
6 issues
Line: 24
entity.setValue(map);
String text = JSON.toJSONString(entity, SerializerFeature.WriteClassName);
System.out.println(text);
Assert.assertEquals("{\"@type\":\"com.alibaba.json.bvt.bug.Bug_for_smoothrat8$Entity\",\"value\":{\"@type\":\"java.util.LinkedHashMap\",1:\"a\",2:\"b\"}}",
text);
Entity entity2 = JSON.parseObject(text, Entity.class);
Assert.assertEquals(map, entity2.getValue());
Reported by PMD.
Line: 14
public class Bug_for_smoothrat8 extends TestCase {
public void test_set() throws Exception {
Map<Integer, Object> map = new LinkedHashMap<Integer, Object>();
map.put(1, "a");
map.put(2, "b");
Entity entity = new Entity();
Reported by PMD.
Line: 29
text);
Entity entity2 = JSON.parseObject(text, Entity.class);
Assert.assertEquals(map, entity2.getValue());
Assert.assertEquals(map.getClass(), entity2.getValue().getClass());
Assert.assertEquals(Integer.class, ((Map)entity2.getValue()).keySet().iterator().next().getClass());
}
Reported by PMD.
Line: 30
Entity entity2 = JSON.parseObject(text, Entity.class);
Assert.assertEquals(map, entity2.getValue());
Assert.assertEquals(map.getClass(), entity2.getValue().getClass());
Assert.assertEquals(Integer.class, ((Map)entity2.getValue()).keySet().iterator().next().getClass());
}
public static class Entity {
Reported by PMD.
Line: 30
Entity entity2 = JSON.parseObject(text, Entity.class);
Assert.assertEquals(map, entity2.getValue());
Assert.assertEquals(map.getClass(), entity2.getValue().getClass());
Assert.assertEquals(Integer.class, ((Map)entity2.getValue()).keySet().iterator().next().getClass());
}
public static class Entity {
Reported by PMD.
Line: 31
Entity entity2 = JSON.parseObject(text, Entity.class);
Assert.assertEquals(map, entity2.getValue());
Assert.assertEquals(map.getClass(), entity2.getValue().getClass());
Assert.assertEquals(Integer.class, ((Map)entity2.getValue()).keySet().iterator().next().getClass());
}
public static class Entity {
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_for_xujin.java
6 issues
Line: 14
public class Bug_for_xujin extends TestCase {
public void test_for_xujin() throws Exception {
String jsonText="{\"module\":{\"auditStatus\":\"PENDING_VERIFICATION\",\"contactId\":\"asdfasdf\",\n\"errorMsg\":\"中国\"},\"success\":true}\n";
System.out.println(JSON.VERSION);
ResultDTO resultDTO = (ResultDTO) JSON.parseObject(jsonText, ResultDTO.class);
}
public static class ResultDTO<T extends Serializable> implements Serializable {
private static final long serialVersionUID = 3682481175041925854L;
Reported by PMD.
Line: 12
* Created by wenshao on 09/02/2017.
*/
public class Bug_for_xujin extends TestCase {
public void test_for_xujin() throws Exception {
String jsonText="{\"module\":{\"auditStatus\":\"PENDING_VERIFICATION\",\"contactId\":\"asdfasdf\",\n\"errorMsg\":\"中国\"},\"success\":true}\n";
System.out.println(JSON.VERSION);
ResultDTO resultDTO = (ResultDTO) JSON.parseObject(jsonText, ResultDTO.class);
}
Reported by PMD.
Line: 12
* Created by wenshao on 09/02/2017.
*/
public class Bug_for_xujin extends TestCase {
public void test_for_xujin() throws Exception {
String jsonText="{\"module\":{\"auditStatus\":\"PENDING_VERIFICATION\",\"contactId\":\"asdfasdf\",\n\"errorMsg\":\"中国\"},\"success\":true}\n";
System.out.println(JSON.VERSION);
ResultDTO resultDTO = (ResultDTO) JSON.parseObject(jsonText, ResultDTO.class);
}
Reported by PMD.
Line: 15
public void test_for_xujin() throws Exception {
String jsonText="{\"module\":{\"auditStatus\":\"PENDING_VERIFICATION\",\"contactId\":\"asdfasdf\",\n\"errorMsg\":\"中国\"},\"success\":true}\n";
System.out.println(JSON.VERSION);
ResultDTO resultDTO = (ResultDTO) JSON.parseObject(jsonText, ResultDTO.class);
}
public static class ResultDTO<T extends Serializable> implements Serializable {
private static final long serialVersionUID = 3682481175041925854L;
private static final String DEFAULT_ERR_CODE = "xin.unknown.error";
Reported by PMD.
Line: 20
public static class ResultDTO<T extends Serializable> implements Serializable {
private static final long serialVersionUID = 3682481175041925854L;
private static final String DEFAULT_ERR_CODE = "xin.unknown.error";
private String errorMsg;
private String errorCode;
private boolean success;
private T module;
Reported by PMD.
Line: 15
public void test_for_xujin() throws Exception {
String jsonText="{\"module\":{\"auditStatus\":\"PENDING_VERIFICATION\",\"contactId\":\"asdfasdf\",\n\"errorMsg\":\"中国\"},\"success\":true}\n";
System.out.println(JSON.VERSION);
ResultDTO resultDTO = (ResultDTO) JSON.parseObject(jsonText, ResultDTO.class);
}
public static class ResultDTO<T extends Serializable> implements Serializable {
private static final long serialVersionUID = 3682481175041925854L;
private static final String DEFAULT_ERR_CODE = "xin.unknown.error";
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_for_xujin2.java
6 issues
Line: 17
* Created by wenshao on 10/02/2017.
*/
public class Bug_for_xujin2 extends TestCase {
public void test_for_bug() throws Exception {
ContactTemplateParam param = new ContactTemplateParam();
param.setAuditStatus(AuditStatusType.AUDIT_FAILURE);
String json = JSON.toJSONString(param, new SerializeFilter[] { new IntEnumFilter("auditStatus") });
assertEquals("{\"auditStatus\":0}", json);
Reported by PMD.
Line: 22
param.setAuditStatus(AuditStatusType.AUDIT_FAILURE);
String json = JSON.toJSONString(param, new SerializeFilter[] { new IntEnumFilter("auditStatus") });
assertEquals("{\"auditStatus\":0}", json);
}
public static class IntEnumFilter implements ValueFilter {
private Set<String> needMaskFileds = new HashSet();
Reported by PMD.
Line: 26
}
public static class IntEnumFilter implements ValueFilter {
private Set<String> needMaskFileds = new HashSet();
public IntEnumFilter() {
}
public IntEnumFilter(String... fileds) {
Reported by PMD.
Line: 26
}
public static class IntEnumFilter implements ValueFilter {
private Set<String> needMaskFileds = new HashSet();
public IntEnumFilter() {
}
public IntEnumFilter(String... fileds) {
Reported by PMD.
Line: 104
for(int i$ = 0; i$ < len$; ++i$) {
AuditStatusType temp = arr$[i$];
if(temp.getEnCode().equals(enCode)) {
return temp;
}
}
return null;
Reported by PMD.
Line: 104
for(int i$ = 0; i$ < len$; ++i$) {
AuditStatusType temp = arr$[i$];
if(temp.getEnCode().equals(enCode)) {
return temp;
}
}
return null;
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_for_yangqi.java
6 issues
Line: 12
public class Bug_for_yangqi extends TestCase {
public void test_for_bug() throws Exception {
B b = JSON.parseObject("{\"id\":123,\"values\":[{}]}", B.class);
}
abstract static class A {
Reported by PMD.
Line: 12
public class Bug_for_yangqi extends TestCase {
public void test_for_bug() throws Exception {
B b = JSON.parseObject("{\"id\":123,\"values\":[{}]}", B.class);
}
abstract static class A {
Reported by PMD.
Line: 13
public class Bug_for_yangqi extends TestCase {
public void test_for_bug() throws Exception {
B b = JSON.parseObject("{\"id\":123,\"values\":[{}]}", B.class);
}
abstract static class A {
private int id;
Reported by PMD.
Line: 16
B b = JSON.parseObject("{\"id\":123,\"values\":[{}]}", B.class);
}
abstract static class A {
private int id;
private List<Value> values = new ArrayList<Value>();
public int getId() {
Reported by PMD.
Line: 16
B b = JSON.parseObject("{\"id\":123,\"values\":[{}]}", B.class);
}
abstract static class A {
private int id;
private List<Value> values = new ArrayList<Value>();
public int getId() {
Reported by PMD.
Line: 13
public class Bug_for_yangqi extends TestCase {
public void test_for_bug() throws Exception {
B b = JSON.parseObject("{\"id\":123,\"values\":[{}]}", B.class);
}
abstract static class A {
private int id;
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_for_yanpei4.java
6 issues
Line: 12
public class Bug_for_yanpei4 extends TestCase {
public void test_for_issue() throws Exception {
String valueText = JSON.toJSONString("a\"Puck\"");
System.out.println("valueText : " + valueText);
RPCAckBody body1 = new RPCAckBody();
body1.actionValue = valueText;
String bodyString = JSON.toJSONString(body1);
Reported by PMD.
Line: 18
body1.actionValue = valueText;
String bodyString = JSON.toJSONString(body1);
System.out.println(bodyString);
RPCAckBody body2 = JSON.parseObject(bodyString, RPCAckBody.class);
System.out.println(body1.actionValue);
System.out.println(body2.actionValue);
Reported by PMD.
Line: 22
RPCAckBody body2 = JSON.parseObject(bodyString, RPCAckBody.class);
System.out.println(body1.actionValue);
System.out.println(body2.actionValue);
Assert.assertEquals(body1.actionValue, body2.actionValue);
}
public static class RPCAckBody {
Reported by PMD.
Line: 23
RPCAckBody body2 = JSON.parseObject(bodyString, RPCAckBody.class);
System.out.println(body1.actionValue);
System.out.println(body2.actionValue);
Assert.assertEquals(body1.actionValue, body2.actionValue);
}
public static class RPCAckBody {
public String actionValue;
Reported by PMD.
Line: 10
import junit.framework.TestCase;
public class Bug_for_yanpei4 extends TestCase {
public void test_for_issue() throws Exception {
String valueText = JSON.toJSONString("a\"Puck\"");
System.out.println("valueText : " + valueText);
RPCAckBody body1 = new RPCAckBody();
body1.actionValue = valueText;
Reported by PMD.
Line: 28
}
public static class RPCAckBody {
public String actionValue;
}
}
Reported by PMD.