The following issues were found
src/test/java/com/alibaba/json/bvt/builder/BuilderTest2_private.java
7 issues
Line: 13
public class BuilderTest2_private extends TestCase {
public void test_create() throws Exception {
VO vo = JSON.parseObject("{\"id\":12304,\"name\":\"ljw\"}", VO.class);
Assert.assertEquals(12304, vo.getId());
Assert.assertEquals("ljw", vo.getName());
}
Reported by PMD.
Line: 16
public void test_create() throws Exception {
VO vo = JSON.parseObject("{\"id\":12304,\"name\":\"ljw\"}", VO.class);
Assert.assertEquals(12304, vo.getId());
Assert.assertEquals("ljw", vo.getName());
}
@JSONType(builder=VOBuilder.class)
public static class VO {
Reported by PMD.
Line: 17
VO vo = JSON.parseObject("{\"id\":12304,\"name\":\"ljw\"}", VO.class);
Assert.assertEquals(12304, vo.getId());
Assert.assertEquals("ljw", vo.getName());
}
@JSONType(builder=VOBuilder.class)
public static class VO {
private int id;
Reported by PMD.
Line: 22
@JSONType(builder=VOBuilder.class)
public static class VO {
private int id;
private String name;
public int getId() {
return id;
}
Reported by PMD.
Line: 23
@JSONType(builder=VOBuilder.class)
public static class VO {
private int id;
private String name;
public int getId() {
return id;
}
Reported by PMD.
Line: 37
@JSONPOJOBuilder(buildMethod="xxx")
private static class VOBuilder {
private VO vo = new VO();
public VO xxx() {
return vo;
}
Reported by PMD.
Line: 37
@JSONPOJOBuilder(buildMethod="xxx")
private static class VOBuilder {
private VO vo = new VO();
public VO xxx() {
return vo;
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/builder/BuilderTest3.java
7 issues
Line: 13
public class BuilderTest3 extends TestCase {
public void test_create() throws Exception {
VO vo = JSON.parseObject("{\"id\":12304,\"name\":\"ljw\"}", VO.class);
Assert.assertEquals(12304, vo.getId());
Assert.assertEquals("ljw", vo.getName());
}
Reported by PMD.
Line: 16
public void test_create() throws Exception {
VO vo = JSON.parseObject("{\"id\":12304,\"name\":\"ljw\"}", VO.class);
Assert.assertEquals(12304, vo.getId());
Assert.assertEquals("ljw", vo.getName());
}
@JSONType(builder=VOBuilder.class)
public static class VO {
Reported by PMD.
Line: 17
VO vo = JSON.parseObject("{\"id\":12304,\"name\":\"ljw\"}", VO.class);
Assert.assertEquals(12304, vo.getId());
Assert.assertEquals("ljw", vo.getName());
}
@JSONType(builder=VOBuilder.class)
public static class VO {
private int id;
Reported by PMD.
Line: 22
@JSONType(builder=VOBuilder.class)
public static class VO {
private int id;
private String name;
public int getId() {
return id;
}
Reported by PMD.
Line: 23
@JSONType(builder=VOBuilder.class)
public static class VO {
private int id;
private String name;
public int getId() {
return id;
}
Reported by PMD.
Line: 37
@JSONPOJOBuilder(withPrefix="kk", buildMethod="mmm")
public static class VOBuilder {
private VO vo = new VO();
public VO mmm() {
return vo;
}
Reported by PMD.
Line: 37
@JSONPOJOBuilder(withPrefix="kk", buildMethod="mmm")
public static class VOBuilder {
private VO vo = new VO();
public VO mmm() {
return vo;
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/builder/BuilderTest3_private.java
7 issues
Line: 13
public class BuilderTest3_private extends TestCase {
public void test_create() throws Exception {
VO vo = JSON.parseObject("{\"id\":12304,\"name\":\"ljw\"}", VO.class);
Assert.assertEquals(12304, vo.getId());
Assert.assertEquals("ljw", vo.getName());
}
Reported by PMD.
Line: 16
public void test_create() throws Exception {
VO vo = JSON.parseObject("{\"id\":12304,\"name\":\"ljw\"}", VO.class);
Assert.assertEquals(12304, vo.getId());
Assert.assertEquals("ljw", vo.getName());
}
@JSONType(builder=VOBuilder.class)
public static class VO {
Reported by PMD.
Line: 17
VO vo = JSON.parseObject("{\"id\":12304,\"name\":\"ljw\"}", VO.class);
Assert.assertEquals(12304, vo.getId());
Assert.assertEquals("ljw", vo.getName());
}
@JSONType(builder=VOBuilder.class)
public static class VO {
private int id;
Reported by PMD.
Line: 22
@JSONType(builder=VOBuilder.class)
public static class VO {
private int id;
private String name;
public int getId() {
return id;
}
Reported by PMD.
Line: 23
@JSONType(builder=VOBuilder.class)
public static class VO {
private int id;
private String name;
public int getId() {
return id;
}
Reported by PMD.
Line: 36
private static class VOBuilder {
private VO vo = new VO();
public VO create() {
return vo;
}
Reported by PMD.
Line: 36
private static class VOBuilder {
private VO vo = new VO();
public VO create() {
return vo;
}
Reported by PMD.
src/test/java/com/alibaba/json/bvt/geo/FeatureCollectionTest.java
7 issues
Line: 11
public class FeatureCollectionTest
extends TestCase {
public void test_geo() throws Exception {
String str = "{\n" +
" \"type\": \"FeatureCollection\",\n" +
" \"features\": [{\n" +
" \"type\": \"Feature\",\n" +
" \"geometry\": {\n" +
Reported by PMD.
Line: 11
public class FeatureCollectionTest
extends TestCase {
public void test_geo() throws Exception {
String str = "{\n" +
" \"type\": \"FeatureCollection\",\n" +
" \"features\": [{\n" +
" \"type\": \"Feature\",\n" +
" \"geometry\": {\n" +
Reported by PMD.
Line: 62
"}\n";
Geometry geometry = JSON.parseObject(str, Geometry.class);
assertEquals(FeatureCollection.class, geometry.getClass());
assertEquals("{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"properties\":{\"prop0\":\"value0\"},\"geometry\":{\"type\":\"Point\",\"coordinates\":[102.0,0.5]}},{\"type\":\"Feature\",\"properties\":{\"prop1\":\"0.0\",\"prop0\":\"value0\"},\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[102.0,0.0],[103.0,1.0],[104.0,0.0],[105.0,1.0]]}},{\"type\":\"Feature\",\"properties\":{\"prop1\":\"{\\\"this\\\":\\\"that\\\"}\",\"prop0\":\"value0\"},\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]]]}}]}", JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
Reported by PMD.
Line: 62
"}\n";
Geometry geometry = JSON.parseObject(str, Geometry.class);
assertEquals(FeatureCollection.class, geometry.getClass());
assertEquals("{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"properties\":{\"prop0\":\"value0\"},\"geometry\":{\"type\":\"Point\",\"coordinates\":[102.0,0.5]}},{\"type\":\"Feature\",\"properties\":{\"prop1\":\"0.0\",\"prop0\":\"value0\"},\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[102.0,0.0],[103.0,1.0],[104.0,0.0],[105.0,1.0]]}},{\"type\":\"Feature\",\"properties\":{\"prop1\":\"{\\\"this\\\":\\\"that\\\"}\",\"prop0\":\"value0\"},\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]]]}}]}", JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
Reported by PMD.
Line: 64
Geometry geometry = JSON.parseObject(str, Geometry.class);
assertEquals(FeatureCollection.class, geometry.getClass());
assertEquals("{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"properties\":{\"prop0\":\"value0\"},\"geometry\":{\"type\":\"Point\",\"coordinates\":[102.0,0.5]}},{\"type\":\"Feature\",\"properties\":{\"prop1\":\"0.0\",\"prop0\":\"value0\"},\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[102.0,0.0],[103.0,1.0],[104.0,0.0],[105.0,1.0]]}},{\"type\":\"Feature\",\"properties\":{\"prop1\":\"{\\\"this\\\":\\\"that\\\"}\",\"prop0\":\"value0\"},\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]]]}}]}", JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
}
}
Reported by PMD.
Line: 67
assertEquals("{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"properties\":{\"prop0\":\"value0\"},\"geometry\":{\"type\":\"Point\",\"coordinates\":[102.0,0.5]}},{\"type\":\"Feature\",\"properties\":{\"prop1\":\"0.0\",\"prop0\":\"value0\"},\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[102.0,0.0],[103.0,1.0],[104.0,0.0],[105.0,1.0]]}},{\"type\":\"Feature\",\"properties\":{\"prop1\":\"{\\\"this\\\":\\\"that\\\"}\",\"prop0\":\"value0\"},\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]]]}}]}", JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
}
}
Reported by PMD.
Line: 6
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.support.geo.FeatureCollection;
import com.alibaba.fastjson.support.geo.Geometry;
import com.alibaba.fastjson.support.geo.Point;
import junit.framework.TestCase;
public class FeatureCollectionTest
extends TestCase {
public void test_geo() throws Exception {
Reported by PMD.
src/test/java/com/alibaba/json/bvt/geo/GeometryCollectionTest.java
7 issues
Line: 11
public class GeometryCollectionTest
extends TestCase {
public void test_geo() throws Exception {
String str = "{\n" +
" \"type\": \"GeometryCollection\",\n" +
" \"geometries\": [{\n" +
" \"type\": \"Point\",\n" +
" \"coordinates\": [100.0, 0.0]\n" +
Reported by PMD.
Line: 11
public class GeometryCollectionTest
extends TestCase {
public void test_geo() throws Exception {
String str = "{\n" +
" \"type\": \"GeometryCollection\",\n" +
" \"geometries\": [{\n" +
" \"type\": \"Point\",\n" +
" \"coordinates\": [100.0, 0.0]\n" +
Reported by PMD.
Line: 27
"}";
Geometry geometry = JSON.parseObject(str, Geometry.class);
assertEquals(GeometryCollection.class, geometry.getClass());
assertEquals(
"{\"type\":\"GeometryCollection\",\"geometries\":[{\"type\":\"Point\",\"coordinates\":[100.0,0.0]},{\"type\":\"LineString\",\"coordinates\":[[101.0,0.0],[102.0,1.0]]}]}"
, JSON.toJSONString(geometry));
Reported by PMD.
Line: 27
"}";
Geometry geometry = JSON.parseObject(str, Geometry.class);
assertEquals(GeometryCollection.class, geometry.getClass());
assertEquals(
"{\"type\":\"GeometryCollection\",\"geometries\":[{\"type\":\"Point\",\"coordinates\":[100.0,0.0]},{\"type\":\"LineString\",\"coordinates\":[[101.0,0.0],[102.0,1.0]]}]}"
, JSON.toJSONString(geometry));
Reported by PMD.
Line: 29
Geometry geometry = JSON.parseObject(str, Geometry.class);
assertEquals(GeometryCollection.class, geometry.getClass());
assertEquals(
"{\"type\":\"GeometryCollection\",\"geometries\":[{\"type\":\"Point\",\"coordinates\":[100.0,0.0]},{\"type\":\"LineString\",\"coordinates\":[[101.0,0.0],[102.0,1.0]]}]}"
, JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
Reported by PMD.
Line: 34
, JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
}
}
Reported by PMD.
Line: 6
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.support.geo.Geometry;
import com.alibaba.fastjson.support.geo.GeometryCollection;
import com.alibaba.fastjson.support.geo.LineString;
import junit.framework.TestCase;
public class GeometryCollectionTest
extends TestCase {
public void test_geo() throws Exception {
Reported by PMD.
src/test/java/com/alibaba/json/bvt/geo/MultiLineStringTest.java
7 issues
Line: 11
public class MultiLineStringTest
extends TestCase {
public void test_geo() throws Exception {
String str = "{\n" +
" \"type\": \"MultiLineString\",\n" +
" \"coordinates\": [\n" +
" [\n" +
" [100.0, 0.0],\n" +
Reported by PMD.
Line: 11
public class MultiLineStringTest
extends TestCase {
public void test_geo() throws Exception {
String str = "{\n" +
" \"type\": \"MultiLineString\",\n" +
" \"coordinates\": [\n" +
" [\n" +
" [100.0, 0.0],\n" +
Reported by PMD.
Line: 27
"}";
Geometry geometry = JSON.parseObject(str, Geometry.class);
assertEquals(MultiLineString.class, geometry.getClass());
assertEquals("{\"type\":\"MultiLineString\",\"coordinates\":[[[100.0,0.0],[101.0,1.0]],[[102.0,2.0],[103.0,3.0]]]}", JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
Reported by PMD.
Line: 27
"}";
Geometry geometry = JSON.parseObject(str, Geometry.class);
assertEquals(MultiLineString.class, geometry.getClass());
assertEquals("{\"type\":\"MultiLineString\",\"coordinates\":[[[100.0,0.0],[101.0,1.0]],[[102.0,2.0],[103.0,3.0]]]}", JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
Reported by PMD.
Line: 29
Geometry geometry = JSON.parseObject(str, Geometry.class);
assertEquals(MultiLineString.class, geometry.getClass());
assertEquals("{\"type\":\"MultiLineString\",\"coordinates\":[[[100.0,0.0],[101.0,1.0]],[[102.0,2.0],[103.0,3.0]]]}", JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
}
}
Reported by PMD.
Line: 32
assertEquals("{\"type\":\"MultiLineString\",\"coordinates\":[[[100.0,0.0],[101.0,1.0]],[[102.0,2.0],[103.0,3.0]]]}", JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
}
}
Reported by PMD.
Line: 6
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.support.geo.Geometry;
import com.alibaba.fastjson.support.geo.MultiLineString;
import com.alibaba.fastjson.support.geo.MultiPoint;
import junit.framework.TestCase;
public class MultiLineStringTest
extends TestCase {
public void test_geo() throws Exception {
Reported by PMD.
src/test/java/com/alibaba/json/bvt/geo/MultiPointTest.java
7 issues
Line: 10
import junit.framework.TestCase;
public class MultiPointTest extends TestCase {
public void test_geo() throws Exception {
String str = "{\n" +
" \"type\": \"MultiPoint\",\n" +
" \"coordinates\": [\n" +
" [100.0, 0.0],\n" +
" [101.0, 1.0]\n" +
Reported by PMD.
Line: 10
import junit.framework.TestCase;
public class MultiPointTest extends TestCase {
public void test_geo() throws Exception {
String str = "{\n" +
" \"type\": \"MultiPoint\",\n" +
" \"coordinates\": [\n" +
" [100.0, 0.0],\n" +
" [101.0, 1.0]\n" +
Reported by PMD.
Line: 20
"}";
Geometry geometry = JSON.parseObject(str, Geometry.class);
assertEquals(MultiPoint.class, geometry.getClass());
assertEquals("{\"type\":\"MultiPoint\",\"coordinates\":[[100.0,0.0],[101.0,1.0]]}", JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
Reported by PMD.
Line: 20
"}";
Geometry geometry = JSON.parseObject(str, Geometry.class);
assertEquals(MultiPoint.class, geometry.getClass());
assertEquals("{\"type\":\"MultiPoint\",\"coordinates\":[[100.0,0.0],[101.0,1.0]]}", JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
Reported by PMD.
Line: 22
Geometry geometry = JSON.parseObject(str, Geometry.class);
assertEquals(MultiPoint.class, geometry.getClass());
assertEquals("{\"type\":\"MultiPoint\",\"coordinates\":[[100.0,0.0],[101.0,1.0]]}", JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
}
}
Reported by PMD.
Line: 25
assertEquals("{\"type\":\"MultiPoint\",\"coordinates\":[[100.0,0.0],[101.0,1.0]]}", JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
}
}
Reported by PMD.
Line: 6
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.support.geo.Geometry;
import com.alibaba.fastjson.support.geo.MultiPoint;
import com.alibaba.fastjson.support.geo.Point;
import junit.framework.TestCase;
public class MultiPointTest extends TestCase {
public void test_geo() throws Exception {
String str = "{\n" +
Reported by PMD.
src/test/java/com/alibaba/json/bvt/geo/MultiPolygonTest.java
7 issues
Line: 11
public class MultiPolygonTest
extends TestCase {
public void test_geo() throws Exception {
String str = "{\n" +
" \"type\": \"MultiPolygon\",\n" +
" \"coordinates\": [\n" +
" [\n" +
" [\n" +
Reported by PMD.
Line: 11
public class MultiPolygonTest
extends TestCase {
public void test_geo() throws Exception {
String str = "{\n" +
" \"type\": \"MultiPolygon\",\n" +
" \"coordinates\": [\n" +
" [\n" +
" [\n" +
Reported by PMD.
Line: 44
"}";
Geometry geometry = JSON.parseObject(str, Geometry.class);
assertEquals(MultiPolygon.class, geometry.getClass());
assertEquals(
"{\"type\":\"MultiPolygon\",\"coordinates\":[[[[102.0,2.0],[103.0,2.0],[103.0,3.0],[102.0,3.0],[102.0,2.0]]],[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]],[[100.2,0.2],[100.2,0.8],[100.8,0.8],[100.8,0.2],[100.2,0.2]]]]}"
, JSON.toJSONString(geometry));
Reported by PMD.
Line: 44
"}";
Geometry geometry = JSON.parseObject(str, Geometry.class);
assertEquals(MultiPolygon.class, geometry.getClass());
assertEquals(
"{\"type\":\"MultiPolygon\",\"coordinates\":[[[[102.0,2.0],[103.0,2.0],[103.0,3.0],[102.0,3.0],[102.0,2.0]]],[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]],[[100.2,0.2],[100.2,0.8],[100.8,0.8],[100.8,0.2],[100.2,0.2]]]]}"
, JSON.toJSONString(geometry));
Reported by PMD.
Line: 46
Geometry geometry = JSON.parseObject(str, Geometry.class);
assertEquals(MultiPolygon.class, geometry.getClass());
assertEquals(
"{\"type\":\"MultiPolygon\",\"coordinates\":[[[[102.0,2.0],[103.0,2.0],[103.0,3.0],[102.0,3.0],[102.0,2.0]]],[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]],[[100.2,0.2],[100.2,0.8],[100.8,0.8],[100.8,0.2],[100.2,0.2]]]]}"
, JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
Reported by PMD.
Line: 51
, JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
}
}
Reported by PMD.
Line: 5
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.support.geo.Geometry;
import com.alibaba.fastjson.support.geo.MultiPoint;
import com.alibaba.fastjson.support.geo.MultiPolygon;
import junit.framework.TestCase;
public class MultiPolygonTest
extends TestCase {
Reported by PMD.
src/test/java/com/alibaba/json/bvt/geo/PointTest.java
7 issues
Line: 11
public class PointTest
extends TestCase {
public void test_geo() throws Exception {
String str = "{\n" +
" \"type\": \"Point\",\n" +
" \"coordinates\": [100.0, 0.0]\n" +
"}";
Reported by PMD.
Line: 11
public class PointTest
extends TestCase {
public void test_geo() throws Exception {
String str = "{\n" +
" \"type\": \"Point\",\n" +
" \"coordinates\": [100.0, 0.0]\n" +
"}";
Reported by PMD.
Line: 18
"}";
Geometry geometry = JSON.parseObject(str, Geometry.class);
assertEquals(Point.class, geometry.getClass());
assertEquals("{\"type\":\"Point\",\"coordinates\":[100.0,0.0]}", JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
Reported by PMD.
Line: 18
"}";
Geometry geometry = JSON.parseObject(str, Geometry.class);
assertEquals(Point.class, geometry.getClass());
assertEquals("{\"type\":\"Point\",\"coordinates\":[100.0,0.0]}", JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
Reported by PMD.
Line: 20
Geometry geometry = JSON.parseObject(str, Geometry.class);
assertEquals(Point.class, geometry.getClass());
assertEquals("{\"type\":\"Point\",\"coordinates\":[100.0,0.0]}", JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
}
}
Reported by PMD.
Line: 23
assertEquals("{\"type\":\"Point\",\"coordinates\":[100.0,0.0]}", JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
}
}
Reported by PMD.
Line: 5
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.support.geo.Geometry;
import com.alibaba.fastjson.support.geo.LineString;
import com.alibaba.fastjson.support.geo.Point;
import junit.framework.TestCase;
public class PointTest
extends TestCase {
Reported by PMD.
src/test/java/com/alibaba/json/bvt/geo/PolygonTest.java
7 issues
Line: 11
public class PolygonTest
extends TestCase {
public void test_geo() throws Exception {
String str = "{\n" +
" \"type\": \"Polygon\",\n" +
" \"coordinates\": [\n" +
" [\n" +
" [100.0, 0.0],\n" +
Reported by PMD.
Line: 11
public class PolygonTest
extends TestCase {
public void test_geo() throws Exception {
String str = "{\n" +
" \"type\": \"Polygon\",\n" +
" \"coordinates\": [\n" +
" [\n" +
" [100.0, 0.0],\n" +
Reported by PMD.
Line: 33
"}";
Geometry geometry = JSON.parseObject(str, Geometry.class);
assertEquals(Polygon.class, geometry.getClass());
assertEquals("{\"type\":\"Polygon\",\"coordinates\":[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]],[[100.8,0.8],[100.8,0.2],[100.2,0.2],[100.2,0.8],[100.8,0.8]]]}", JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
Reported by PMD.
Line: 33
"}";
Geometry geometry = JSON.parseObject(str, Geometry.class);
assertEquals(Polygon.class, geometry.getClass());
assertEquals("{\"type\":\"Polygon\",\"coordinates\":[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]],[[100.8,0.8],[100.8,0.2],[100.2,0.2],[100.2,0.8],[100.8,0.8]]]}", JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
Reported by PMD.
Line: 35
Geometry geometry = JSON.parseObject(str, Geometry.class);
assertEquals(Polygon.class, geometry.getClass());
assertEquals("{\"type\":\"Polygon\",\"coordinates\":[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]],[[100.8,0.8],[100.8,0.2],[100.2,0.2],[100.2,0.8],[100.8,0.8]]]}", JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
}
}
Reported by PMD.
Line: 38
assertEquals("{\"type\":\"Polygon\",\"coordinates\":[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]],[[100.8,0.8],[100.8,0.2],[100.2,0.2],[100.2,0.8],[100.8,0.8]]]}", JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
}
}
Reported by PMD.
Line: 5
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.support.geo.Geometry;
import com.alibaba.fastjson.support.geo.Point;
import com.alibaba.fastjson.support.geo.Polygon;
import junit.framework.TestCase;
public class PolygonTest
extends TestCase {
Reported by PMD.