YANG translator error handler framework and UT fixes.
Change-Id: Icb4d65540ed7ea8d6ecbd8458d44d7d86df969fa
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaGrouping.java b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaGrouping.java
index 1b1b818..a93c83d 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaGrouping.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaGrouping.java
@@ -18,6 +18,7 @@
import java.io.IOException;
import org.onosproject.yangutils.datamodel.YangGrouping;
+import org.onosproject.yangutils.translator.exception.TranslatorException;
import org.onosproject.yangutils.translator.tojava.HasJavaFileInfo;
import org.onosproject.yangutils.translator.tojava.HasJavaImportData;
import org.onosproject.yangutils.translator.tojava.HasTempJavaCodeFragmentFiles;
@@ -76,7 +77,7 @@
public JavaFileInfo getJavaFileInfo() {
if (javaFileInfo == null) {
- throw new RuntimeException("Missing java info in java datamodel node");
+ throw new TranslatorException("Missing java info in java datamodel node");
}
return javaFileInfo;
}
@@ -88,7 +89,6 @@
*/
@Override
public void setJavaFileInfo(JavaFileInfo javaInfo) {
-
javaFileInfo = javaInfo;
}
@@ -99,7 +99,6 @@
*/
@Override
public JavaImportData getJavaImportData() {
-
return javaImportData;
}
@@ -111,7 +110,6 @@
*/
@Override
public void setJavaImportData(JavaImportData javaImportData) {
-
this.javaImportData = javaImportData;
}
@@ -122,11 +120,6 @@
*/
@Override
public TempJavaCodeFragmentFiles getTempJavaCodeFragmentFiles() {
-
- if (tempFileHandle == null) {
- throw new RuntimeException("missing temp file hand for current node "
- + getJavaFileInfo().getJavaName());
- }
return tempFileHandle;
}
@@ -137,7 +130,6 @@
*/
@Override
public void setTempJavaCodeFragmentFiles(TempJavaCodeFragmentFiles fileHandle) {
-
tempFileHandle = fileHandle;
}