From: burdziak Date: Thu, 25 Jan 2018 13:18:47 +0000 (+0100) Subject: Fixes in ScheduledPublishingPolicyImpl X-Git-Tag: v1.3.0~380 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F69%2F29169%2F2;p=appc.git Fixes in ScheduledPublishingPolicyImpl Change-Id: I2055da6942f0487ed543df260ee541632cff6f5e Issue-ID: APPC-515 Signed-off-by: burdziak --- 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;