aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRenaud Allard <renaud@allard.it>2016-10-17 23:30:07 +0200
committerRenaud Allard <renaud@allard.it>2016-10-17 23:30:07 +0200
commit4b47a62d2dc0dd7f1b7ced01a7e6c7887e3840ad (patch)
tree6764170732e34cbf6e1df053fe88d5b693c740e9
parentc08b6292ecb1b16d195f0c62918dbfd2a926f3b2 (diff)
downloadtrackermap-server-4b47a62d2dc0dd7f1b7ced01a7e6c7887e3840ad.tar.gz
trackermap-server-4b47a62d2dc0dd7f1b7ced01a7e6c7887e3840ad.tar.bz2
trackermap-server-4b47a62d2dc0dd7f1b7ced01a7e6c7887e3840ad.zip
Do not double check the filter results
Some cleaning in the logic
-rw-r--r--src/org/traccar/FilterHandler.java23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/org/traccar/FilterHandler.java b/src/org/traccar/FilterHandler.java
index 8acc06935..62df83378 100644
--- a/src/org/traccar/FilterHandler.java
+++ b/src/org/traccar/FilterHandler.java
@@ -150,36 +150,33 @@ public class FilterHandler extends BaseDataHandler {
private boolean filter(Position p) {
+ boolean result = false;
String filterType = "";
- boolean result = filterInvalid(p) || filterZero(p) || filterDuplicate(p)
- || filterFuture(p) || filterApproximate(p) || filterStatic(p)
- || filterDistance(p);
-
if (filterInvalid(p)) {
- filterType = "Invalid ";
+ filterType = filterType + "Invalid ";
}
if (filterZero(p)) {
- filterType = (filterType + "Zero ");
+ filterType = filterType + "Zero ";
}
if (filterDuplicate(p)) {
- filterType = (filterType + "Duplicate ");
+ filterType = filterType + "Duplicate ";
}
if (filterFuture(p)) {
- filterType = (filterType + "Future ");
+ filterType = filterType + "Future ";
}
if (filterApproximate(p)) {
- filterType = (filterType + "Approximate ");
+ filterType = filterType + "Approximate ";
}
if (filterStatic(p)) {
- filterType = (filterType + "Static ");
+ filterType = filterType + "Static ";
}
if (filterDistance(p)) {
- filterType = (filterType + "Distance ");
+ filterType = filterType + "Distance ";
}
- if (filterLimit(p)) {
- result = false;
+ if (!"".equals(filterType) && !filterLimit(p)) {
+ result = true;
}
if (result) {