Merge "Replaced Equals/HashcodeBuilder for DatapacketListener"
[controller.git] / opendaylight / sal / yang-prototype / code-generator / yang-model-parser-impl / src / main / java / org / opendaylight / controller / yang / parser / builder / impl / DeviationBuilder.java
index cfe6effb6c5098fa0fb7066884c3bf474d824751..239c0a5ed9a8da6c3a1682975f7a8b8258941e17 100644 (file)
@@ -12,8 +12,9 @@ import org.opendaylight.controller.yang.model.api.Deviation.Deviate;
 import org.opendaylight.controller.yang.model.api.SchemaPath;
 import org.opendaylight.controller.yang.parser.builder.api.Builder;
 import org.opendaylight.controller.yang.parser.util.YangModelBuilderUtil;
+import org.opendaylight.controller.yang.parser.util.YangParseException;
 
-public class DeviationBuilder implements Builder {
+public final class DeviationBuilder implements Builder {
     private final DeviationImpl instance;
     private final int line;
 
@@ -44,7 +45,7 @@ public class DeviationBuilder implements Builder {
         } else if ("delete".equals(deviate)) {
             instance.setDeviate(Deviate.DELETE);
         } else {
-            throw new IllegalArgumentException(
+            throw new YangParseException(line,
                     "Unsupported type of 'deviate' statement: " + deviate);
         }
     }
@@ -53,7 +54,7 @@ public class DeviationBuilder implements Builder {
         instance.setReference(reference);
     }
 
-    private static class DeviationImpl implements Deviation {
+    private final class DeviationImpl implements Deviation {
         private final SchemaPath targetPath;
         private Deviate deviate;
         private String reference;