Migrate callers of IncorrectNestingException.create() 91/106191/1
authorRobert Varga <robert.varga@pantheon.tech>
Sun, 28 May 2023 13:03:34 +0000 (15:03 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Sun, 28 May 2023 13:03:34 +0000 (15:03 +0200)
The static factory method is quite useless, migrate aware from it.

Change-Id: I386d8d13585b8a1627460615e8c84772fe9e21a1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/SchemaRootCodecContext.java

index 220f78a24d6141491344cbbe7d9b7f437417a3cc..47386d773c898f037a5404704ab981a8eac35780 100644 (file)
@@ -161,8 +161,7 @@ final class SchemaRootCodecContext<D extends DataObject> extends DataContainerCo
                 final var child = childNonNull(type.schemaTreeChild(qname), qname,
                     "Argument %s is not valid child of %s", qname, type);
                 if (!(child instanceof DataRuntimeType)) {
-                    throw IncorrectNestingException.create("Argument %s is not valid data tree child of %s", qname,
-                        type);
+                    throw new IncorrectNestingException("Argument %s is not valid data tree child of %s", qname, type);
                 }
 
                 // TODO: improve this check?
@@ -271,7 +270,7 @@ final class SchemaRootCodecContext<D extends DataObject> extends DataContainerCo
         if (childSchema instanceof CompositeRuntimeType composite && childSchema instanceof DataRuntimeType) {
             return DataContainerCodecPrototype.from(key, composite, factory()).get();
         }
-        throw IncorrectNestingException.create("%s is not a valid data tree child of %s", key, this);
+        throw new IncorrectNestingException("%s is not a valid data tree child of %s", key, this);
     }
 
     ActionCodecContext createActionContext(final Class<? extends Action<?, ?, ?>> action) {