aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/geofence
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/geofence')
-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(",");