jainankitk commented on code in PR #15053:
URL: https://github.com/apache/lucene/pull/15053#discussion_r2274763170


##########
lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/DOMUtils.java:
##########
@@ -99,45 +89,27 @@ public static String getAttributeWithInheritance(Element 
element, String attribu
     return result;
   }
 
-  /* Convenience method where there is only one child Element of a given name 
*/
-  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;
-  }

Review Comment:
   Same goes for these public methods



##########
lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/DOMUtils.java:
##########
@@ -161,45 +133,12 @@ private static void getTextBuffer(Node e, StringBuilder 
sb) {
             sb.append(kid.getNodeValue());
             break;
           }
-        case Node.ELEMENT_NODE:
-          {
-            getTextBuffer(kid, sb);
-            break;
-          }
-        case Node.ENTITY_REFERENCE_NODE:
+        case Node.ELEMENT_NODE, Node.ENTITY_REFERENCE_NODE:
           {
             getTextBuffer(kid, sb);
             break;
           }
       }
     }
   }
-
-  /**
-   * Helper method to parse an XML file into a DOM tree, given a reader.
-   *
-   * @param is reader of the XML file to be parsed
-   * @return an org.w3c.dom.Document object
-   */
-  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 {

Review Comment:
   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



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to