bump build conf to latest
- fix checkstyle error
- log exception
- cosmetics
Change-Id: Ia3ea064b372f04cd604a021d1870b70e3f83a9c8
diff --git a/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/JavaCodeGeneratorUtil.java b/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/JavaCodeGeneratorUtil.java
index 194ef46..53a0af0 100644
--- a/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/JavaCodeGeneratorUtil.java
+++ b/compiler/base/translator/src/main/java/org/onosproject/yang/compiler/translator/tojava/JavaCodeGeneratorUtil.java
@@ -17,6 +17,7 @@
package org.onosproject.yang.compiler.translator.tojava;
import com.google.common.base.Throwables;
+
import org.onosproject.yang.compiler.datamodel.RpcNotificationContainer;
import org.onosproject.yang.compiler.datamodel.SchemaDataNode;
import org.onosproject.yang.compiler.datamodel.TraversalType;
@@ -33,6 +34,7 @@
import org.onosproject.yang.compiler.translator.exception.InvalidNodeForTranslatorException;
import org.onosproject.yang.compiler.translator.exception.TranslatorException;
import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
+import org.slf4j.Logger;
import java.io.IOException;
import java.util.List;
@@ -44,12 +46,14 @@
import static org.onosproject.yang.compiler.translator.tojava.YangJavaModelUtils.updateJavaInfo;
import static org.onosproject.yang.compiler.translator.tojava.utils.JavaIdentifierSyntax.getEnumJavaAttribute;
import static org.onosproject.yang.compiler.utils.io.impl.YangIoUtils.searchAndDeleteTempDir;
+import static org.slf4j.LoggerFactory.getLogger;
/**
* Representation of java code generator based on application schema.
*/
public final class JavaCodeGeneratorUtil {
+ private static final Logger log = getLogger(JavaCodeGeneratorUtil.class);
/**
* Creates a java code generator utility object.
*/
@@ -159,7 +163,7 @@
for (YangAugment a : augList) {
a.setLeafNameSpaceAndAddToParentSchemaMap();
a.setLeafParentContext();
- processAugNode((YangAugment) a);
+ processAugNode(a);
}
}
}
@@ -189,7 +193,7 @@
}
continue;
} catch (Exception e) {
- e.printStackTrace();
+ log.error("Encountered exception", e);
close(codeGenNode, yangPlugin, rootNode);
throw new TranslatorException(e.getMessage());
}
@@ -203,9 +207,9 @@
generateCodeExit(codeGenNode, yangPlugin, rootNode);
}
} catch (Exception e) {
- e.printStackTrace();
+ log.error("Encountered exception", e);
close(codeGenNode, yangPlugin, rootNode);
- Throwables.propagateIfInstanceOf(e, TranslatorException.class);
+ Throwables.throwIfInstanceOf(e, TranslatorException.class);
throw new TranslatorException(e);
}
curTraversal = SIBLING;
@@ -216,9 +220,9 @@
generateCodeExit(codeGenNode, yangPlugin, rootNode);
}
} catch (Exception e) {
- e.printStackTrace();
+ log.error("Encountered exception", e);
close(codeGenNode, yangPlugin, rootNode);
- Throwables.propagateIfInstanceOf(e, TranslatorException.class);
+ Throwables.throwIfInstanceOf(e, TranslatorException.class);
throw new TranslatorException(e);
}
curTraversal = PARENT;
diff --git a/pom.xml b/pom.xml
index 525f7f2..fa29fd3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -35,7 +35,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <onos-build-conf.version>1.12.0</onos-build-conf.version>
+ <onos-build-conf.version>1.13.1</onos-build-conf.version>
<guava.version>22.0</guava.version>
<errorprone.version>2.2.0</errorprone.version>
<betachecker.version>1.0</betachecker.version>