diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/BomPlugin.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/BomPlugin.java index 1d5a69f4df11..edb415458241 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/bom/BomPlugin.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/BomPlugin.java @@ -269,13 +269,8 @@ private Node findOrCreateNode(Node parent, String... path) { private Node findChild(Node parent, String name) { for (Object child : parent.children()) { - if (child instanceof Node node) { - if ((node.name() instanceof QName qname) && name.equals(qname.getLocalPart())) { - return node; - } - if (name.equals(node.name())) { - return node; - } + if (isNodeWithName(child, name)) { + return (Node) child; } } return null;