Skip to content

Commit

Permalink
Stolstov/update jackson (#158)
Browse files Browse the repository at this point in the history
* fixed some errors in javadoc and updated jol to 0.9

* updated jackson to 2.9.4

* remove jars from DepFiles
  • Loading branch information
stolstov authored Mar 5, 2018
1 parent 1adecb8 commit 9ba95a6
Show file tree
Hide file tree
Showing 23 changed files with 342 additions and 289 deletions.
Binary file removed DepFiles/public/jackson-core-2.6.2.jar
Binary file not shown.
Binary file removed DepFiles/unittest/junit-4.12.jar
Binary file not shown.
8 changes: 6 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@
<property name="dir.result" value="results" />
<property name="dir.root" value="." />
<property name="file.jarname" value="esri-geometry-api.jar" />
<property name="jackson.version" value="2.6.2" />
<property name="jackson.version" value="2.9.4" />
<property name="jol.version" value="0.9" />
<property name="hamcrest.version" value="1.3" />

<path id="project.classpath">
<pathelement location="${dir.depfiles}/public/jackson-core-${jackson.version}.jar" />
<pathelement location="${dir.depfiles}/public/jackson-core-${jackson.version}.jar" />
<pathelement location="${dir.depfiles}/unittest/jol-core-${jol.version}.jar" />
<pathelement location="${dir.depfiles}/unittest/hamcrest-core-${hamcrest.version}.jar" />
<pathelement location="${dir.depfiles}/unittest/junit-4.12.jar" />
<pathelement location="${dir.build}" />
</path>
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@
<java.target.version>1.6</java.target.version>

<!-- dependency versions -->
<jackson.version>2.6.5</jackson.version>
<jackson.version>2.9.4</jackson.version>
<junit.version>4.12</junit.version>
<jol.version>0.2</jol.version>
<jol.version>0.9</jol.version>

<!-- plugin versions -->
<compiler.plugin.version>2.3.1</compiler.plugin.version>
Expand All @@ -115,14 +115,14 @@
<version>${jackson.version}</version>
<optional>false</optional>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>org.openjdk.jol</groupId>
<artifactId>jol-core</artifactId>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/esri/core/geometry/CombineOperator.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public interface CombineOperator {
* Operation on two geometries, returning a third. Examples include
* Intersection, Difference, and so forth.
*
* @param geom1 and geom2 are the geometry instances to be operated on.
* @param geom1 is the geometry instance to be operated on.
* @param geom2 is the geometry instance to be operated on.
* @param sr The spatial reference to get the tolerance value from.
* When sr is null, the tolerance is calculated from the input geometries.
* @param progressTracker ProgressTracker instance that is used to cancel the lengthy operation. Can be null.
Expand Down
46 changes: 23 additions & 23 deletions src/main/java/com/esri/core/geometry/Envelope.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 1995-2015 Esri
Copyright 1995-2018 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -1118,28 +1118,28 @@ public void setYMax(double y) {
m_envelope.ymax = y;
}

@Override
public Geometry getBoundary() {
return Boundary.calculate(this, null);
}
@Override
public void replaceNaNs(int semantics, double value) {
addAttribute(semantics);
if (isEmpty())
return;
int ncomps = VertexDescription.getComponentCount(semantics);
for (int i = 0; i < ncomps; i++) {
Envelope1D interval = queryInterval(semantics, i);
if (interval.isEmpty()) {
interval.vmin = value;
interval.vmax = value;
setInterval(semantics, i, interval);
}
}
}
@Override
public Geometry getBoundary() {
return Boundary.calculate(this, null);
}

@Override
public void replaceNaNs(int semantics, double value) {
addAttribute(semantics);
if (isEmpty())
return;

int ncomps = VertexDescription.getComponentCount(semantics);
for (int i = 0; i < ncomps; i++) {
Envelope1D interval = queryInterval(semantics, i);
if (interval.isEmpty()) {
interval.vmin = value;
interval.vmax = value;
setInterval(semantics, i, interval);
}
}
}

/**
* The output of this method can be only used for debugging. It is subject to change without notice.
*/
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/esri/core/geometry/Envelope1D.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,10 @@ public boolean contains(double v) {
/**
* Returns True if the envelope contains the other envelope (boundary
* inclusive). Note: Will return false if either envelope is empty.
* @param other The other envelope.
* @return Return true if this contains the other.
*/
public boolean contains(/* const */Envelope1D other) /* const */
public boolean contains(Envelope1D other)
{
return other.vmin >= vmin && other.vmax <= vmax;
}
Expand Down
42 changes: 38 additions & 4 deletions src/main/java/com/esri/core/geometry/Envelope2D.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 1995-2015 Esri
Copyright 1995-2018 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -131,6 +131,7 @@ public Envelope2D getInflated(double dx, double dy) {
/**
* Sets the envelope from the array of points. The envelope will be set to
* empty if the array is null.
* @param points The points to set the envelope from. No element in the array can be null.
*/
public void setFromPoints(Point2D[] points) {
if (points == null || points.length == 0) {
Expand Down Expand Up @@ -198,6 +199,8 @@ else if (ymax < y)
/**
* Merges a point with this envelope without checking if the envelope is
* empty. Use with care.
* @param x The x coord of the point
* @param y the y coord in the point
*/
public void mergeNE(double x, double y) {
if (xmin > x)
Expand Down Expand Up @@ -258,6 +261,7 @@ public void zoom(double factorX, double factorY) {

/**
* Checks if this envelope intersects the other.
* @param other The other envelope.
* @return True if this envelope intersects the other.
*/
public boolean isIntersecting(Envelope2D other) {
Expand All @@ -274,6 +278,7 @@ public boolean isIntersecting(Envelope2D other) {

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

/**
* Checks if this envelope intersects the other.
* @param xmin_
* @param ymin_
* @param xmax_
* @param ymax_
* @return True if this envelope intersects the other.
*/
public boolean isIntersecting(double xmin_, double ymin_, double xmax_, double ymax_) {
Expand All @@ -307,7 +316,7 @@ public boolean isIntersecting(double xmin_, double ymin_, double xmax_, double y
/**
* Intersects this envelope with the other and stores result in this
* envelope.
*
* @param other The other envelope.
* @return True if this envelope intersects the other, otherwise sets this
* envelope to empty state and returns False.
*/
Expand Down Expand Up @@ -370,6 +379,7 @@ public Point2D queryCorner(int index) {
/**
* Queries corners into a given array. The array length must be at least
* 4. Starts from the lower left corner and goes clockwise.
* @param corners The array of four points.
*/
public void queryCorners(Point2D[] corners) {
if ((corners == null) || (corners.length < 4))
Expand Down Expand Up @@ -399,6 +409,7 @@ public void queryCorners(Point2D[] corners) {
* Queries corners into a given array in reversed order. The array length
* must be at least 4. Starts from the lower left corner and goes
* counterclockwise.
* @param corners The array of four points.
*/
public void queryCornersReversed(Point2D[] corners) {
if (corners == null || ((corners != null) && (corners.length < 4)))
Expand Down Expand Up @@ -500,6 +511,8 @@ public double getHeight() {

/**
* Moves the Envelope by given distance.
* @param dx
* @param dy
*/
public void move(double dx, double dy) {
if (isEmpty())
Expand Down Expand Up @@ -558,6 +571,7 @@ public void queryUpperRight(Point2D pt) {
/**
* Returns True if this envelope is valid (empty, or has xmin less or equal
* to xmax, or ymin less or equal to ymax).
* @return True if the envelope is valid.
*/
public boolean isValid() {
return isEmpty() || (xmin <= xmax && ymin <= ymax);
Expand Down Expand Up @@ -621,6 +635,8 @@ public boolean contains(double x, double y) {
/**
* Returns True if the envelope contains the other envelope (boundary
* inclusive).
* @param other The other envelope.
* @return True if this contains the other.
*/
public boolean contains(Envelope2D other) {// Note: Will return False, if
// either envelope is empty.
Expand All @@ -630,7 +646,10 @@ public boolean contains(Envelope2D other) {// Note: Will return False, if

/**
* Returns True if the envelope contains the point (boundary exclusive).
*/
* @param x
* @param y
* @return True if this contains the point.
* */
public boolean containsExclusive(double x, double y) {
// Note: This will return False, if envelope is empty, thus no need to
// call is_empty().
Expand All @@ -647,6 +666,8 @@ public boolean containsExclusive(Point2D pt) {
/**
* Returns True if the envelope contains the other envelope (boundary
* exclusive).
* @param other The other envelope
* @return True if this contains the other, boundary exclusive.
*/
boolean containsExclusive(Envelope2D other) {
// Note: This will return False, if either envelope is empty, thus no
Expand Down Expand Up @@ -1075,15 +1096,19 @@ public boolean isPointOnBoundary(Point2D pt, double tolerance) {
/**
* Calculates minimum distance from this envelope to the other.
* Returns 0 for empty envelopes.
* @param other The other envelope.
* @return Returns the distance
*/
public double distance(/* const */Envelope2D other)
public double distance(Envelope2D other)
{
return Math.sqrt(sqrDistance(other));
}

/**
* Calculates minimum distance from this envelope to the point.
* Returns 0 for empty envelopes.
* @param pt2D The other point.
* @return Returns the distance
*/
public double distance(Point2D pt2D)
{
Expand All @@ -1093,6 +1118,8 @@ public double distance(Point2D pt2D)
/**
* Calculates minimum squared distance from this envelope to the other.
* Returns 0 for empty envelopes.
* @param other The other envelope.
* @return Returns the squared distance
*/
public double sqrDistance(Envelope2D other)
{
Expand Down Expand Up @@ -1122,6 +1149,11 @@ public double sqrDistance(Envelope2D other)
/**
* Calculates minimum squared distance from this envelope to the other.
* Returns 0 for empty envelopes.
* @param xmin_
* @param ymin_
* @param xmax_
* @param ymax_
* @return Returns the squared distance.
*/
public double sqrDistance(double xmin_, double ymin_, double xmax_, double ymax_)
{
Expand Down Expand Up @@ -1178,6 +1210,8 @@ public double sqrMaxDistance(Envelope2D other) {
/**
* Calculates minimum squared distance from this envelope to the point.
* Returns 0 for empty envelopes.
* @param pt2D The point.
* @return Returns the squared distance
*/
public double sqrDistance(Point2D pt2D)
{
Expand Down
Loading

0 comments on commit 9ba95a6

Please sign in to comment.