Github user dsmiley commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/430#discussion_r208092604
  
    --- Diff: solr/solrj/src/java/org/apache/solr/common/util/XML.java ---
    @@ -101,83 +102,53 @@ public final static void writeXML(Writer out, String 
tag, String val) throws IOE
         }
       }
     
    +  /** does NOT escape character data in val or attributes, must already be 
valid XML */
       public final static void writeUnescapedXML(Writer out, String tag, 
String val, Object... attrs) throws IOException {
    -    writeUnescapedXML(out, tag, (writer1) -> writer1.write(val), attrs);
    +    writeUnescapedAttrXML(out, tag, (writer1) -> writer1.write(val), 
attrs);
       }
     
    -  /** does NOT escape character data in val, must already be valid XML */
    -  public final static void writeUnescapedXML(Writer out, String tag, 
Writable val, Object... attrs) throws IOException {
    +  /** does NOT escape character data in attributes, must already be valid 
XML */
    +  public final static void writeUnescapedAttrXML(Writer out, String tag, 
Writable valWritable, Object... attrs) throws IOException {
    --- End diff --
    
    I see your point.  I'm not sure it's worth introducing another name for it 
though... it'd only be an issue in a couple places, and this class ought not to 
be used by others generally even though it's possible.  I'm not even sure I 
like writeElementXML because it's name is suggestive the other similar methods 
aren't Elements when they all are (since why aren't they named similarly).  If 
you really want to differentiate by name, perhaps having a writeEmptyXML method 
for callers who expressly pass null (again; that's only 2 places)


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to