aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-07-03 20:03:23 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-07-03 20:03:23 +1200
commitebb43a1d910595462b384e3d1bd6375672da5b84 (patch)
treec0cb06b37f1c9d3fb2260e7bd259a9141a4118f9 /src/org
parentdbb2e88db2c5af22172ea3642b27899b8164b40a (diff)
downloadtrackermap-server-ebb43a1d910595462b384e3d1bd6375672da5b84.tar.gz
trackermap-server-ebb43a1d910595462b384e3d1bd6375672da5b84.tar.bz2
trackermap-server-ebb43a1d910595462b384e3d1bd6375672da5b84.zip
Implement geofence saving
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/geofence/GeofencePolygon.java6
1 files changed, 3 insertions, 3 deletions
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<Coordinate>();
+ 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(",");