Fix WorkflowContext.getDelay() unit conversion 71/5271/1
authorGary Wu <gary.i.wu@huawei.com>
Tue, 9 May 2017 18:30:35 +0000 (11:30 -0700)
committerGary Wu <gary.i.wu@huawei.com>
Tue, 9 May 2017 18:30:35 +0000 (11:30 -0700)
The duration numbers in getDelay() are all
expressed in milliseconds; the call to
TimeUnit.convert() is fixed to specify milliseconds.

Change-Id: I6b466f7a40a05ebe4afb1c3c39fb862eef2ae40d
Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowContext.java

index 3d7e333..93aa15c 100644 (file)
@@ -72,7 +72,7 @@ public class WorkflowContext implements Delayed {
        @Override\r
        public long getDelay(TimeUnit unit) {\r
                // 0 or negative means this object is considered to be expired\r
-               return unit.convert(startTime + timeout - System.currentTimeMillis(), unit);\r
+               return unit.convert(startTime + timeout - System.currentTimeMillis(), TimeUnit.MILLISECONDS);\r
        }\r
 \r
        /**\r