The following issues were found
src/test/java/com/alibaba/json/bvtVO/WareHouseInfo.java
4 issues
Line: 10
*
* @author maik.wangz 2011-12-12 ����09:50:32
*/
public class WareHouseInfo implements Serializable {
private static final long serialVersionUID = 6102232214244738211L;
// ʡ��ID
private String provinceId;
// ʡ�����
Reported by PMD.
Line: 87
}
public Image[] getImages() {
return images;
}
public void setImages(Image[] images) {
this.images = images;
}
Reported by PMD.
Line: 90
return images;
}
public void setImages(Image[] images) {
this.images = images;
}
}
Reported by PMD.
Line: 90
return images;
}
public void setImages(Image[] images) {
this.images = images;
}
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/writeClassName/WriteClassNameTest2.java
4 issues
Line: 17
A a = new A();
a.setB(new B());
String text = JSON.toJSONString(a, SerializerFeature.WriteClassName);
System.out.println(text);
Assert.assertEquals("{\"@type\":\"com.alibaba.json.bvt.writeClassName.WriteClassNameTest2$A\",\"b\":{\"id\":0}}",
text);
A a1 = (A) JSON.parse(text, Feature.SupportAutoType);
Reported by PMD.
Line: 13
public class WriteClassNameTest2 extends TestCase {
public void test_writeClassName() throws Exception {
A a = new A();
a.setB(new B());
String text = JSON.toJSONString(a, SerializerFeature.WriteClassName);
System.out.println(text);
Assert.assertEquals("{\"@type\":\"com.alibaba.json.bvt.writeClassName.WriteClassNameTest2$A\",\"b\":{\"id\":0}}",
Reported by PMD.
Line: 23
A a1 = (A) JSON.parse(text, Feature.SupportAutoType);
Assert.assertNotNull(a1.getB());
}
public static class A {
private B b;
Reported by PMD.
Line: 4
package com.alibaba.json.bvt.writeClassName;
import com.alibaba.fastjson.parser.Feature;
import com.alibaba.fastjson.parser.ParserConfig;
import org.junit.Assert;
import junit.framework.TestCase;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
Reported by PMD.
src/test/java/com/alibaba/json/test/benchmark/basic/DoubleBenchmark_arrayMapping.java
4 issues
Line: 35
JSON.parseObject(json, Model.class, Feature.SupportArrayToBean);
}
long millis = System.currentTimeMillis() - start;
System.out.println("millis : " + millis);
}
public static void perf2() {
long start = System.currentTimeMillis();
for (int i = 0; i < 1000 * 1000 * 10; ++i) {
Reported by PMD.
Line: 44
JSON.parseObject(json2, Model.class, Feature.SupportArrayToBean);
}
long millis = System.currentTimeMillis() - start;
System.out.println("millis : " + millis);
}
public static class Model {
public double v1;
public double v2;
Reported by PMD.
Line: 9
/**
* Created by wenshao on 04/08/2017.
*/
public class DoubleBenchmark_arrayMapping {
static String json = "[0.4430165316544028,0.22676692048907365,0.9766986818812096,0.3423751102308744,0.4262177938610565]";
static String json2 = "[\"0.4430165316544028\",\"0.22676692048907365\",\"0.9766986818812096\",\"0.3423751102308744\",\"0.4262177938610565\"]";
public static void main(String[] args) throws Exception {
// Model model = new Model();
Reported by PMD.
Line: 13
static String json = "[0.4430165316544028,0.22676692048907365,0.9766986818812096,0.3423751102308744,0.4262177938610565]";
static String json2 = "[\"0.4430165316544028\",\"0.22676692048907365\",\"0.9766986818812096\",\"0.3423751102308744\",\"0.4262177938610565\"]";
public static void main(String[] args) throws Exception {
// Model model = new Model();
// model.v1 = new Random().nextDouble();
// model.v2 = new Random().nextDouble();
// model.v3 = new Random().nextDouble();
// model.v4 = new Random().nextDouble();
Reported by PMD.
src/test/java/com/alibaba/json/test/benchmark/basic/DoubleBenchmark_arrayMapping_obj.java
4 issues
Line: 35
JSON.parseObject(json, Model.class, Feature.SupportArrayToBean);
}
long millis = System.currentTimeMillis() - start;
System.out.println("millis : " + millis);
}
public static void perf2() {
long start = System.currentTimeMillis();
for (int i = 0; i < 1000 * 1000 * 10; ++i) {
Reported by PMD.
Line: 44
JSON.parseObject(json2, Model.class, Feature.SupportArrayToBean);
}
long millis = System.currentTimeMillis() - start;
System.out.println("millis : " + millis);
}
public static class Model {
public Double v1;
public Double v2;
Reported by PMD.
Line: 9
/**
* Created by wenshao on 04/08/2017.
*/
public class DoubleBenchmark_arrayMapping_obj {
static String json = "[0.4430165316544028,0.22676692048907365,0.9766986818812096,0.3423751102308744,0.4262177938610565]";
static String json2 = "[\"0.4430165316544028\",\"0.22676692048907365\",\"0.9766986818812096\",\"0.3423751102308744\",\"0.4262177938610565\"]";
public static void main(String[] args) throws Exception {
// Model model = new Model();
Reported by PMD.
Line: 13
static String json = "[0.4430165316544028,0.22676692048907365,0.9766986818812096,0.3423751102308744,0.4262177938610565]";
static String json2 = "[\"0.4430165316544028\",\"0.22676692048907365\",\"0.9766986818812096\",\"0.3423751102308744\",\"0.4262177938610565\"]";
public static void main(String[] args) throws Exception {
// Model model = new Model();
// model.v1 = new Random().nextDouble();
// model.v2 = new Random().nextDouble();
// model.v3 = new Random().nextDouble();
// model.v4 = new Random().nextDouble();
Reported by PMD.
src/test/java/com/alibaba/json/bvt/writeClassName/WriteClassNameTest3.java
4 issues
Line: 16
public class WriteClassNameTest3 extends TestCase {
public void test_list() throws Exception {
Map root = new HashMap();
root.put("val", new Model());
String str = JSON.toJSONString(root);
assertEquals("{\"val\":{\"@type\":\"com.alibaba.json.bvt.writeClassName.WriteClassNameTest3$Model\"}}", str);
Reported by PMD.
Line: 21
root.put("val", new Model());
String str = JSON.toJSONString(root);
assertEquals("{\"val\":{\"@type\":\"com.alibaba.json.bvt.writeClassName.WriteClassNameTest3$Model\"}}", str);
JSON.parseObject(str);
}
@JSONType(serialzeFeatures = SerializerFeature.WriteClassName)
Reported by PMD.
Line: 4
package com.alibaba.json.bvt.writeClassName;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONType;
import com.alibaba.fastjson.serializer.SerializerFeature;
import junit.framework.TestCase;
import org.junit.Assert;
Reported by PMD.
Line: 8
import com.alibaba.fastjson.annotation.JSONType;
import com.alibaba.fastjson.serializer.SerializerFeature;
import junit.framework.TestCase;
import org.junit.Assert;
import java.util.HashMap;
import java.util.Map;
public class WriteClassNameTest3 extends TestCase {
Reported by PMD.
src/test/java/com/alibaba/json/demo/User.java
4 issues
Line: 34
user.setId(123L);
user.setName("wenshao");
String text = JSON.toJSONString(user);
System.out.println(text);
User user1 = JSON.parseObject(text, User.class);
Assert.assertEquals("{\"id\":123,\"name\":\"wenshao\"}", text);
}
}
Reported by PMD.
Line: 8
import com.alibaba.fastjson.JSON;
public class User {
private Long id;
private String name;
public Long getId() {
Reported by PMD.
Line: 36
String text = JSON.toJSONString(user);
System.out.println(text);
User user1 = JSON.parseObject(text, User.class);
Assert.assertEquals("{\"id\":123,\"name\":\"wenshao\"}", text);
}
}
Reported by PMD.
Line: 36
String text = JSON.toJSONString(user);
System.out.println(text);
User user1 = JSON.parseObject(text, User.class);
Assert.assertEquals("{\"id\":123,\"name\":\"wenshao\"}", text);
}
}
Reported by PMD.
src/test/java/com/derbysoft/spitfire/fastjson/dto/AbstractDTO.java
3 issues
Line: 7
import com.alibaba.fastjson.annotation.JSONField;
public abstract class AbstractDTO implements Serializable {
private boolean keepgoingValidate = false;
private boolean checkCircularReference = true;
@JSONField(name="KV")
Reported by PMD.
Line: 7
import com.alibaba.fastjson.annotation.JSONField;
public abstract class AbstractDTO implements Serializable {
private boolean keepgoingValidate = false;
private boolean checkCircularReference = true;
@JSONField(name="KV")
Reported by PMD.
Line: 8
import com.alibaba.fastjson.annotation.JSONField;
public abstract class AbstractDTO implements Serializable {
private boolean keepgoingValidate = false;
private boolean checkCircularReference = true;
@JSONField(name="KV")
public boolean isKeepgoingValidate() {
Reported by PMD.
src/test/java/com/alibaba/json/test/vans/VansGeometryData.java
3 issues
Line: 10
import java.util.ArrayList;
@JSONType(orders = {"uvs","metadata","normals","name","faces","vertices"})
public class VansGeometryData implements Serializable{
public float[][] uvs;
@JSONField(name = "metadata")
public VansGeometryDataMetaData metaData;
Reported by PMD.
Line: 10
import java.util.ArrayList;
@JSONType(orders = {"uvs","metadata","normals","name","faces","vertices"})
public class VansGeometryData implements Serializable{
public float[][] uvs;
@JSONField(name = "metadata")
public VansGeometryDataMetaData metaData;
Reported by PMD.
Line: 7
import com.alibaba.fastjson.annotation.JSONType;
import java.io.Serializable;
import java.util.ArrayList;
@JSONType(orders = {"uvs","metadata","normals","name","faces","vertices"})
public class VansGeometryData implements Serializable{
public float[][] uvs;
Reported by PMD.
src/test/java/data/ReprUtil.java
3 issues
Line: 4
package data;
public class ReprUtil
{
public static String repr(String s)
{
if (s == null) return "null";
return '"' + s + '"';
}
Reported by PMD.
Line: 15
{
StringBuilder buf = new StringBuilder();
buf.append('[');
String sep = "";
for (String s : it) {
buf.append(sep); sep = ", ";
buf.append(repr(s));
}
buf.append(']');
Reported by PMD.
Line: 17
buf.append('[');
String sep = "";
for (String s : it) {
buf.append(sep); sep = ", ";
buf.append(repr(s));
}
buf.append(']');
return buf.toString();
}
Reported by PMD.
src/test/java/com/alibaba/json/test/entity/case1/Int_100_Entity.java
3 issues
Line: 1
package com.alibaba.json.test.entity.case1;
public class Int_100_Entity {
private int f0;
private int f1;
private int f2;
private int f3;
private int f4;
Reported by PMD.
Line: 3
package com.alibaba.json.test.entity.case1;
public class Int_100_Entity {
private int f0;
private int f1;
private int f2;
private int f3;
private int f4;
Reported by PMD.
Line: 3
package com.alibaba.json.test.entity.case1;
public class Int_100_Entity {
private int f0;
private int f1;
private int f2;
private int f3;
private int f4;
Reported by PMD.