risdenk commented on code in PR #1482:
URL: https://github.com/apache/solr/pull/1482#discussion_r1146272227


##########
solr/core/src/java/org/apache/solr/request/SimpleFacets.java:
##########
@@ -595,7 +595,7 @@ private NamedList<Integer> getTermCounts(String field, 
Integer mincount, ParsedP
           break;
         case UIF:
           // Emulate the JSON Faceting structure so we can use the same 
parsing classes
-          Map<String, Object> jsonFacet = new HashMap<>(13);
+          Map<String, Object> jsonFacet = CollectionUtil.newHashMap(13);

Review Comment:
   Hmmm well after 5cf9f86, Map.of causes a NPE since there are null keys :( 
   
   ```
    Caused by: java.lang.NullPointerException
   2023-03-23T14:11:24.5115573Z   2>    at 
java.util.Objects.requireNonNull(Objects.java:221) ~[?:?]
   2023-03-23T14:11:24.5116312Z   2>    at 
java.util.KeyValueHolder.<init>(KeyValueHolder.java:60) ~[?:?]
   2023-03-23T14:11:24.5116875Z   2>    at java.util.Map.entry(Map.java:1659) 
~[?:?]
   2023-03-23T14:11:24.5117685Z   2>    at 
org.apache.solr.request.SimpleFacets.getTermCounts(SimpleFacets.java:617) 
~[main/:?]
   2023-03-23T14:11:24.5118298Z   2>    at 
org.apache.solr.request.SimpleFacets.getTermCounts(SimpleFacets.java:425) 
~[main/:?]
   2023-03-23T14:11:24.5119110Z   2>    at 
org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(SimpleFacets.java:911)
 ~[main/:?]
   2023-03-23T14:11:24.5119635Z   2>    ... 59 more
   ```
   
   I'm going to revert that change just to simplify this.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to