Merge "sonar design for error-handling"
authorvarun gudisena <vg411h@att.com>
Tue, 6 Feb 2018 14:25:21 +0000 (14:25 +0000)
committerGerrit Code Review <gerrit@onap.org>
Tue, 6 Feb 2018 14:25:21 +0000 (14:25 +0000)
1  2 
src/main/java/com/att/nsa/dmaapMMAgent/MirrorMakerAgent.java

@@@ -102,7 -102,7 +102,7 @@@ public class MirrorMakerAgent 
                                try {
                                        input.close();
                                } catch (IOException e) {
 -                                      logger.error("IOException" + e);
 +                                      logger.error(" IOException occers " + e);
                                }
                        }
                }
                                prop.store(out, "");
  
                        } catch (Exception e) {
-                               e.printStackTrace();
+                               logger.error("Exception at checkPropertiesFile " +e);
                        }
                } finally {
                        if (input != null) {
                        }
                }
                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();
                                                out.close();
                                        } catch (IOException e) {
                                                e.printStackTrace();
 +                                              logger.error("IOException occered " + e);
                                        }
                                }
                        }

© 2017 ONAP. Copyright © The Linux Foundation ®. All Rights Reserved.
The Linux Foundation has registered trademarks and uses trademarks.
For a list of trademarks of The Linux Foundation, please see our Trademark Usage page.
Linux is a registered trademark of Linus Torvalds.
Privacy Policy and Terms of Use