removed code duplication in translator, and addressed review comments
Change-Id: I27767a81c4bf279c80d2b98192f75f8f507b4457
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/JavaCodeGenerator.java b/src/main/java/org/onosproject/yangutils/translator/tojava/JavaCodeGenerator.java
index 20cc584..308020b 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/JavaCodeGenerator.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/JavaCodeGenerator.java
@@ -34,8 +34,9 @@
/**
* Generate Java code files corresponding to the YANG schema.
*
- * @param rootNode root node of the data model tree.
- * @throws IOException when fails to generate java code file the current node.
+ * @param rootNode root node of the data model tree
+ * @throws IOException when fails to generate java code file the current
+ * node
*/
public static void generateJavaCode(YangNode rootNode) throws IOException {
YangNode curNode = rootNode;
@@ -45,10 +46,10 @@
if (curTraversal != TraversalType.PARENT) {
curNode.generateJavaCodeEntry();
}
- if (curTraversal != TraversalType.PARENT && (curNode.getChild() != null)) {
+ if (curTraversal != TraversalType.PARENT && curNode.getChild() != null) {
curTraversal = TraversalType.CHILD;
curNode = curNode.getChild();
- } else if ((curNode.getNextSibling() != null)) {
+ } else if (curNode.getNextSibling() != null) {
curNode.generateJavaCodeExit();
curTraversal = TraversalType.SIBILING;
curNode = curNode.getNextSibling();