Skip to content

Commit 9ba95a6

Browse files
authored
Stolstov/update jackson (#158)
* fixed some errors in javadoc and updated jol to 0.9 * updated jackson to 2.9.4 * remove jars from DepFiles
1 parent 1adecb8 commit 9ba95a6

23 files changed

+342
-289
lines changed
-253 KB
Binary file not shown.

DepFiles/unittest/junit-4.12.jar

-308 KB
Binary file not shown.

build.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@
1414
<property name="dir.result" value="results" />
1515
<property name="dir.root" value="." />
1616
<property name="file.jarname" value="esri-geometry-api.jar" />
17-
<property name="jackson.version" value="2.6.2" />
17+
<property name="jackson.version" value="2.9.4" />
18+
<property name="jol.version" value="0.9" />
19+
<property name="hamcrest.version" value="1.3" />
1820

1921
<path id="project.classpath">
20-
<pathelement location="${dir.depfiles}/public/jackson-core-${jackson.version}.jar" />
22+
<pathelement location="${dir.depfiles}/public/jackson-core-${jackson.version}.jar" />
23+
<pathelement location="${dir.depfiles}/unittest/jol-core-${jol.version}.jar" />
24+
<pathelement location="${dir.depfiles}/unittest/hamcrest-core-${hamcrest.version}.jar" />
2125
<pathelement location="${dir.depfiles}/unittest/junit-4.12.jar" />
2226
<pathelement location="${dir.build}" />
2327
</path>

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@
9898
<java.target.version>1.6</java.target.version>
9999

100100
<!-- dependency versions -->
101-
<jackson.version>2.6.5</jackson.version>
101+
<jackson.version>2.9.4</jackson.version>
102102
<junit.version>4.12</junit.version>
103-
<jol.version>0.2</jol.version>
103+
<jol.version>0.9</jol.version>
104104

105105
<!-- plugin versions -->
106106
<compiler.plugin.version>2.3.1</compiler.plugin.version>
@@ -115,14 +115,14 @@
115115
<version>${jackson.version}</version>
116116
<optional>false</optional>
117117
</dependency>
118+
119+
<!-- Test dependencies -->
118120
<dependency>
119121
<groupId>junit</groupId>
120122
<artifactId>junit</artifactId>
121123
<version>${junit.version}</version>
122124
<scope>test</scope>
123125
</dependency>
124-
125-
<!-- Test dependencies -->
126126
<dependency>
127127
<groupId>org.openjdk.jol</groupId>
128128
<artifactId>jol-core</artifactId>

src/main/java/com/esri/core/geometry/CombineOperator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public interface CombineOperator {
3636
* Operation on two geometries, returning a third. Examples include
3737
* Intersection, Difference, and so forth.
3838
*
39-
* @param geom1 and geom2 are the geometry instances to be operated on.
39+
* @param geom1 is the geometry instance to be operated on.
40+
* @param geom2 is the geometry instance to be operated on.
4041
* @param sr The spatial reference to get the tolerance value from.
4142
* When sr is null, the tolerance is calculated from the input geometries.
4243
* @param progressTracker ProgressTracker instance that is used to cancel the lengthy operation. Can be null.

src/main/java/com/esri/core/geometry/Envelope.java

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 1995-2015 Esri
2+
Copyright 1995-2018 Esri
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -1118,28 +1118,28 @@ public void setYMax(double y) {
11181118
m_envelope.ymax = y;
11191119
}
11201120

1121-
@Override
1122-
public Geometry getBoundary() {
1123-
return Boundary.calculate(this, null);
1124-
}
1125-
1126-
@Override
1127-
public void replaceNaNs(int semantics, double value) {
1128-
addAttribute(semantics);
1129-
if (isEmpty())
1130-
return;
1131-
1132-
int ncomps = VertexDescription.getComponentCount(semantics);
1133-
for (int i = 0; i < ncomps; i++) {
1134-
Envelope1D interval = queryInterval(semantics, i);
1135-
if (interval.isEmpty()) {
1136-
interval.vmin = value;
1137-
interval.vmax = value;
1138-
setInterval(semantics, i, interval);
1139-
}
1140-
}
1141-
}
1142-
1121+
@Override
1122+
public Geometry getBoundary() {
1123+
return Boundary.calculate(this, null);
1124+
}
1125+
1126+
@Override
1127+
public void replaceNaNs(int semantics, double value) {
1128+
addAttribute(semantics);
1129+
if (isEmpty())
1130+
return;
1131+
1132+
int ncomps = VertexDescription.getComponentCount(semantics);
1133+
for (int i = 0; i < ncomps; i++) {
1134+
Envelope1D interval = queryInterval(semantics, i);
1135+
if (interval.isEmpty()) {
1136+
interval.vmin = value;
1137+
interval.vmax = value;
1138+
setInterval(semantics, i, interval);
1139+
}
1140+
}
1141+
}
1142+
11431143
/**
11441144
* The output of this method can be only used for debugging. It is subject to change without notice.
11451145
*/

src/main/java/com/esri/core/geometry/Envelope1D.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,10 @@ public boolean contains(double v) {
133133
/**
134134
* Returns True if the envelope contains the other envelope (boundary
135135
* inclusive). Note: Will return false if either envelope is empty.
136+
* @param other The other envelope.
137+
* @return Return true if this contains the other.
136138
*/
137-
public boolean contains(/* const */Envelope1D other) /* const */
139+
public boolean contains(Envelope1D other)
138140
{
139141
return other.vmin >= vmin && other.vmax <= vmax;
140142
}

src/main/java/com/esri/core/geometry/Envelope2D.java

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 1995-2015 Esri
2+
Copyright 1995-2018 Esri
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -131,6 +131,7 @@ public Envelope2D getInflated(double dx, double dy) {
131131
/**
132132
* Sets the envelope from the array of points. The envelope will be set to
133133
* empty if the array is null.
134+
* @param points The points to set the envelope from. No element in the array can be null.
134135
*/
135136
public void setFromPoints(Point2D[] points) {
136137
if (points == null || points.length == 0) {
@@ -198,6 +199,8 @@ else if (ymax < y)
198199
/**
199200
* Merges a point with this envelope without checking if the envelope is
200201
* empty. Use with care.
202+
* @param x The x coord of the point
203+
* @param y the y coord in the point
201204
*/
202205
public void mergeNE(double x, double y) {
203206
if (xmin > x)
@@ -258,6 +261,7 @@ public void zoom(double factorX, double factorY) {
258261

259262
/**
260263
* Checks if this envelope intersects the other.
264+
* @param other The other envelope.
261265
* @return True if this envelope intersects the other.
262266
*/
263267
public boolean isIntersecting(Envelope2D other) {
@@ -274,6 +278,7 @@ public boolean isIntersecting(Envelope2D other) {
274278

275279
/**
276280
* Checks if this envelope intersects the other assuming neither one is empty.
281+
* @param other The other envelope.
277282
* @return True if this envelope intersects the other. Assumes this and
278283
* other envelopes are not empty.
279284
*/
@@ -289,6 +294,10 @@ public boolean isIntersectingNE(Envelope2D other) {
289294

290295
/**
291296
* Checks if this envelope intersects the other.
297+
* @param xmin_
298+
* @param ymin_
299+
* @param xmax_
300+
* @param ymax_
292301
* @return True if this envelope intersects the other.
293302
*/
294303
public boolean isIntersecting(double xmin_, double ymin_, double xmax_, double ymax_) {
@@ -307,7 +316,7 @@ public boolean isIntersecting(double xmin_, double ymin_, double xmax_, double y
307316
/**
308317
* Intersects this envelope with the other and stores result in this
309318
* envelope.
310-
*
319+
* @param other The other envelope.
311320
* @return True if this envelope intersects the other, otherwise sets this
312321
* envelope to empty state and returns False.
313322
*/
@@ -370,6 +379,7 @@ public Point2D queryCorner(int index) {
370379
/**
371380
* Queries corners into a given array. The array length must be at least
372381
* 4. Starts from the lower left corner and goes clockwise.
382+
* @param corners The array of four points.
373383
*/
374384
public void queryCorners(Point2D[] corners) {
375385
if ((corners == null) || (corners.length < 4))
@@ -399,6 +409,7 @@ public void queryCorners(Point2D[] corners) {
399409
* Queries corners into a given array in reversed order. The array length
400410
* must be at least 4. Starts from the lower left corner and goes
401411
* counterclockwise.
412+
* @param corners The array of four points.
402413
*/
403414
public void queryCornersReversed(Point2D[] corners) {
404415
if (corners == null || ((corners != null) && (corners.length < 4)))
@@ -500,6 +511,8 @@ public double getHeight() {
500511

501512
/**
502513
* Moves the Envelope by given distance.
514+
* @param dx
515+
* @param dy
503516
*/
504517
public void move(double dx, double dy) {
505518
if (isEmpty())
@@ -558,6 +571,7 @@ public void queryUpperRight(Point2D pt) {
558571
/**
559572
* Returns True if this envelope is valid (empty, or has xmin less or equal
560573
* to xmax, or ymin less or equal to ymax).
574+
* @return True if the envelope is valid.
561575
*/
562576
public boolean isValid() {
563577
return isEmpty() || (xmin <= xmax && ymin <= ymax);
@@ -621,6 +635,8 @@ public boolean contains(double x, double y) {
621635
/**
622636
* Returns True if the envelope contains the other envelope (boundary
623637
* inclusive).
638+
* @param other The other envelope.
639+
* @return True if this contains the other.
624640
*/
625641
public boolean contains(Envelope2D other) {// Note: Will return False, if
626642
// either envelope is empty.
@@ -630,7 +646,10 @@ public boolean contains(Envelope2D other) {// Note: Will return False, if
630646

631647
/**
632648
* Returns True if the envelope contains the point (boundary exclusive).
633-
*/
649+
* @param x
650+
* @param y
651+
* @return True if this contains the point.
652+
* */
634653
public boolean containsExclusive(double x, double y) {
635654
// Note: This will return False, if envelope is empty, thus no need to
636655
// call is_empty().
@@ -647,6 +666,8 @@ public boolean containsExclusive(Point2D pt) {
647666
/**
648667
* Returns True if the envelope contains the other envelope (boundary
649668
* exclusive).
669+
* @param other The other envelope
670+
* @return True if this contains the other, boundary exclusive.
650671
*/
651672
boolean containsExclusive(Envelope2D other) {
652673
// Note: This will return False, if either envelope is empty, thus no
@@ -1075,15 +1096,19 @@ public boolean isPointOnBoundary(Point2D pt, double tolerance) {
10751096
/**
10761097
* Calculates minimum distance from this envelope to the other.
10771098
* Returns 0 for empty envelopes.
1099+
* @param other The other envelope.
1100+
* @return Returns the distance
10781101
*/
1079-
public double distance(/* const */Envelope2D other)
1102+
public double distance(Envelope2D other)
10801103
{
10811104
return Math.sqrt(sqrDistance(other));
10821105
}
10831106

10841107
/**
10851108
* Calculates minimum distance from this envelope to the point.
10861109
* Returns 0 for empty envelopes.
1110+
* @param pt2D The other point.
1111+
* @return Returns the distance
10871112
*/
10881113
public double distance(Point2D pt2D)
10891114
{
@@ -1093,6 +1118,8 @@ public double distance(Point2D pt2D)
10931118
/**
10941119
* Calculates minimum squared distance from this envelope to the other.
10951120
* Returns 0 for empty envelopes.
1121+
* @param other The other envelope.
1122+
* @return Returns the squared distance
10961123
*/
10971124
public double sqrDistance(Envelope2D other)
10981125
{
@@ -1122,6 +1149,11 @@ public double sqrDistance(Envelope2D other)
11221149
/**
11231150
* Calculates minimum squared distance from this envelope to the other.
11241151
* Returns 0 for empty envelopes.
1152+
* @param xmin_
1153+
* @param ymin_
1154+
* @param xmax_
1155+
* @param ymax_
1156+
* @return Returns the squared distance.
11251157
*/
11261158
public double sqrDistance(double xmin_, double ymin_, double xmax_, double ymax_)
11271159
{
@@ -1178,6 +1210,8 @@ public double sqrMaxDistance(Envelope2D other) {
11781210
/**
11791211
* Calculates minimum squared distance from this envelope to the point.
11801212
* Returns 0 for empty envelopes.
1213+
* @param pt2D The point.
1214+
* @return Returns the squared distance
11811215
*/
11821216
public double sqrDistance(Point2D pt2D)
11831217
{

0 commit comments

Comments
 (0)