From 831bd8e5d00be1b5b15f795362ea99bf5159559a Mon Sep 17 00:00:00 2001 From: "Magnusen, Drew (dm741q)" Date: Thu, 7 Sep 2017 08:55:17 -0500 Subject: Small change to please sonar Added a 'Thread.currentThread().interrupt()' in a catch of the run method of TTControllerTask at the direction of sonar. Added dump of exception to logger. Issue-ID: POLICY-213 Change-Id: I2bdd74eacedb6d1950c5c730430d7f723ce494bc Signed-off-by: Magnusen, Drew (dm741q) --- .../java/org/onap/policy/drools/testtransaction/TestTransaction.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'feature-test-transaction/src') diff --git a/feature-test-transaction/src/main/java/org/onap/policy/drools/testtransaction/TestTransaction.java b/feature-test-transaction/src/main/java/org/onap/policy/drools/testtransaction/TestTransaction.java index 4da6b6ee..e5cff243 100644 --- a/feature-test-transaction/src/main/java/org/onap/policy/drools/testtransaction/TestTransaction.java +++ b/feature-test-transaction/src/main/java/org/onap/policy/drools/testtransaction/TestTransaction.java @@ -89,6 +89,7 @@ class TTImpl implements TestTransaction { * */ class TTControllerTask implements Runnable { + // get an instance of logger private static final Logger logger = LoggerFactory.getLogger(TTControllerTask.class); @@ -184,9 +185,10 @@ class TTControllerTask implements Runnable { } } catch (final InterruptedException e) { logger.info("{}: stopping ...", this, e); + Thread.currentThread().interrupt(); } catch (final IllegalArgumentException e) { logger.error("{}: controller {} has not been enabled for testing: ", this, - this.controller.getName(), e.getMessage()); + this.controller.getName(), e.getMessage(), e); } catch (final Exception e) { logger.error("Controller: {} is not testable - TestTransaction caught exception: {} ", this.controller.getName(), e.getMessage()); @@ -209,5 +211,4 @@ class TTControllerTask implements Runnable { builder.append("]"); return builder.toString(); } - } -- cgit 1.2.3-korg