Skip to content

Commit

Permalink
fixed NullPointer exception in org.postgis.Geometry.equals()
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/postgis/trunk@2495 b70326c6-7e19-0410-871a-916f4a2858ee
  • Loading branch information
markusschaber committed Oct 2, 2006
1 parent f5eb225 commit 86170f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ PostGIS 1.1.5-CVS

- Java:
- Removed obsolete synchronization from Jts code.
- fixed nullpointer Exception in Geometry.equals() method

PostGIS 1.1.4

Expand Down
16 changes: 7 additions & 9 deletions java/jdbc/src/org/postgis/Geometry.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,13 @@ public boolean equals(Object other) {
* values
*/
public boolean equals(Geometry other) {
boolean firstline = (other != null) && (this.dimension == other.dimension)
&& (this.type == other.type);
boolean sridequals = (this.srid == other.srid);
boolean measEquals = (this.haveMeasure == other.haveMeasure);
boolean secondline = sridequals && measEquals;
boolean classequals = other.getClass().equals(this.getClass());
boolean equalsintern = this.equalsintern(other);
boolean result = firstline && secondline && classequals && equalsintern;
return result;
return (other != null)
&& (this.dimension == other.dimension)
&& (this.type == other.type)
&& (this.srid == other.srid)
&& (this.haveMeasure == other.haveMeasure)
&& other.getClass().equals(this.getClass())
&& this.equalsintern(other);
}

/**
Expand Down

0 comments on commit 86170f1

Please sign in to comment.