summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/aai/datasnapshot/PrintVertexDetails.java
diff options
context:
space:
mode:
authorRodrigo Lima <rodrigo.lima@yoppworks.com>2020-06-23 14:34:07 -0400
committerRodrigo Lima <rodrigo.lima@yoppworks.com>2020-07-08 10:54:28 -0400
commitde4fc52226078ed9276323416c3b5129e6780973 (patch)
treee2e6605b68e874c480212b263bb9969c16f54f4a /src/main/java/org/onap/aai/datasnapshot/PrintVertexDetails.java
parentbfc786f8a9bb550df1c70c9f425fa182246baba2 (diff)
Fix sonar issues
- Fix Sonar issues in the classes : UpdatePropertyToolInternal, MigratePserverAndPnfEquipType, UniquePropertyCheck, AuditOXM, PrintVertexDetails, DataGroomingTasks, DeletePInterface, MigrateDataFromASDCToConfiguration, MigrateSAREvcInventory, MigrateModelVer, PserverDedupWithDifferentSourcesOfTruth, GenericQueryProcessor, DataExportTasks Issue-ID: AAI-2963 Signed-off-by: Rodrigo Lima <rodrigo.lima@yoppworks.com> Change-Id: I76ff744153805a009d8378b9839f83456d9ebe5c
Diffstat (limited to 'src/main/java/org/onap/aai/datasnapshot/PrintVertexDetails.java')
-rw-r--r--src/main/java/org/onap/aai/datasnapshot/PrintVertexDetails.java9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/main/java/org/onap/aai/datasnapshot/PrintVertexDetails.java b/src/main/java/org/onap/aai/datasnapshot/PrintVertexDetails.java
index 12b3099..ff6835b 100644
--- a/src/main/java/org/onap/aai/datasnapshot/PrintVertexDetails.java
+++ b/src/main/java/org/onap/aai/datasnapshot/PrintVertexDetails.java
@@ -74,11 +74,10 @@ public class PrintVertexDetails implements Runnable{
if (debugOn) {
// This is much slower, but sometimes we need to find out which single line is
// causing a failure
- try {
+ try(FileOutputStream subFileStr = new FileOutputStream(fname)) {
int okCount = 0;
int failCount = 0;
Long debugDelayMsL = new Long(debugDelayMs);
- FileOutputStream subFileStr = new FileOutputStream(fname);
GraphWriter graphWriter = null;
if ("gryo".equalsIgnoreCase(snapshotType)) {
@@ -117,12 +116,10 @@ public class PrintVertexDetails implements Runnable{
+ "], aai-uri = [" + aaiUri + "]. ";
System.out.println(fmsg);
LOGGER.debug(" PrintVertexDetails " + fmsg);
- // e.printStackTrace();
}
}
System.out.println(" -- Printed " + okCount + " vertexes out to " + fname + ", with " + failCount
+ " failed.");
- subFileStr.close();
} catch (Exception e) {
AAIException ae = new AAIException("AAI_6128", e , "Error running PrintVertexDetails in debugon");
ErrorLogHelper.logException(ae);
@@ -136,16 +133,14 @@ public class PrintVertexDetails implements Runnable{
vtxList.add(gt.next());
}
- try {
+ try(FileOutputStream subFileStr = new FileOutputStream(fname)) {
int count = vtxList.size();
Iterator<Vertex> vSubItr = vtxList.iterator();
- FileOutputStream subFileStr = new FileOutputStream(fname);
if ("gryo".equalsIgnoreCase(snapshotType)) {
jg.io(IoCore.gryo()).writer().create().writeVertices(subFileStr, vSubItr, Direction.BOTH);
} else {
jg.io(IoCore.graphson()).writer().create().writeVertices(subFileStr, vSubItr, Direction.BOTH);
}
- subFileStr.close();
String pmsg = " -- Printed " + count + " vertexes out to " + fname;
System.out.println(pmsg);
LOGGER.debug(" PrintVertexDetails " + pmsg);