RequestContext.java - sonar fixes 81/83881/2
authorDriptaroop Das <driptaroop.das@in.ibm.com>
Mon, 1 Apr 2019 17:27:27 +0000 (22:57 +0530)
committerJoss Armstrong <joss.armstrong@ericsson.com>
Wed, 3 Apr 2019 15:46:39 +0000 (15:46 +0000)
RequestContext.java - sonar fixes

Issue-ID: APPC-1564
Change-Id: I334c1f07403cf246efb3413639fdb26cc08556af
Signed-off-by: Driptaroop Das <driptaroop.das@in.ibm.com>
appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/impl/RequestContext.java

index 8c2833d..5cea9c0 100644 (file)
@@ -125,6 +125,7 @@ public class RequestContext {
                      * amount of delay time needed and reenter the sleep until we get to the future time.
                      */
                     time = future - System.currentTimeMillis();
+                    Thread.currentThread().interrupt();
                 }
             }
         }
@@ -193,7 +194,7 @@ public class RequestContext {
         }
         accumulatedTime += (now - startTime);
         startTime = now;
-        return !(accumulatedTime > timeToLive);
+        return accumulatedTime <= timeToLive;
     }
 
     /**