Code Review
/
dmaap
/
messagerouter
/
mirroragent.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
sonar critical for Exception Handling
[dmaap/messagerouter/mirroragent.git]
/
src
/
main
/
java
/
com
/
att
/
nsa
/
dmaapMMAgent
/
MirrorMakerAgent.java
diff --git
a/src/main/java/com/att/nsa/dmaapMMAgent/MirrorMakerAgent.java
b/src/main/java/com/att/nsa/dmaapMMAgent/MirrorMakerAgent.java
index
d0237f1
..
7e28f52
100644
(file)
--- a/
src/main/java/com/att/nsa/dmaapMMAgent/MirrorMakerAgent.java
+++ b/
src/main/java/com/att/nsa/dmaapMMAgent/MirrorMakerAgent.java
@@
-102,7
+102,7
@@
public class MirrorMakerAgent {
try {
input.close();
} catch (IOException e) {
try {
input.close();
} catch (IOException e) {
- logger.error("
IOException
" + e);
+ logger.error("
IOException occers
" + e);
}
}
}
}
}
}
@@
-152,6
+152,7
@@
public class MirrorMakerAgent {
}
input = new FileInputStream(mmagenthome + "/etc/" + agentName + propName + ".properties");
} catch (IOException ex) {
}
input = new FileInputStream(mmagenthome + "/etc/" + agentName + propName + ".properties");
} catch (IOException ex) {
+ logger.error(" IOException will be handled " + ex);
try {
input = new FileInputStream(mmagenthome + "/etc/" + propName + ".properties");
Properties prop = new Properties();
try {
input = new FileInputStream(mmagenthome + "/etc/" + propName + ".properties");
Properties prop = new Properties();
@@
-166,7
+167,7
@@
public class MirrorMakerAgent {
prop.store(out, "");
} catch (Exception e) {
prop.store(out, "");
} catch (Exception e) {
-
e.printStackTrace(
);
+
logger.error("Exception at checkPropertiesFile " +e
);
}
} finally {
if (input != null) {
}
} finally {
if (input != null) {
@@
-211,6
+212,7
@@
public class MirrorMakerAgent {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
}
mirrorMakers.getListMirrorMaker().set(i, mm);
} else {
}
mirrorMakers.getListMirrorMaker().set(i, mm);
} else {
@@
-251,6
+253,7
@@
public class MirrorMakerAgent {
return topicMessage[0];
}
} catch (Exception e) {
return topicMessage[0];
}
} catch (Exception e) {
+ logger.error(" Exception Occered " + e);
return "ERROR:" + e.getMessage() + " Server Response is:" + response;
}
return null;
return "ERROR:" + e.getMessage() + " Server Response is:" + response;
}
return null;
@@
-492,6
+495,7
@@
public class MirrorMakerAgent {
out.close();
} catch (IOException e) {
e.printStackTrace();
out.close();
} catch (IOException e) {
e.printStackTrace();
+ logger.error("IOException occered " + e);
}
}
}
}
}
}