Modernize yang-data-impl
[yangtools.git] / data / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / builder / impl / ImmutableUnkeyedListEntryNodeBuilder.java
index ae80a7e80e4661a8d34448a80757e264e55ff996..e15d08bf6920263cc9479f8e32ff32791954cab9 100644 (file)
@@ -41,10 +41,10 @@ public class ImmutableUnkeyedListEntryNodeBuilder
 
     public static @NonNull DataContainerNodeBuilder<NodeIdentifier, UnkeyedListEntryNode> create(
             final UnkeyedListEntryNode node) {
-        if (!(node instanceof ImmutableUnkeyedListEntryNode)) {
-            throw new UnsupportedOperationException(String.format("Cannot initialize from class %s", node.getClass()));
+        if (!(node instanceof ImmutableUnkeyedListEntryNode immutableNode)) {
+            throw new UnsupportedOperationException("Cannot initialize from class " + node.getClass());
         }
-        return new ImmutableUnkeyedListEntryNodeBuilder((ImmutableUnkeyedListEntryNode) node);
+        return new ImmutableUnkeyedListEntryNodeBuilder(immutableNode);
     }
 
     @Override