Switch from NPE to ISE 27/88127/1
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 28 Feb 2020 05:55:29 +0000 (06:55 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 28 Feb 2020 14:11:00 +0000 (15:11 +0100)
When we fail to locate a type it constitutes an IllegalState, not
a plain NPE.

Change-Id: I46eaa470342a5e72ad6a92aefed97e458a2ca398
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-generator-impl/src/main/java/org/opendaylight/mdsal/binding/generator/impl/AbstractTypeGenerator.java

index 7db5d01ff7a789698382c84b37783044e3af61ed..0c80e94b604fc5d7b2b9860995b23e9a17bd1722 100644 (file)
@@ -839,7 +839,7 @@ abstract class AbstractTypeGenerator {
             targetTypeBuilder = findCaseByPath(targetSchemaNode.getPath());
         }
         if (targetTypeBuilder == null) {
-            throw new NullPointerException("Target type not yet generated: " + targetSchemaNode);
+            throw new IllegalStateException("Target type not yet generated: " + targetSchemaNode);
         }
 
         if (!(targetSchemaNode instanceof ChoiceSchemaNode)) {