From ebb43a1d910595462b384e3d1bd6375672da5b84 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 3 Jul 2016 20:03:23 +1200 Subject: Implement geofence saving --- src/org/traccar/geofence/GeofencePolygon.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/org') diff --git a/src/org/traccar/geofence/GeofencePolygon.java b/src/org/traccar/geofence/GeofencePolygon.java index be5f971a5..4ce61a623 100644 --- a/src/org/traccar/geofence/GeofencePolygon.java +++ b/src/org/traccar/geofence/GeofencePolygon.java @@ -118,7 +118,7 @@ public class GeofencePolygon extends GeofenceGeometry { @Override public String toWkt() { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("POLYGON ("); for (Coordinate coordinate : coordinates) { buf.append(String.valueOf(coordinate.getLat())); @@ -132,7 +132,7 @@ public class GeofencePolygon extends GeofenceGeometry { @Override public void fromWkt(String wkt) throws ParseException { if (coordinates == null) { - coordinates = new ArrayList(); + coordinates = new ArrayList<>(); } else { coordinates.clear(); } @@ -141,7 +141,7 @@ public class GeofencePolygon extends GeofenceGeometry { throw new ParseException("Mismatch geometry type", 0); } String content = wkt.substring(wkt.indexOf("(") + 1, wkt.indexOf(")")); - if (content == null || content.equals("")) { + if (content.isEmpty()) { throw new ParseException("No content", 0); } String[] commaTokens = content.split(","); -- cgit v1.2.3