The following issues were found
src/test/java/com/alibaba/fastjson/deserializer/issues3796/bean/ObjectB.java
5 issues
Line: 3
package com.alibaba.fastjson.deserializer.issues3796.bean;
public class ObjectB {
private long a;
private long b;
private long c;
Reported by PMD.
Line: 3
package com.alibaba.fastjson.deserializer.issues3796.bean;
public class ObjectB {
private long a;
private long b;
private long c;
Reported by PMD.
Line: 29
private long j;
private long k = 0;
private long l = 0;
private long m = 0;
Reported by PMD.
Line: 32
private long k = 0;
private long l = 0;
private long m = 0;
private long n;
Reported by PMD.
Line: 34
private long l = 0;
private long m = 0;
private long n;
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_for_maiksagill.java
5 issues
Line: 14
public class Bug_for_maiksagill extends TestCase {
public void test_for_maiksagill() throws Exception {
String resource = "json/maiksagill.json";
InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
String text = IOUtils.toString(is);
JSON.parseObject(text, WareHouseInfo[].class);
Reported by PMD.
Line: 14
public class Bug_for_maiksagill extends TestCase {
public void test_for_maiksagill() throws Exception {
String resource = "json/maiksagill.json";
InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
String text = IOUtils.toString(is);
JSON.parseObject(text, WareHouseInfo[].class);
Reported by PMD.
Line: 16
public void test_for_maiksagill() throws Exception {
String resource = "json/maiksagill.json";
InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
String text = IOUtils.toString(is);
JSON.parseObject(text, WareHouseInfo[].class);
}
Reported by PMD.
Line: 16
public void test_for_maiksagill() throws Exception {
String resource = "json/maiksagill.json";
InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
String text = IOUtils.toString(is);
JSON.parseObject(text, WareHouseInfo[].class);
}
Reported by PMD.
Line: 16
public void test_for_maiksagill() throws Exception {
String resource = "json/maiksagill.json";
InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
String text = IOUtils.toString(is);
JSON.parseObject(text, WareHouseInfo[].class);
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_for_leupom_2.java
5 issues
Line: 19
String text = JSON.toJSONString(time);
System.out.println(text);
Time time2 = JSON.parseObject(text, Time.class);
Assert.assertEquals(time2.getValue(), time.getValue());
Assert.assertEquals(time2.getUnit(), time.getUnit());
Reported by PMD.
Line: 14
public class Bug_for_leupom_2 extends TestCase {
public void test_0() throws Exception {
Time time = new Time(1000, TimeUnit.MILLISECONDS);
String text = JSON.toJSONString(time);
System.out.println(text);
Reported by PMD.
Line: 23
Time time2 = JSON.parseObject(text, Time.class);
Assert.assertEquals(time2.getValue(), time.getValue());
Assert.assertEquals(time2.getUnit(), time.getUnit());
}
public static class Time {
Reported by PMD.
Line: 24
Time time2 = JSON.parseObject(text, Time.class);
Assert.assertEquals(time2.getValue(), time.getValue());
Assert.assertEquals(time2.getUnit(), time.getUnit());
}
public static class Time {
private long value;
Reported by PMD.
Line: 27
Assert.assertEquals(time2.getUnit(), time.getUnit());
}
public static class Time {
private long value;
private TimeUnit unit;
public Time(){
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug1.java
5 issues
Line: 14
public void testToEntry2() {
InnerEntry inner1 = null;// 出错
String source1 = JSONObject.toJSONString(inner1);
System.out.println(source1);
OuterEntry inner2 = JSONObject.parseObject(source1, OuterEntry.class);// 出错
}
}
Reported by PMD.
Line: 11
public class Bug1 extends TestCase {
public void testToEntry2() {
InnerEntry inner1 = null;// 出错
String source1 = JSONObject.toJSONString(inner1);
System.out.println(source1);
OuterEntry inner2 = JSONObject.parseObject(source1, OuterEntry.class);// 出错
}
Reported by PMD.
Line: 11
public class Bug1 extends TestCase {
public void testToEntry2() {
InnerEntry inner1 = null;// 出错
String source1 = JSONObject.toJSONString(inner1);
System.out.println(source1);
OuterEntry inner2 = JSONObject.parseObject(source1, OuterEntry.class);// 出错
}
Reported by PMD.
Line: 15
InnerEntry inner1 = null;// 出错
String source1 = JSONObject.toJSONString(inner1);
System.out.println(source1);
OuterEntry inner2 = JSONObject.parseObject(source1, OuterEntry.class);// 出错
}
}
Reported by PMD.
Line: 15
InnerEntry inner1 = null;// 出错
String source1 = JSONObject.toJSONString(inner1);
System.out.println(source1);
OuterEntry inner2 = JSONObject.parseObject(source1, OuterEntry.class);// 出错
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/EnumFieldTest3.java
5 issues
Line: 14
public class EnumFieldTest3 extends TestCase {
public void test_1() throws Exception {
Model[] array = new Model[2048];
for (int i = 0; i < array.length; ++i) {
array[i] = new Model();
array[i].value = Type.A;
}
Reported by PMD.
Line: 31
}
}
public void test_1_writer() throws Exception {
Model[] array = new Model[2048];
for (int i = 0; i < array.length; ++i) {
array[i] = new Model();
array[i].value = Type.A;
}
Reported by PMD.
Line: 50
}
}
public void test_null() throws Exception {
Model[] array = new Model[2048];
for (int i = 0; i < array.length; ++i) {
array[i] = new Model();
array[i].value = null;
}
Reported by PMD.
Line: 54
Model[] array = new Model[2048];
for (int i = 0; i < array.length; ++i) {
array[i] = new Model();
array[i].value = null;
}
String text = JSON.toJSONString(array, SerializerFeature.WriteMapNullValue);
Model[] array2 = JSON.parseObject(text, Model[].class);
Reported by PMD.
Line: 69
public static class Model {
public Type value;
}
public static enum Type {
A, B, C
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_for_lenolix_6.java
5 issues
Line: 25
String userJSON = JSON.toJSONString(map, SerializerFeature.WriteClassName,
SerializerFeature.WriteMapNullValue);
System.out.println(userJSON);
Object object = JSON.parse(userJSON);
}
}
Reported by PMD.
Line: 14
public class Bug_for_lenolix_6 extends TestCase {
public void test_for_objectKey() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
map.put("id", 1);
map.put("name", "leno.lix");
map.put("birthday", new Date());
map.put("gmtCreate", new java.sql.Date(new Date().getTime()));
Reported by PMD.
Line: 14
public class Bug_for_lenolix_6 extends TestCase {
public void test_for_objectKey() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
map.put("id", 1);
map.put("name", "leno.lix");
map.put("birthday", new Date());
map.put("gmtCreate", new java.sql.Date(new Date().getTime()));
Reported by PMD.
Line: 27
System.out.println(userJSON);
Object object = JSON.parse(userJSON);
}
}
Reported by PMD.
Line: 27
System.out.println(userJSON);
Object object = JSON.parse(userJSON);
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_for_lenolix_2.java
5 issues
Line: 19
Map<String, User> matcherMap = new HashMap<String, User>();
String matcherMapString = JSON.toJSONString(matcherMap, SerializerFeature.WriteMapNullValue);
System.out.println(matcherMapString);
matcherMap = JSONObject.parseObject(matcherMapString, new TypeReference<Map<String, User>>() {
});
}
Reported by PMD.
Line: 15
public class Bug_for_lenolix_2 extends TestCase {
public void test_0() throws Exception {
Map<String, User> matcherMap = new HashMap<String, User>();
String matcherMapString = JSON.toJSONString(matcherMap, SerializerFeature.WriteMapNullValue);
System.out.println(matcherMapString);
Reported by PMD.
Line: 15
public class Bug_for_lenolix_2 extends TestCase {
public void test_0() throws Exception {
Map<String, User> matcherMap = new HashMap<String, User>();
String matcherMapString = JSON.toJSONString(matcherMap, SerializerFeature.WriteMapNullValue);
System.out.println(matcherMapString);
Reported by PMD.
Line: 21
System.out.println(matcherMapString);
matcherMap = JSONObject.parseObject(matcherMapString, new TypeReference<Map<String, User>>() {
});
}
public static class User {
Reported by PMD.
Line: 21
System.out.println(matcherMapString);
matcherMap = JSONObject.parseObject(matcherMapString, new TypeReference<Map<String, User>>() {
});
}
public static class User {
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_for_lenolix_1.java
5 issues
Line: 20
String matcherMapString = JSON.toJSONString(matcherMap, SerializerFeature.WriteClassName,
SerializerFeature.WriteMapNullValue);
System.out.println(matcherMapString);
matcherMap = JSONObject.parseObject(matcherMapString, new TypeReference<Map<String, User>>() {
});
}
Reported by PMD.
Line: 15
public class Bug_for_lenolix_1 extends TestCase {
public void test_0() throws Exception {
Map<String, User> matcherMap = new HashMap<String, User>();
String matcherMapString = JSON.toJSONString(matcherMap, SerializerFeature.WriteClassName,
SerializerFeature.WriteMapNullValue);
System.out.println(matcherMapString);
Reported by PMD.
Line: 15
public class Bug_for_lenolix_1 extends TestCase {
public void test_0() throws Exception {
Map<String, User> matcherMap = new HashMap<String, User>();
String matcherMapString = JSON.toJSONString(matcherMap, SerializerFeature.WriteClassName,
SerializerFeature.WriteMapNullValue);
System.out.println(matcherMapString);
Reported by PMD.
Line: 22
System.out.println(matcherMapString);
matcherMap = JSONObject.parseObject(matcherMapString, new TypeReference<Map<String, User>>() {
});
}
public static class User {
Reported by PMD.
Line: 22
System.out.println(matcherMapString);
matcherMap = JSONObject.parseObject(matcherMapString, new TypeReference<Map<String, User>>() {
});
}
public static class User {
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_for_juewu.java
5 issues
Line: 9
public class Bug_for_juewu extends TestCase {
public void test_str() throws Exception {
String text = "{\"weitao_feed\":{\"head\":{\"Version\":\"V1.0\",\"Status\":\"OK\",\"SearchTime\":1488,\"DocsReturn\":18,\"DocsFound\":20,\"DocsRestrict\":20,\"DocsSearch\":0},\"auctions\":[{\"id\":\"110009362197\",\"creator_id\":\"673515636\",\"gmt_create_ms\":\"1385540374000\"}]}}";
}
}
Reported by PMD.
Line: 9
public class Bug_for_juewu extends TestCase {
public void test_str() throws Exception {
String text = "{\"weitao_feed\":{\"head\":{\"Version\":\"V1.0\",\"Status\":\"OK\",\"SearchTime\":1488,\"DocsReturn\":18,\"DocsFound\":20,\"DocsRestrict\":20,\"DocsSearch\":0},\"auctions\":[{\"id\":\"110009362197\",\"creator_id\":\"673515636\",\"gmt_create_ms\":\"1385540374000\"}]}}";
}
}
Reported by PMD.
Line: 10
public class Bug_for_juewu extends TestCase {
public void test_str() throws Exception {
String text = "{\"weitao_feed\":{\"head\":{\"Version\":\"V1.0\",\"Status\":\"OK\",\"SearchTime\":1488,\"DocsReturn\":18,\"DocsFound\":20,\"DocsRestrict\":20,\"DocsSearch\":0},\"auctions\":[{\"id\":\"110009362197\",\"creator_id\":\"673515636\",\"gmt_create_ms\":\"1385540374000\"}]}}";
}
}
Reported by PMD.
Line: 5
import junit.framework.TestCase;
import com.alibaba.fastjson.JSON;
public class Bug_for_juewu extends TestCase {
public void test_str() throws Exception {
String text = "{\"weitao_feed\":{\"head\":{\"Version\":\"V1.0\",\"Status\":\"OK\",\"SearchTime\":1488,\"DocsReturn\":18,\"DocsFound\":20,\"DocsRestrict\":20,\"DocsSearch\":0},\"auctions\":[{\"id\":\"110009362197\",\"creator_id\":\"673515636\",\"gmt_create_ms\":\"1385540374000\"}]}}";
Reported by PMD.
Line: 10
public class Bug_for_juewu extends TestCase {
public void test_str() throws Exception {
String text = "{\"weitao_feed\":{\"head\":{\"Version\":\"V1.0\",\"Status\":\"OK\",\"SearchTime\":1488,\"DocsReturn\":18,\"DocsFound\":20,\"DocsRestrict\":20,\"DocsSearch\":0},\"auctions\":[{\"id\":\"110009362197\",\"creator_id\":\"673515636\",\"gmt_create_ms\":\"1385540374000\"}]}}";
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/bug/Bug_105_for_SpitFire.java
5 issues
Line: 38
public void test_listErrorTest() {
Foo foo = new Foo();
String json = JSON.toJSONString(foo, SerializerFeature.WriteMapNullValue);
System.out.println(json);
Foo f = JSON.parseObject(json, Foo.class);
System.out.println(f);
}
}
Reported by PMD.
Line: 40
String json = JSON.toJSONString(foo, SerializerFeature.WriteMapNullValue);
System.out.println(json);
Foo f = JSON.parseObject(json, Foo.class);
System.out.println(f);
}
}
Reported by PMD.
Line: 12
public class Bug_105_for_SpitFire extends TestCase {
static private class Foo {
private List<String> names;
private List<String> codes;
public List<String> getNames() {
Reported by PMD.
Line: 35
}
public void test_listErrorTest() {
Foo foo = new Foo();
String json = JSON.toJSONString(foo, SerializerFeature.WriteMapNullValue);
System.out.println(json);
Foo f = JSON.parseObject(json, Foo.class);
System.out.println(f);
Reported by PMD.
Line: 35
}
public void test_listErrorTest() {
Foo foo = new Foo();
String json = JSON.toJSONString(foo, SerializerFeature.WriteMapNullValue);
System.out.println(json);
Foo f = JSON.parseObject(json, Foo.class);
System.out.println(f);
Reported by PMD.