The following issues were found
src/test/java/com/alibaba/json/test/a/IncomingDataPointBenchmark_file_ext_double.java
4 issues
Line: 30
JSON.parseArray(json, IncomingDataPoint_ext_double.class);
}
long millis = System.currentTimeMillis() - start;
System.out.println("IncomingDataPoint_double millis : " + millis);
}
}
Reported by PMD.
Line: 13
/**
* Created by wenshao on 04/08/2017.
*/
public class IncomingDataPointBenchmark_file_ext_double {
static String json;
public static void main(String[] args) throws Exception {
File file = new File("/Users/wenshao/Downloads/datalist_double");
json = FileUtils.readFileToString(file);
Reported by PMD.
Line: 16
public class IncomingDataPointBenchmark_file_ext_double {
static String json;
public static void main(String[] args) throws Exception {
File file = new File("/Users/wenshao/Downloads/datalist_double");
json = FileUtils.readFileToString(file);
for (int i = 0; i < 10; ++i) {
perf();
}
Reported by PMD.
Line: 4
package com.alibaba.json.test.a;
import com.alibaba.fastjson.JSON;
import com.alibaba.json.bvtVO.IncomingDataPoint_double;
import com.alibaba.json.bvtVO.IncomingDataPoint_ext_double;
import org.apache.commons.io.FileUtils;
import java.io.File;
Reported by PMD.
src/test/java/com/alibaba/json/test/epubview/TestKlutz3.java
4 issues
Line: 26
// book.setMetadata(null);
String str = JSON.toJSONString(book);
System.out.println(str);
JSON.parseObject(str, EpubViewBook.class);
}
}
Reported by PMD.
Line: 11
import com.alibaba.fastjson.JSON;
public class TestKlutz3 extends TestCase {
public void test_0 () throws Exception {
EpubViewBook book = new EpubViewBook();
book.setBookName("xx");
book.setPageList(new ArrayList<EpubViewPage>());
Reported by PMD.
Line: 11
import com.alibaba.fastjson.JSON;
public class TestKlutz3 extends TestCase {
public void test_0 () throws Exception {
EpubViewBook book = new EpubViewBook();
book.setBookName("xx");
book.setPageList(new ArrayList<EpubViewPage>());
Reported by PMD.
Line: 18
book.setPageList(new ArrayList<EpubViewPage>());
EpubViewPage page = new EpubViewPage();
book.getPageList().add(page);
EpubViewMetaData metadata = new EpubViewMetaData();
metadata.setProperties(new HashMap<String, String>());
// book.setMetadata(null);
Reported by PMD.
src/test/java/com/alibaba/json/test/benchmark/basic/IntBenchmark_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 Integer v1;
public Integer v2;
Reported by PMD.
Line: 9
/**
* Created by wenshao on 04/08/2017.
*/
public class IntBenchmark_arrayMapping_obj {
static String json = "[-1224609302,379420556,-1098099527,-2018662,422842162]";
static String json2 = "[\"-1224609302\",\"379420556\",\"-1098099527\",\"-2018662\",\"422842162\"]";
public static void main(String[] args) throws Exception {
// Model model = new Model();
Reported by PMD.
Line: 13
static String json = "[-1224609302,379420556,-1098099527,-2018662,422842162]";
static String json2 = "[\"-1224609302\",\"379420556\",\"-1098099527\",\"-2018662\",\"422842162\"]";
public static void main(String[] args) throws Exception {
// Model model = new Model();
// model.v1 = new Random().nextInt();
// model.v2 = new Random().nextInt();
// model.v3 = new Random().nextInt();
// model.v4 = new Random().nextInt();
Reported by PMD.
src/test/java/com/alibaba/json/test/epubview/TestKlutz2.java
4 issues
Line: 25
x.setImageUrl("xxx");
String str = JSON.toJSONString(x);
System.out.println(str);
JSON.parseObject(str, EpubViewPage.class);
}
}
Reported by PMD.
Line: 20
// JSON.parseObject(str, EpubViewMetaData.class);
// }
public void test_page () throws Exception {
EpubViewPage x = new EpubViewPage();
x.setImageUrl("xxx");
String str = JSON.toJSONString(x);
System.out.println(str);
Reported by PMD.
Line: 20
// JSON.parseObject(str, EpubViewMetaData.class);
// }
public void test_page () throws Exception {
EpubViewPage x = new EpubViewPage();
x.setImageUrl("xxx");
String str = JSON.toJSONString(x);
System.out.println(str);
Reported by PMD.
Line: 3
package com.alibaba.json.test.epubview;
import java.util.HashMap;
import junit.framework.TestCase;
import com.alibaba.fastjson.JSON;
public class TestKlutz2 extends TestCase {
Reported by PMD.
src/test/java/com/alibaba/json/test/codegen/MediaContentGenTest.java
4 issues
Line: 18
generator.gen();
System.out.println(out.toString());
}
}
Reported by PMD.
Line: 12
public class MediaContentGenTest extends TestCase {
public void test_codegen() throws Exception {
StringBuffer out = new StringBuffer();
DeserializerGen generator = new DeserializerGen(MediaContent.class, out);
generator.gen();
Reported by PMD.
Line: 12
public class MediaContentGenTest extends TestCase {
public void test_codegen() throws Exception {
StringBuffer out = new StringBuffer();
DeserializerGen generator = new DeserializerGen(MediaContent.class, out);
generator.gen();
Reported by PMD.
Line: 7
import com.alibaba.fastjson.codegen.DeserializerGen;
import data.media.Image;
import data.media.MediaContent;
public class MediaContentGenTest extends TestCase {
public void test_codegen() throws Exception {
Reported by PMD.
src/test/java/com/alibaba/json/test/benchmark/entity/Entity100Int.java
4 issues
Line: 1
package com.alibaba.json.test.benchmark.entity;
public class Entity100Int {
private int f0 = 0;
private int f1 = 1;
private int f2 = 2;
private int f3 = 3;
private int f4 = 4;
Reported by PMD.
Line: 3
package com.alibaba.json.test.benchmark.entity;
public class Entity100Int {
private int f0 = 0;
private int f1 = 1;
private int f2 = 2;
private int f3 = 3;
private int f4 = 4;
Reported by PMD.
Line: 3
package com.alibaba.json.test.benchmark.entity;
public class Entity100Int {
private int f0 = 0;
private int f1 = 1;
private int f2 = 2;
private int f3 = 3;
private int f4 = 4;
Reported by PMD.
Line: 5
public class Entity100Int {
private int f0 = 0;
private int f1 = 1;
private int f2 = 2;
private int f3 = 3;
private int f4 = 4;
private int f5 = 5;
Reported by PMD.
src/test/java/com/alibaba/json/bvtVO/Main.java
4 issues
Line: 24
Page<Bean> jsonPage = JSON.parseObject(json, new TypeReference<Page<Bean>>() {
});
System.out.println(jsonPage.getItems().get(0).getName());
}
}
Reported by PMD.
Line: 9
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
public class Main {
public static void main(String[] args) {
Page<Bean> page = new Page<Bean>();
page.setCount(1);
List<Bean> items = new ArrayList<Bean>();
Bean item = new Bean();
Reported by PMD.
Line: 24
Page<Bean> jsonPage = JSON.parseObject(json, new TypeReference<Page<Bean>>() {
});
System.out.println(jsonPage.getItems().get(0).getName());
}
}
Reported by PMD.
Line: 24
Page<Bean> jsonPage = JSON.parseObject(json, new TypeReference<Page<Bean>>() {
});
System.out.println(jsonPage.getItems().get(0).getName());
}
}
Reported by PMD.
src/test/java/com/alibaba/json/test/gson/TestChineseQuote.java
4 issues
Line: 9
public class TestChineseQuote extends TestCase {
public void test_chinese_quote() throws Exception {
String text = "{\"name\":“tiny.luo”,\"school\":\"\"}";
Gson gson = new Gson();
User user = gson.fromJson(text, User.class);
Reported by PMD.
Line: 9
public class TestChineseQuote extends TestCase {
public void test_chinese_quote() throws Exception {
String text = "{\"name\":“tiny.luo”,\"school\":\"\"}";
Gson gson = new Gson();
User user = gson.fromJson(text, User.class);
Reported by PMD.
Line: 13
String text = "{\"name\":“tiny.luo”,\"school\":\"\"}";
Gson gson = new Gson();
User user = gson.fromJson(text, User.class);
}
public static class User {
Reported by PMD.
Line: 13
String text = "{\"name\":“tiny.luo”,\"school\":\"\"}";
Gson gson = new Gson();
User user = gson.fromJson(text, User.class);
}
public static class User {
Reported by PMD.
src/test/java/com/alibaba/json/demo/hibernate/data/OrderDetail.java
4 issues
Line: 29
private Product product;
private Integer quantityOrdered;
private double priceEach;
private short orderLineNumber;
public OrderDetail() {
}
public OrderDetail(OrderDetailId id, Order order, Product product, Integer quantityOrdered, double priceEach, short orderLineNumber) {
Reported by PMD.
Line: 95
}
@Column(name="orderLineNumber", nullable=false)
public short getOrderLineNumber() {
return this.orderLineNumber;
}
public void setOrderLineNumber(short orderLineNumber) {
this.orderLineNumber = orderLineNumber;
Reported by PMD.
Line: 99
return this.orderLineNumber;
}
public void setOrderLineNumber(short orderLineNumber) {
this.orderLineNumber = orderLineNumber;
}
Reported by PMD.
Line: 21
@Table(name="OrderDetail"
,catalog="classicmodels"
)
public class OrderDetail implements java.io.Serializable {
private OrderDetailId id;
private Order order;
private Product product;
Reported by PMD.
src/test/java/com/alibaba/json/test/benchmark/basic/IntBenchmark_obj.java
4 issues
Line: 34
JSON.parseObject(json, Model.class);
}
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: 43
JSON.parseObject(json2, Model.class);
}
long millis = System.currentTimeMillis() - start;
System.out.println("millis : " + millis);
}
public static class Model {
public Integer v1;
public Integer v2;
Reported by PMD.
Line: 8
/**
* Created by wenshao on 04/08/2017.
*/
public class IntBenchmark_obj {
static String json = "{\"v1\":-1224609302,\"v2\":379420556,\"v3\":-1098099527,\"v4\":-2018662,\"v5\":422842162}";
static String json2 = "{\"v1\":\"-1224609302\",\"v2\":\"379420556\",\"v3\":\"-1098099527\",\"v4\":\"-2018662\",\"v5\":\"422842162\"}";
public static void main(String[] args) throws Exception {
// Model model = new Model();
Reported by PMD.
Line: 12
static String json = "{\"v1\":-1224609302,\"v2\":379420556,\"v3\":-1098099527,\"v4\":-2018662,\"v5\":422842162}";
static String json2 = "{\"v1\":\"-1224609302\",\"v2\":\"379420556\",\"v3\":\"-1098099527\",\"v4\":\"-2018662\",\"v5\":\"422842162\"}";
public static void main(String[] args) throws Exception {
// Model model = new Model();
// model.v1 = new Random().nextInt();
// model.v2 = new Random().nextInt();
// model.v3 = new Random().nextInt();
// model.v4 = new Random().nextInt();
Reported by PMD.