Fix InterfaceTemplate documentation 67/83667/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 15 Aug 2019 11:04:26 +0000 (13:04 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 15 Aug 2019 11:49:34 +0000 (13:49 +0200)
InterfaceTemplate will fail to instantiate with a NPE if a null
type is ever passed in. Fix documentation and remove dead code.

Change-Id: Ief395cbf0d4d417e8041de39feee1e50d09157e0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit fd4efcfa21a9fcd2123bcef95cfeebdbe7f2785a)

binding/mdsal-binding-java-api-generator/src/main/java/org/opendaylight/mdsal/binding/java/api/generator/InterfaceTemplate.xtend

index 8f71efaefe8e26436e39010c2f102a77d7a0e616..559d7174ae3645aeba7be2d82db141fbee94725d 100644 (file)
@@ -50,14 +50,10 @@ class InterfaceTemplate extends BaseTemplate {
      * Creates the instance of this class which is used for generating the interface file source
      * code from <code>genType</code>.
      *
-     * @throws IllegalArgumentException if <code>genType</code> equals <code>null</code>
+     * @throws NullPointerException if <code>genType</code> is <code>null</code>
      */
     new(GeneratedType genType) {
         super(genType)
-        if (genType === null) {
-            throw new IllegalArgumentException("Generated type reference cannot be NULL!")
-        }
-
         consts = genType.constantDefinitions
         methods = genType.methodDefinitions
         enums = genType.enumerations