Skip to content

Commit

Permalink
Merge pull request #43773 from jxblum
Browse files Browse the repository at this point in the history
* pr/43773:
  Simplify findChild method in BomPlugin

Closes gh-43773
  • Loading branch information
mhalbritter committed Jan 15, 2025
2 parents aa4ae89 + ebffe6a commit e295063
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e295063

Please sign in to comment.