summaryrefslogtreecommitdiffstats
path: root/catalog-dao/src/main/java/org
diff options
context:
space:
mode:
authorChris André <chris.andre@yoppworks.com>2020-04-21 21:11:55 -0400
committerOfir Sonsino <ofir.sonsino@intl.att.com>2020-04-22 10:58:02 +0000
commitc39f8ff9e9436d974f9d0021be04b0a925d6745d (patch)
tree3358ae37d92985d42e65428f96fd6e4f626621ee /catalog-dao/src/main/java/org
parentc78692e297c0127474d2af000f22316638991c1e (diff)
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 <chris.andre@yoppworks.com> Change-Id: I75d50d74703bf7c706b84723bb5d43760b8b7baf
Diffstat (limited to 'catalog-dao/src/main/java/org')
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/JanusGraphDao.java14
1 files changed, 8 insertions, 6 deletions
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<Edge> 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;