From c49370a99c5e1ae0c944e45936d289c7303aed92 Mon Sep 17 00:00:00 2001 From: burdziak Date: Thu, 25 Jan 2018 14:18:47 +0100 Subject: Fixes in ScheduledPublishingPolicyImpl Change-Id: I2055da6942f0487ed543df260ee541632cff6f5e Issue-ID: APPC-515 Signed-off-by: burdziak --- .../policy/impl/ScheduledPublishingPolicyImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/appc-metric/appc-metric-bundle/src/main/java/org/onap/appc/metricservice/policy/impl/ScheduledPublishingPolicyImpl.java b/appc-metric/appc-metric-bundle/src/main/java/org/onap/appc/metricservice/policy/impl/ScheduledPublishingPolicyImpl.java index 8933150f3..84bc011a2 100644 --- a/appc-metric/appc-metric-bundle/src/main/java/org/onap/appc/metricservice/policy/impl/ScheduledPublishingPolicyImpl.java +++ b/appc-metric/appc-metric-bundle/src/main/java/org/onap/appc/metricservice/policy/impl/ScheduledPublishingPolicyImpl.java @@ -77,7 +77,7 @@ public class ScheduledPublishingPolicyImpl implements ScheduledPublishingPolicy }else if(properties.getProperty("schedule.policy.metric.period")==null && properties.getProperty("schedule.policy.metric.start.time")!=null){ this.startTime=getConfigStartTime("00:00:00",properties); - this.period=(24*60*60*1000)-1; + this.period=(24*60*60*1000l)-1; logger.info("Metric Properties read from configuration Start Time :"+this.startTime+", Period :"+this.period); }else{ @@ -101,7 +101,7 @@ public class ScheduledPublishingPolicyImpl implements ScheduledPublishingPolicy private long getConfigPeriod(Properties properties) { String period=properties.getProperty("schedule.policy.metric.period"); logger.info("Metric period : " +period); - long periodInMs=Integer.parseInt(period)*1000; + long periodInMs=Integer.parseInt(period)*1000l; logger.info("Metric period in long : " +periodInMs); return periodInMs; } @@ -109,9 +109,9 @@ public class ScheduledPublishingPolicyImpl implements ScheduledPublishingPolicy private long getTimeInMs(String time) { String[] strings=time.split(":"); if(strings.length==3) { - long hour = Integer.parseInt(strings[0]) * 60 * 60 * 1000; - long min = Integer.parseInt(strings[1]) * 60 * 1000; - long sec = Integer.parseInt(strings[2]) * 1000; + long hour = Integer.parseInt(strings[0]) * 60 * 60 * 1000l; + long min = Integer.parseInt(strings[1]) * 60 * 1000l; + long sec = Integer.parseInt(strings[2]) * 1000l; return hour+min+sec; }else{ return 0; -- cgit 1.2.3-korg