Fix critical Sonar Issue: ConfigurationServiceImpl.java 11/13011/3
authorFlavio Fernandes <ffernand@redhat.com>
Thu, 20 Nov 2014 15:15:58 +0000 (10:15 -0500)
committerFlavio Fernandes <ffernand@redhat.com>
Fri, 21 Nov 2014 15:31:49 +0000 (10:31 -0500)
Fix for the following issue:
- Throwable.printStackTrace(...) should never be called

https://sonar.opendaylight.org/component/index#component=org.opendaylight.ovsdb%3Aplugin%3Amaster%3Asrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fovsdb%2Fplugin%2Fimpl%2FConfigurationServiceImpl.java&settings=issues&blocks=959%2C967&tab=issues&item=.js-filter-CRITICAL-issues&line=963

patch 2: replace 'e.fillInStackTrace()' with 'e'
patch 3: set log level to error

Change-Id: I91af7d1548b3c7563126ace9ad33a0f1b8877379
Signed-off-by: Flavio Fernandes <ffernand@redhat.com>
plugin/src/main/java/org/opendaylight/ovsdb/plugin/impl/ConfigurationServiceImpl.java

index 40c9cabc4005d2caae54aeb2b0153a5772516d3b..187b913fddb4abde0f607bfd440a6aa99c6ec503 100644 (file)
@@ -960,7 +960,7 @@ public class ConfigurationServiceImpl implements IPluginInBridgeDomainConfigServ
             Thread.sleep(2000);
         } catch (InterruptedException e) {
             // TODO Auto-generated catch block
-            e.printStackTrace();
+            logger.error("Thread interrupted", e);
         }
 
         Interface interfaceRow = client.createTypedRowWrapper(Interface.class);