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

    https://github.com/apache/lucene-solr/pull/385#discussion_r191775964
  
    --- Diff: solr/core/src/test/org/apache/solr/update/AddBlockUpdateTest.java 
---
    @@ -269,37 +269,27 @@ public void testExceptionThrown() throws Exception {
     
       @Test
       public void testSolrNestedFieldsList() throws Exception {
    -    SolrInputDocument document1 = new SolrInputDocument() {
    -      {
    -        final String id = id();
    -        addField("id", id);
    -        addField("parent_s", "X");
    -        addField("children",
    -            new ArrayList<SolrInputDocument>()
    -            {
    -              {
    -                add(sdoc("id", id(), "child_s", "y"));
    -                add(sdoc("id", id(), "child_s", "z"));
    -              }
    -            });
    -      }
    -    };
     
    -    SolrInputDocument document2 = new SolrInputDocument() {
    -      {
    -        final String id = id();
    -        addField("id", id);
    -        addField("parent_s", "A");
    -        addField("children",
    -            new ArrayList<SolrInputDocument>()
    -            {
    -              {
    -                add(sdoc("id", id(), "child_s", "b"));
    -                add(sdoc("id", id(), "child_s", "c"));
    -              }
    -            });
    -      }
    -    };
    +    final String id1 = id();
    +    List<SolrInputDocument> children1 = new ArrayList<SolrInputDocument>()
    --- End diff --
    
    Please avoid anonymous subclasses that exist for the sole purpose of 
building.  I think it's just as concise and clear to say 
`Arrays.asList(sdoc(...), sdoc(...), sdoc(...))`


---

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

Reply via email to