Skip to content

Commit ebffe6a

Browse files
jxblummhalbritter
authored andcommitted
Simplify findChild method in BomPlugin
See gh-43773 Signed-off-by: John Blum <jblum0@gmail.com>
1 parent aa4ae89 commit ebffe6a

File tree

1 file changed

+2
-7
lines changed
  • buildSrc/src/main/java/org/springframework/boot/build/bom

1 file changed

+2
-7
lines changed

buildSrc/src/main/java/org/springframework/boot/build/bom/BomPlugin.java

+2-7
Original file line numberDiff line numberDiff line change
@@ -269,13 +269,8 @@ private Node findOrCreateNode(Node parent, String... path) {
269269

270270
private Node findChild(Node parent, String name) {
271271
for (Object child : parent.children()) {
272-
if (child instanceof Node node) {
273-
if ((node.name() instanceof QName qname) && name.equals(qname.getLocalPart())) {
274-
return node;
275-
}
276-
if (name.equals(node.name())) {
277-
return node;
278-
}
272+
if (isNodeWithName(child, name)) {
273+
return (Node) child;
279274
}
280275
}
281276
return null;

0 commit comments

Comments
 (0)