From b8390005722dd1cdb24d762797ef3f98ebc37755 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 6 Jul 2024 17:46:17 -0700 Subject: Update instanceof expressions --- src/main/java/org/traccar/notification/PropertiesProvider.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/org/traccar/notification') diff --git a/src/main/java/org/traccar/notification/PropertiesProvider.java b/src/main/java/org/traccar/notification/PropertiesProvider.java index 91887b5d4..5178b9a9e 100644 --- a/src/main/java/org/traccar/notification/PropertiesProvider.java +++ b/src/main/java/org/traccar/notification/PropertiesProvider.java @@ -48,7 +48,7 @@ public class PropertiesProvider { } else { Object result = extendedModel.getAttributes().get(key.getKey()); if (result != null) { - return result instanceof String ? Integer.parseInt((String) result) : (Integer) result; + return result instanceof String stringResult ? Integer.parseInt(stringResult) : (Integer) result; } else { return key.getDefaultValue(); } @@ -65,7 +65,7 @@ public class PropertiesProvider { } else { Object result = extendedModel.getAttributes().get(key.getKey()); if (result != null) { - return result instanceof String ? Boolean.valueOf((String) result) : (Boolean) result; + return result instanceof String stringResult ? Boolean.valueOf(stringResult) : (Boolean) result; } else { return null; } -- cgit v1.2.3