-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Cleanup DOMUtils #15053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Cleanup DOMUtils #15053
Conversation
Signed-off-by: Sandesh Kumar <[email protected]>
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]>
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 { |
There was a problem hiding this comment.
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
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; | ||
} |
There was a problem hiding this comment.
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
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! |
Description
Code cleanup of
DOMUtils
classBoolean#valueOf
changed toBoolean#parseBoolean
deflt
->defaultValue