aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-08 15:08:33 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-08 15:08:33 +1300
commiteb4ee7a9d4d0f132546b164c3483d62eb9e9f0db (patch)
tree29bc56f0f67cd49bac31a50e415c614ed4b1c5dc /src/org/traccar/web
parent320d41863864485c5675c9bf8332ff0845e5e812 (diff)
downloadtrackermap-server-eb4ee7a9d4d0f132546b164c3483d62eb9e9f0db.tar.gz
trackermap-server-eb4ee7a9d4d0f132546b164c3483d62eb9e9f0db.tar.bz2
trackermap-server-eb4ee7a9d4d0f132546b164c3483d62eb9e9f0db.zip
Clean up reported PMD issues
Diffstat (limited to 'src/org/traccar/web')
-rw-r--r--src/org/traccar/web/AsyncServlet.java6
-rw-r--r--src/org/traccar/web/JsonConverter.java3
-rw-r--r--src/org/traccar/web/ServerServlet.java4
3 files changed, 7 insertions, 6 deletions
diff --git a/src/org/traccar/web/AsyncServlet.java b/src/org/traccar/web/AsyncServlet.java
index eaab7abe8..9d68c959c 100644
--- a/src/org/traccar/web/AsyncServlet.java
+++ b/src/org/traccar/web/AsyncServlet.java
@@ -124,10 +124,8 @@ public class AsyncServlet extends BaseServlet {
public void run(Timeout tmt) throws Exception {
synchronized (AsyncSession.this) {
logEvent("requestTimeout");
- if (!destroyed) {
- if (activeContext != null) {
- response();
- }
+ if (!destroyed && activeContext != null) {
+ response();
}
}
}
diff --git a/src/org/traccar/web/JsonConverter.java b/src/org/traccar/web/JsonConverter.java
index 6b52fac20..5dc879ab8 100644
--- a/src/org/traccar/web/JsonConverter.java
+++ b/src/org/traccar/web/JsonConverter.java
@@ -34,6 +34,7 @@ import javax.json.JsonValue;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;
+import org.traccar.helper.Log;
import org.traccar.model.Factory;
import org.traccar.model.MiscFormatter;
@@ -81,6 +82,7 @@ public class JsonConverter {
method.invoke(object, MiscFormatter.fromJson(json.getJsonObject(name)));
}
} catch (IllegalAccessException | InvocationTargetException error) {
+ Log.warning(error);
}
}
}
@@ -123,6 +125,7 @@ public class JsonConverter {
json.add(name, MiscFormatter.toJson((Map) method.invoke(object)));
}
} catch (IllegalAccessException | InvocationTargetException error) {
+ Log.warning(error);
}
}
}
diff --git a/src/org/traccar/web/ServerServlet.java b/src/org/traccar/web/ServerServlet.java
index e2305bba4..7ed096bc6 100644
--- a/src/org/traccar/web/ServerServlet.java
+++ b/src/org/traccar/web/ServerServlet.java
@@ -27,7 +27,7 @@ public class ServerServlet extends BaseServlet {
switch (command) {
case "/get":
- get(req, resp);
+ get(resp);
break;
case "/update":
update(req, resp);
@@ -38,7 +38,7 @@ public class ServerServlet extends BaseServlet {
return true;
}
- private void get(HttpServletRequest req, HttpServletResponse resp) throws Exception {
+ private void get(HttpServletResponse resp) throws Exception {
sendResponse(resp.getWriter(), JsonConverter.objectToJson(
Context.getDataManager().getServer()));
}