Sonar Fixes - ProviderStackOperation.java
[appc.git] / appc-adapters / appc-iaas-adapter / appc-iaas-adapter-bundle / src / main / java / org / onap / appc / adapter / iaas / provider / operation / impl / base / ProviderStackOperation.java
index 66b901a..687e24a 100644 (file)
@@ -5,6 +5,7 @@
  * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Copyright (C) 2017 Amdocs
+ * Modifications Copyright (C) 2019 IBM.
  * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -95,7 +96,9 @@ public abstract class ProviderStackOperation extends ProviderOperation {
         } else {
             try {
                 Thread.sleep(pollInterval * 1000);
-            } catch (InterruptedException ignored) {
+            } catch (InterruptedException ex) {
+                logger.trace(ex.getMessage(), ex);
+                Thread.currentThread().interrupt();
             }
         }
         return false;
@@ -181,7 +184,8 @@ public abstract class ProviderStackOperation extends ProviderOperation {
                 try {
                     Thread.sleep(pollInterval * 1000);
                 } catch (InterruptedException e) {
-                    logger.trace("Sleep threw interrupted exception, should never occur");
+                    logger.trace("Sleep threw interrupted exception, should never occur", e);
+                    Thread.currentThread().interrupt();
                 }
             }
         }