From 8756277141ff7549cb0a019e8f67bef58948bd59 Mon Sep 17 00:00:00 2001 From: Renaud Allard Date: Mon, 17 Oct 2016 23:42:17 +0200 Subject: Use StringBuilder for filter logging --- src/org/traccar/FilterHandler.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/org/traccar/FilterHandler.java b/src/org/traccar/FilterHandler.java index 62df83378..725f9c429 100644 --- a/src/org/traccar/FilterHandler.java +++ b/src/org/traccar/FilterHandler.java @@ -151,36 +151,36 @@ public class FilterHandler extends BaseDataHandler { private boolean filter(Position p) { boolean result = false; - String filterType = ""; + StringBuilder filterType = new StringBuilder(8 + 5 + 10 + 7 + 12 + 7 + 9); if (filterInvalid(p)) { - filterType = filterType + "Invalid "; + filterType.append("Invalid "); } if (filterZero(p)) { - filterType = filterType + "Zero "; + filterType.append("Zero "); } if (filterDuplicate(p)) { - filterType = filterType + "Duplicate "; + filterType.append("Duplicate "); } if (filterFuture(p)) { - filterType = filterType + "Future "; + filterType.append("Future "); } if (filterApproximate(p)) { - filterType = filterType + "Approximate "; + filterType.append("Approximate "); } if (filterStatic(p)) { - filterType = filterType + "Static "; + filterType.append("Static "); } if (filterDistance(p)) { - filterType = filterType + "Distance "; + filterType.append("Distance "); } - if (!"".equals(filterType) && !filterLimit(p)) { + if (!"".equals(filterType.toString()) && !filterLimit(p)) { result = true; } if (result) { - Log.info("Position filtered by " + filterType + "filters from " + p.getDeviceId()); + Log.info("Position filtered by " + filterType.toString() + "filters from " + p.getDeviceId()); } return result; -- cgit v1.2.3