From a1194798f406efe32cb33510f1a9d58b0b5f9bd9 Mon Sep 17 00:00:00 2001 From: "beili.zhou" Date: Tue, 29 Aug 2017 18:33:57 -0400 Subject: Remove catch throwable and error Fix the following sonar blocker issue: - Catch Exception instead of Throwable - Catch Exception instead of Error Issue-Id: APPC-175 Change-Id: I16a1018001b067216740ec11e5a97e52d714db69 Signed-off-by: beili.zhou --- .../src/main/java/org/openecomp/appc/oam/processor/BaseProcessor.java | 4 ++-- .../main/java/org/openecomp/appc/oam/processor/OamMmodeProcessor.java | 4 ++-- .../src/main/java/org/openecomp/appc/oam/util/AsyncTaskHelper.java | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'appc-oam') diff --git a/appc-oam/appc-oam-bundle/src/main/java/org/openecomp/appc/oam/processor/BaseProcessor.java b/appc-oam/appc-oam-bundle/src/main/java/org/openecomp/appc/oam/processor/BaseProcessor.java index c9ba0efa7..784beccc3 100644 --- a/appc-oam/appc-oam-bundle/src/main/java/org/openecomp/appc/oam/processor/BaseProcessor.java +++ b/appc-oam/appc-oam-bundle/src/main/java/org/openecomp/appc/oam/processor/BaseProcessor.java @@ -92,8 +92,8 @@ public abstract class BaseProcessor extends BaseCommon { preProcess(requestInput); timeoutSeconds = operationHelper.getParamRequestTimeout(requestInput); scheduleAsyncTask(); - } catch (Throwable t) { - setErrorStatus(t); + } catch (Exception e) { + setErrorStatus(e); } finally { postProcess(); } diff --git a/appc-oam/appc-oam-bundle/src/main/java/org/openecomp/appc/oam/processor/OamMmodeProcessor.java b/appc-oam/appc-oam-bundle/src/main/java/org/openecomp/appc/oam/processor/OamMmodeProcessor.java index d0d946aed..973d0af36 100644 --- a/appc-oam/appc-oam-bundle/src/main/java/org/openecomp/appc/oam/processor/OamMmodeProcessor.java +++ b/appc-oam/appc-oam-bundle/src/main/java/org/openecomp/appc/oam/processor/OamMmodeProcessor.java @@ -129,8 +129,8 @@ public class OamMmodeProcessor extends BaseProcessor { } setStatus(OAMCommandStatus.SUCCESS); - } catch (Throwable t) { - setErrorStatus(t); + } catch (Exception e) { + setErrorStatus(e); hasError = true; } diff --git a/appc-oam/appc-oam-bundle/src/main/java/org/openecomp/appc/oam/util/AsyncTaskHelper.java b/appc-oam/appc-oam-bundle/src/main/java/org/openecomp/appc/oam/util/AsyncTaskHelper.java index 25467da04..db6033752 100644 --- a/appc-oam/appc-oam-bundle/src/main/java/org/openecomp/appc/oam/util/AsyncTaskHelper.java +++ b/appc-oam/appc-oam-bundle/src/main/java/org/openecomp/appc/oam/util/AsyncTaskHelper.java @@ -158,6 +158,7 @@ public class AsyncTaskHelper { task.cancel(false); if (task == backgroundOamTask) { backgroundOamTask = null; + taskRunnable = null; logDebug("Cancelling background task in cancel task."); } } -- cgit 1.2.3-korg