sonar critical for error-handling
[dmaap/messagerouter/mirroragent.git] / src / main / java / com / att / nsa / dmaapMMAgent / MirrorMakerAgent.java
index 3efbf4f..2fc712b 100644 (file)
@@ -166,14 +166,14 @@ public class MirrorMakerAgent {
                                prop.store(out, "");
 
                        } catch (Exception e) {
-                               e.printStackTrace();
+                               logger.error("Exception at checkPropertiesFile " +e);
                        }
                } finally {
                        if (input != null) {
                                try {
                                        input.close();
                                } catch (IOException e) {
-                                       e.printStackTrace();
+                                       logger.error("Exception occurred is " +e);
                                }
                        }
                        if (out != null) {
@@ -361,7 +361,7 @@ public class MirrorMakerAgent {
 
                        }
                } catch (Exception e) {
-                       e.printStackTrace();
+                       logger.error("Exception is : " +e);
                }
 
        }
@@ -380,7 +380,7 @@ public class MirrorMakerAgent {
                        }
                }
                logger.info("Adding new MirrorMaker:" + newMirrorMaker.name);
-               if (!exists && mirrorMakers != null) {
+               if (exists == false && mirrorMakers != null) {
                        mirrorMakers.getListMirrorMaker().add(newMirrorMaker);
                } else if (exists == false && mirrorMakers == null) {
                        mirrorMakers = new ListMirrorMaker();