diff options
Diffstat (limited to 'src/main/java/org/onap/aai/dbgen')
4 files changed, 12 insertions, 13 deletions
diff --git a/src/main/java/org/onap/aai/dbgen/DupeTool.java b/src/main/java/org/onap/aai/dbgen/DupeTool.java index db53caf..d07485d 100644 --- a/src/main/java/org/onap/aai/dbgen/DupeTool.java +++ b/src/main/java/org/onap/aai/dbgen/DupeTool.java @@ -795,7 +795,7 @@ public class DupeTool { vtx = ed.outVertex(); } if (vtx == null) { - retArr.add(String.format(" >>> COULD NOT FIND VERTEX on the other side of this edge edgeId = %s <<< ", ed.id())); + retArr.add(" >>> COULD NOT FIND VERTEX on the other side of this edge edgeId = %s <<< ".formatted(ed.id())); } else { String nType = vtx.<String>property("aai-node-type").orElse(null); if (displayAllVidsFlag) { @@ -901,7 +901,7 @@ public class DupeTool { } if (retVertList.size() == 0) { - logger.debug(String.format("DEBUG No node found for nodeType = [%s], propsAndVal = %s", nodeType, propsAndValuesForMsg)); + logger.debug("DEBUG No node found for nodeType = [%s], propsAndVal = %s".formatted(nodeType, propsAndValuesForMsg)); } return retVertList; @@ -988,7 +988,7 @@ public class DupeTool { } if (retVertList.size() == 0) { - logger.debug(String.format("DEBUG No node found for: [%s, with aai-created-ts > %d", qStringForMsg, windowStartTime)); + logger.debug("DEBUG No node found for: [%s, with aai-created-ts > %d".formatted(qStringForMsg, windowStartTime)); } return retVertList; @@ -1104,8 +1104,8 @@ public class DupeTool { Vertex nullVtx = null; Vertex preferredVtx = null; - Long vidA = new Long(vtxA.id().toString()); - Long vidB = new Long(vtxB.id().toString()); + Long vidA = Long.valueOf(vtxA.id().toString()); + Long vidB = Long.valueOf(vtxB.id().toString()); String vtxANodeType = ""; String vtxBNodeType = ""; @@ -1548,7 +1548,7 @@ public class DupeTool { String origVid = origVtx.id().toString(); if (ob == null || ob.toString().equals("")) { // It is missing its aai-uri - eLogger.debug(String.format("DEBUG No [aai-uri] property found for vid = [%s] ", origVid)); + eLogger.debug("DEBUG No [aai-uri] property found for vid = [%s] ".formatted(origVid)); return false; } else { @@ -1560,16 +1560,16 @@ public class DupeTool { Vertex foundV = verts.next(); String foundVid = foundV.id().toString(); if( !origVid.equals(foundVid) ){ - eLogger.debug(String.format("DEBUG aai-uri key property [%s] for vid = [%s] brought back different vertex with vid = [%s].", aaiUriStr, origVid, foundVid)); + eLogger.debug("DEBUG aai-uri key property [%s] for vid = [%s] brought back different vertex with vid = [%s].".formatted(aaiUriStr, origVid, foundVid)); return false; } } if( count == 0 ){ - eLogger.debug(String.format("DEBUG aai-uri key property [%s] for vid = [%s] could not be used to query for that vertex. ", aaiUriStr, origVid)); + eLogger.debug("DEBUG aai-uri key property [%s] for vid = [%s] could not be used to query for that vertex. ".formatted(aaiUriStr, origVid)); return false; } else if( count > 1 ){ - eLogger.debug(String.format("DEBUG aai-uri key property [%s] for vid = [%s] brought back multiple (%d) vertices instead of just one. ", aaiUriStr, origVid, count)); + eLogger.debug("DEBUG aai-uri key property [%s] for vid = [%s] brought back multiple (%d) vertices instead of just one. ".formatted(aaiUriStr, origVid, count)); return false; } } diff --git a/src/main/java/org/onap/aai/dbgen/DynamicPayloadGenerator.java b/src/main/java/org/onap/aai/dbgen/DynamicPayloadGenerator.java index 7ee9372..de8a230 100644 --- a/src/main/java/org/onap/aai/dbgen/DynamicPayloadGenerator.java +++ b/src/main/java/org/onap/aai/dbgen/DynamicPayloadGenerator.java @@ -69,7 +69,6 @@ import java.net.URI; import java.nio.file.Files; import java.nio.file.InvalidPathException; import java.nio.file.Path; -import java.nio.file.Paths; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.*; @@ -472,7 +471,7 @@ public class DynamicPayloadGenerator { // FileLocation Path pathDir = null; try { - pathDir = Paths.get(dirName); + pathDir = Path.of(dirName); } catch (InvalidPathException i) { String emsg = "Directory " + dirName + " could not be found."; LOGGER.error(emsg); diff --git a/src/main/java/org/onap/aai/dbgen/GraphSONPartialReader.java b/src/main/java/org/onap/aai/dbgen/GraphSONPartialReader.java index a170453..80edd7b 100644 --- a/src/main/java/org/onap/aai/dbgen/GraphSONPartialReader.java +++ b/src/main/java/org/onap/aai/dbgen/GraphSONPartialReader.java @@ -288,7 +288,7 @@ public final class GraphSONPartialReader implements GraphReader { if (unwrapAdjacencyList) { final JsonNode root = mapper.readTree(inputStream); final JsonNode vertices = root.get(GraphSONTokens.VERTICES); - if (!vertices.getNodeType().equals(JsonNodeType.ARRAY)) throw new IOException(String.format("The '%s' key must be an array", GraphSONTokens.VERTICES)); + if (!vertices.getNodeType().equals(JsonNodeType.ARRAY)) throw new IOException("The '%s' key must be an array".formatted(GraphSONTokens.VERTICES)); return IteratorUtils.stream(vertices.elements()).map(Object::toString); } else { final BufferedReader br = new BufferedReader(new InputStreamReader(inputStream)); diff --git a/src/main/java/org/onap/aai/dbgen/UpdatePropertyToolInternal.java b/src/main/java/org/onap/aai/dbgen/UpdatePropertyToolInternal.java index 3b7c4b8..d93e923 100644 --- a/src/main/java/org/onap/aai/dbgen/UpdatePropertyToolInternal.java +++ b/src/main/java/org/onap/aai/dbgen/UpdatePropertyToolInternal.java @@ -270,7 +270,7 @@ public class UpdatePropertyToolInternal { logAndPrint("All vertex IDs from file " + filePath + ":\n" + allVertexIdsString); } catch (IOException ioe) { if(ioe instanceof FileNotFoundException) { - logErrorAndPrint(String.format("File %s not found.", filePath)); + logErrorAndPrint("File %s not found.".formatted(filePath)); } else { logErrorAndPrint("ERROR reading in text file failed.", ioe); } |