From c39f8ff9e9436d974f9d0021be04b0a925d6745d Mon Sep 17 00:00:00 2001 From: Chris André Date: Tue, 21 Apr 2020 21:11:55 -0400 Subject: Minor cleanups for JanusGraphDao - Fixed typo in a call to `logger.debug` - Modified if statement following recommendation from SonarCloud Issue-ID: SDC-2918 Signed-off-by: Chris Andre Change-Id: I75d50d74703bf7c706b84723bb5d43760b8b7baf --- .../org/openecomp/sdc/be/dao/jsongraph/JanusGraphDao.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'catalog-dao/src') diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/JanusGraphDao.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/JanusGraphDao.java index 65b6c618d8..3624bb353c 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/JanusGraphDao.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/JanusGraphDao.java @@ -154,7 +154,7 @@ public class JanusGraphDao { return Either.left(graphVertex); } if (logger.isDebugEnabled()) { - logger.debug("No vertex in graph for key = {} and value = {} label = {}" + name, value, label); + logger.debug("No vertex in graph for key = {} and value = {} label = {}", name, value, label); } return Either.right(JanusGraphOperationStatus.NOT_FOUND); } catch (Exception e) { @@ -982,16 +982,18 @@ public class JanusGraphDao { * @param newLabel * @return */ - public JanusGraphOperationStatus replaceEdgeLabel(Vertex fromVertex, Vertex toVertex, EdgeLabelEnum prevLabel, EdgeLabelEnum newLabel) { + public JanusGraphOperationStatus replaceEdgeLabel(Vertex fromVertex, Vertex toVertex, EdgeLabelEnum prevLabel, + EdgeLabelEnum newLabel) { JanusGraphOperationStatus result = null; Iterator prevEdgeIter = toVertex.edges(Direction.IN, prevLabel.name()); if (prevEdgeIter == null || !prevEdgeIter.hasNext()) { - CommonUtility.addRecordToLog(logger, LogLevelEnum.DEBUG, "Failed to replace edge with label {} to {} between vertices {} and {}", prevLabel, newLabel, fromVertex.property(GraphPropertyEnum.UNIQUE_ID.getProperty()), - toVertex.property(GraphPropertyEnum.UNIQUE_ID.getProperty())); + CommonUtility.addRecordToLog(logger, LogLevelEnum.DEBUG, + "Failed to replace edge with label {} to {} between vertices {} and {}", prevLabel, newLabel, + fromVertex.property(GraphPropertyEnum.UNIQUE_ID.getProperty()), + toVertex.property(GraphPropertyEnum.UNIQUE_ID.getProperty())); result = JanusGraphOperationStatus.NOT_FOUND; - } - if (result == null) { + } else { result = replaceEdgeLabel(fromVertex, toVertex, prevEdgeIter.next(), prevLabel, newLabel); } return result; -- cgit 1.2.3-korg