sonar major for error-handling 19/30419/1
authorDushyant Singh Thakur <dt00503496@techmahindra.com>
Tue, 6 Feb 2018 10:09:54 +0000 (15:39 +0530)
committerDushyant Singh Thakur <dt00503496@techmahindra.com>
Tue, 6 Feb 2018 10:09:54 +0000 (15:39 +0530)
Either log or rethrow this exception
Sonar Link:
https://sonar.onap.org/component_issues?id=org.onap.dmaap.messagerouter.mirroragent%3AdmaapMMAgent#resolved=false|assignees=dthakur
Location:
src/main/java/com/att/nsa/dmaapMMAgent/MirrorMakerAgent.java
Line No-363

Change-Id: Ia2d37cdc6ddf5489dcddb984aa4d5485d6d58849
Issue-ID: DMAAP-237
Signed-off-by: Dushyant Singh Thakur <dt00503496@techmahindra.com>
src/main/java/com/att/nsa/dmaapMMAgent/MirrorMakerAgent.java

index 2fc712b..e2bdeaf 100644 (file)
@@ -181,7 +181,7 @@ public class MirrorMakerAgent {
                                        out.close();
                                } catch (IOException e) {
                                        e.printStackTrace();
                                        out.close();
                                } catch (IOException e) {
                                        e.printStackTrace();
-                                       logger.error("IOException" + e);
+                                       logger.error("Exception is : "+e);
                                }
                        }
                }
                                }
                        }
                }
@@ -361,7 +361,7 @@ public class MirrorMakerAgent {
 
                        }
                } catch (Exception e) {
 
                        }
                } catch (Exception e) {
-                       logger.error("Exception is : " +e);
+                       logger.error("Exception at readAgentTopic : " + e);
                }
 
        }
                }
 
        }
@@ -385,7 +385,7 @@ public class MirrorMakerAgent {
                } else if (exists == false && mirrorMakers == null) {
                        mirrorMakers = new ListMirrorMaker();
                        ArrayList<MirrorMaker> list = mirrorMakers.getListMirrorMaker();
                } else if (exists == false && mirrorMakers == null) {
                        mirrorMakers = new ListMirrorMaker();
                        ArrayList<MirrorMaker> list = mirrorMakers.getListMirrorMaker();
-                       list = new ArrayList<MirrorMaker>();
+                       list = new ArrayList();
                        list.add(newMirrorMaker);
                        mirrorMakers.setListMirrorMaker(list);
                }
                        list.add(newMirrorMaker);
                        mirrorMakers.setListMirrorMaker(list);
                }

© 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