aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/BaseProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/BaseProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/BaseProtocolDecoder.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/BaseProtocolDecoder.java b/src/main/java/org/traccar/BaseProtocolDecoder.java
index b764e5cdf..2f9c75ec2 100644
--- a/src/main/java/org/traccar/BaseProtocolDecoder.java
+++ b/src/main/java/org/traccar/BaseProtocolDecoder.java
@@ -168,8 +168,8 @@ public abstract class BaseProtocolDecoder extends ExtendedObjectDecoder {
}
Set<Long> deviceIds = new HashSet<>();
if (decodedMessage != null) {
- if (decodedMessage instanceof Position) {
- deviceIds.add(((Position) decodedMessage).getDeviceId());
+ if (decodedMessage instanceof Position position) {
+ deviceIds.add(position.getDeviceId());
} else if (decodedMessage instanceof Collection) {
Collection<Position> positions = (Collection) decodedMessage;
for (Position position : positions) {