Code Review
/
dmaap
/
datarouter.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Remove checkstyle syntax warnings from dr-node
[dmaap/datarouter.git]
/
datarouter-node
/
src
/
main
/
java
/
org
/
onap
/
dmaap
/
datarouter
/
node
/
PathFinder.java
diff --git
a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/PathFinder.java
b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/PathFinder.java
index
d8beab5
..
d86b1e4
100644
(file)
--- a/
datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/PathFinder.java
+++ b/
datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/PathFinder.java
@@
-32,7
+32,7
@@
import org.onap.dmaap.datarouter.node.NodeConfig.ProvHop;
/**
* Given a set of node names and next hops, identify and ignore any cycles and figure out the sequence of next hops to
/**
* Given a set of node names and next hops, identify and ignore any cycles and figure out the sequence of next hops to
- * get from this node to any other node
+ * get from this node to any other node
.
*/
public class PathFinder {
*/
public class PathFinder {
@@
-55,13
+55,13
@@
public class PathFinder {
ht.put(n, new HashMap<>());
}
for (NodeConfig.ProvHop ph : hops) {
ht.put(n, new HashMap<>());
}
for (NodeConfig.ProvHop ph : hops) {
- Hop h = getHop(known, ht, ph);
- if (h == null) {
+ Hop h
op
= getHop(known, ht, ph);
+ if (h
op
== null) {
continue;
}
if (ph.getVia().equals(ph.getTo())) {
errors.add(ph + " gives destination as via");
continue;
}
if (ph.getVia().equals(ph.getTo())) {
errors.add(ph + " gives destination as via");
- h.bad = true;
+ h
op
.bad = true;
}
}
for (String n : known) {
}
}
for (String n : known) {
@@
-73,7
+73,7
@@
public class PathFinder {
}
/**
}
/**
- * Get list of errors encountered while finding paths
+ * Get list of errors encountered while finding paths
.
*
* @return array of error descriptions
*/
*
* @return array of error descriptions
*/
@@
-82,7
+82,7
@@
public class PathFinder {
}
/**
}
/**
- * Get the route from this node to the specified node
+ * Get the route from this node to the specified node
.
*
* @param destination node
* @return list of node names separated by and ending with "/"
*
* @param destination node
* @return list of node names separated by and ending with "/"
@@
-109,12
+109,12
@@
public class PathFinder {
return (to);
}
nh.mark = true;
return (to);
}
nh.mark = true;
- String
x
= plot(nh.basis.getVia(), to, info);
+ String
route
= plot(nh.basis.getVia(), to, info);
nh.mark = false;
if (nh.bad) {
return (to);
}
nh.mark = false;
if (nh.bad) {
return (to);
}
- return (nh.basis.getVia() + "/" +
x
);
+ return (nh.basis.getVia() + "/" +
route
);
}
@Nullable
}
@Nullable
@@
-128,21
+128,21
@@
public class PathFinder {
return null;
}
HashMap<String, Hop> ht2 = ht.get(ph.getTo());
return null;
}
HashMap<String, Hop> ht2 = ht.get(ph.getTo());
- Hop h = ht2.get(ph.getFrom());
- if (h != null) {
- h.bad = true;
- errors.add(ph + " gives duplicate next hop - previous via was " + h.basis.getVia());
+ Hop h
op
= ht2.get(ph.getFrom());
+ if (h
op
!= null) {
+ h
op
.bad = true;
+ errors.add(ph + " gives duplicate next hop - previous via was " + h
op
.basis.getVia());
return null;
}
return null;
}
- h = new Hop();
- h.basis = ph;
- ht2.put(ph.getFrom(), h);
+ h
op
= new Hop();
+ h
op
.basis = ph;
+ ht2.put(ph.getFrom(), h
op
);
if (!known.contains(ph.getVia())) {
errors.add(ph + " references unknown via node");
if (!known.contains(ph.getVia())) {
errors.add(ph + " references unknown via node");
- h.bad = true;
+ h
op
.bad = true;
return null;
}
return null;
}
- return h;
+ return h
op
;
}
private static class Hop {
}
private static class Hop {