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

    https://github.com/apache/lucene-solr/pull/385#discussion_r191392147
  
    --- Diff: solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java 
---
    @@ -175,69 +176,92 @@ public String getHashableId() {
         return id;
       }
     
    -  public boolean isBlock() {
    -    return solrDoc.hasChildDocuments();
    +  /**
    +   * @return String id to hash
    +   */
    +  public String getHashableId() {
    +    return getHashableId(solrDoc);
       }
     
    -  @Override
    -  public Iterator<Document> iterator() {
    -    return new Iterator<Document>() {
    -      Iterator<SolrInputDocument> iter;
    -
    -      {
    -        List<SolrInputDocument> all = flatten(solrDoc);
    -
    -        String idField = getHashableId();
    -
    -        boolean isVersion = version != 0;
    +  public boolean isBlock() {
    --- End diff --
    
    this is a public method on AddUpdateCommand; any URP could conceivably call 
this, which would be pretty bad if it built the Lucene docs by side-effect.  
That's a surprising thing for a innocent looking getter/is method; even if it's 
made private.    Alternatively, what I suggested originally, is to remove 
isBlock; instead make the caller decide what to do with the resulting list.


---

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

Reply via email to