Skip to content
Browse files

Do not use TreeSet for sets of nullable values, JDK 7 won't allow nul…

…l values in it. Switched to hashset (no actual ordering was needed)
  • Loading branch information...
1 parent 43e8026 commit 07d51066082b0174e714ea43380cf4f57ebb429e @aaime aaime committed Oct 27, 2012
View
4 ...les/unsupported/geometry/src/main/java/org/geotools/geometry/iso/complex/ComplexImpl.java
@@ -19,7 +19,7 @@
import java.util.Collection;
import java.util.List;
import java.util.Set;
-import java.util.TreeSet;
+import java.util.HashSet;
import org.geotools.geometry.iso.primitive.PrimitiveImpl;
import org.geotools.geometry.iso.root.GeometryImpl;
@@ -221,7 +221,7 @@ protected void addSuperComplex(ComplexImpl superComplex1) {
* @see org.opengis.geometry.coordinate.root.Geometry#getMaximalComplex()
*/
public Set<Complex> getMaximalComplex() {
- TreeSet<Complex> result = new TreeSet<Complex>();
+ HashSet<Complex> result = new HashSet<Complex>();
if (this.isMaximal()) {
result.add(this);
} else {
View
4 ...upported/geometry/src/main/java/org/geotools/geometry/iso/complex/CompositeCurveImpl.java
@@ -17,10 +17,10 @@
package org.geotools.geometry.iso.complex;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
-import java.util.TreeSet;
import org.geotools.geometry.iso.coordinate.DirectPositionImpl;
import org.geotools.geometry.iso.coordinate.EnvelopeImpl;
@@ -135,7 +135,7 @@ private void checkConsistency() {
if (generator == null)
throw new IllegalArgumentException(
"Could not create the boundary of CompositeCurve."); //$NON-NLS-1$
- TreeSet<Complex> result = new TreeSet<Complex>();
+ HashSet<Complex> result = new HashSet<Complex>();
result.add( new CurveBoundaryImpl( getCoordinateReferenceSystem(),
new PointImpl( ((CurveImpl) generator
.get(0)).getStartPoint()), new PointImpl( ((CurveImpl) generator
View
11 ...unsupported/geometry/src/main/java/org/geotools/geometry/iso/primitive/PrimitiveImpl.java
@@ -16,8 +16,9 @@
*/
package org.geotools.geometry.iso.primitive;
+import java.util.HashSet;
import java.util.Set;
-import java.util.TreeSet;
+import java.util.HashSet;
import org.geotools.geometry.iso.complex.ComplexImpl;
import org.geotools.geometry.iso.root.GeometryImpl;
@@ -173,7 +174,7 @@ public Composite getComposite() {
*/
public void addContainingPrimitive(PrimitiveImpl newSubelement) {
if (this.containingPrimitive == null)
- this.containingPrimitive = new TreeSet<Primitive>();
+ this.containingPrimitive = new HashSet<Primitive>();
this.containingPrimitive.add(newSubelement);
}
@@ -184,7 +185,7 @@ public void addContainingPrimitive(PrimitiveImpl newSubelement) {
*/
public void addContainedPrimitive(PrimitiveImpl newSuperelement) {
if (this.containedPrimitive == null)
- this.containedPrimitive = new TreeSet<Primitive>();
+ this.containedPrimitive = new HashSet<Primitive>();
this.containedPrimitive.add(newSuperelement);
}
@@ -195,7 +196,7 @@ public void addContainedPrimitive(PrimitiveImpl newSuperelement) {
*/
public void addComplex(ComplexImpl newComplex) {
if (this.complex == null)
- this.complex = new TreeSet<Complex>();
+ this.complex = new HashSet<Complex>();
this.complex.add(newComplex);
}
@@ -230,7 +231,7 @@ public void addComplex(ComplexImpl newComplex) {
public Set<Complex> getMaximalComplex() {
if (this.complex == null)
return null;
- TreeSet<Complex> result = new TreeSet<Complex>();
+ HashSet<Complex> result = new HashSet<Complex>();
for (Complex c : this.complex) {
result.addAll(c.getMaximalComplex());
}
View
2 ...pported/geometry/src/main/java/org/geotools/geometry/iso/util/algorithm2D/ConvexHull.java
@@ -307,7 +307,7 @@ public Geometry getConvexHull() {
// System.out.println(ring);
// add points defining polygon
- TreeSet reducedSet = new TreeSet();
+ HashSet reducedSet = new HashSet();
for (int i = 0; i < polyPts.length; i++) {
reducedSet.add(polyPts[i]);
}

0 comments on commit 07d5106

Please sign in to comment.
Something went wrong with that request. Please try again.