Skip to content

Conversation

sandeshkr419
Copy link
Contributor

@sandeshkr419 sandeshkr419 commented Aug 13, 2025

Description

Code cleanup of DOMUtils class

  • Remove unused methods
  • Remove unnecessary null checks
  • Removed unnecessary boolean value boxing: Boolean#valueOf changed to Boolean#parseBoolean
  • Rename: deflt -> defaultValue

Signed-off-by: Sandesh Kumar <[email protected]>
Copy link
Contributor

This PR does not have an entry in lucene/CHANGES.txt. Consider adding one. If the PR doesn't need a changelog entry, then add the skip-changelog label to it and you will stop receiving this reminder on future updates to the PR.

Signed-off-by: Sandesh Kumar <[email protected]>
@github-actions github-actions bot added this to the 10.3.0 milestone Aug 13, 2025
Comment on lines -184 to -196
public static Document loadXML(Reader is) {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = null;

try {
db = dbf.newDocumentBuilder();
} catch (Exception se) {
throw new RuntimeException("Parser configuration error", se);
}

// Step 3: parse the input file
org.w3c.dom.Document doc = null;
try {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am assuming this method is unused, right? Even then, we cannot remove public method from public class without deprecating, as it might break clients

Comment on lines -103 to -116
public static String getChildTextByTagName(Element e, String tagName) {
Element child = getChildByTagName(e, tagName);
return child != null ? getText(child) : null;
}

/* Convenience method to append a new child with text*/
public static Element insertChild(Element parent, String tagName, String text) {
Element child = parent.getOwnerDocument().createElement(tagName);
parent.appendChild(child);
if (text != null) {
child.appendChild(child.getOwnerDocument().createTextNode(text));
}
return child;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same goes for these public methods

Copy link
Contributor

This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the [email protected] list. Thank you for your contribution!

@github-actions github-actions bot added the Stale label Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants