From 7b089c09caf5c112fe6f3f538ddc6902b79ce384 Mon Sep 17 00:00:00 2001 From: shrek2000 Date: Thu, 28 Nov 2019 10:59:30 +0200 Subject: Fix Sonar issues When arithmetic is performed on integers, the result will always be an integer. You can assign that result to a long, double, or float with automatic type conversion, but having started as an int or long, the result will likely not be what you expect. For instance, if the result of int division is assigned to a floating-point variable, precision will have been lost before the assignment. Likewise, if the result of multiplication is assigned to a long, it may have already overflowed before the assignment. In either case, the result will not be what was expected. Instead, at least one operand should be cast or promoted to the final type before the operation takes place. Issue-ID: SDC-2690 Signed-off-by: shrek2000 Change-Id: I3ef06e48b02a73753a824076d3a9de8b585f2917 --- .../src/main/java/org/onap/sdc/security/filters/SampleFilter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'security-util-lib/src/main/java/org/onap') diff --git a/security-util-lib/src/main/java/org/onap/sdc/security/filters/SampleFilter.java b/security-util-lib/src/main/java/org/onap/sdc/security/filters/SampleFilter.java index 853c40d..0578c1d 100644 --- a/security-util-lib/src/main/java/org/onap/sdc/security/filters/SampleFilter.java +++ b/security-util-lib/src/main/java/org/onap/sdc/security/filters/SampleFilter.java @@ -38,8 +38,8 @@ public class SampleFilter extends SessionValidationFilter { private static class Configuration implements ISessionValidationFilterConfiguration { private String securityKey = "AGLDdG4D04BKm2IxIWEr8o=="; - private long maxSessionTimeOut = 24*60*60*1000; - private long sessionIdleTimeOut = 60*60*1000; + private long maxSessionTimeOut = 24*60*60*1_000L; + private long sessionIdleTimeOut = 60*60*1_000L; private String redirectURL = "http://portal.api.simpledemo.onap.org:8989/ECOMPPORTAL/login.htm"; private List excludedUrls = new ArrayList<>(Arrays.asList("/config","/configmgr","/rest","/kibanaProxy","/healthcheck","/upload.*")); private String cookieName = "kuku"; -- cgit 1.2.3-korg