diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-01-25 20:24:40 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-01-26 08:41:45 +1300 |
commit | 0f87445428a831e0f0d3b69f6f07f2a60272f2fb (patch) | |
tree | 38d1a665f0f3c3328253dc4ad4509f1d682a19cb /src/org/traccar/api/resource | |
parent | 87bdccbe9843e38174ad345b8e474b1cded9f985 (diff) | |
download | trackermap-server-0f87445428a831e0f0d3b69f6f07f2a60272f2fb.tar.gz trackermap-server-0f87445428a831e0f0d3b69f6f07f2a60272f2fb.tar.bz2 trackermap-server-0f87445428a831e0f0d3b69f6f07f2a60272f2fb.zip |
Clean up unused imports
Diffstat (limited to 'src/org/traccar/api/resource')
-rw-r--r-- | src/org/traccar/api/resource/DeviceResource.java | 2 | ||||
-rw-r--r-- | src/org/traccar/api/resource/SessionResource.java | 11 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/org/traccar/api/resource/DeviceResource.java b/src/org/traccar/api/resource/DeviceResource.java index ddf8832ed..87927e45b 100644 --- a/src/org/traccar/api/resource/DeviceResource.java +++ b/src/org/traccar/api/resource/DeviceResource.java @@ -71,7 +71,7 @@ public class DeviceResource extends BaseObjectResource<Device> { result = deviceManager.getUserItems(userId); } } else { - result = new HashSet<Long>(); + result = new HashSet<>(); for (String uniqueId : uniqueIds) { Device device = deviceManager.getByUniqueId(uniqueId); Context.getPermissionsManager().checkDevice(getUserId(), device.getId()); diff --git a/src/org/traccar/api/resource/SessionResource.java b/src/org/traccar/api/resource/SessionResource.java index 3f7842626..2a0bd4364 100644 --- a/src/org/traccar/api/resource/SessionResource.java +++ b/src/org/traccar/api/resource/SessionResource.java @@ -61,15 +61,14 @@ public class SessionResource extends BaseResource { Cookie[] cookies = request.getCookies(); String email = null, password = null; if (cookies != null) { - for (int i = 0; i < cookies.length; i++) { - if (cookies[i].getName().equals(USER_COOKIE_KEY)) { + for (Cookie cookie : cookies) { + if (cookie.getName().equals(USER_COOKIE_KEY)) { byte[] emailBytes = DatatypeConverter.parseBase64Binary( - URLDecoder.decode(cookies[i].getValue(), StandardCharsets.US_ASCII.name())); + URLDecoder.decode(cookie.getValue(), StandardCharsets.US_ASCII.name())); email = new String(emailBytes, StandardCharsets.UTF_8); - } - if (cookies[i].getName().equals(PASS_COOKIE_KEY)) { + } else if (cookie.getName().equals(PASS_COOKIE_KEY)) { byte[] passwordBytes = DatatypeConverter.parseBase64Binary( - URLDecoder.decode(cookies[i].getValue(), StandardCharsets.US_ASCII.name())); + URLDecoder.decode(cookie.getValue(), StandardCharsets.US_ASCII.name())); password = new String(passwordBytes, StandardCharsets.UTF_8); } } |