madrob commented on a change in pull request #195:
URL: https://github.com/apache/solr/pull/195#discussion_r660007488



##########
File path: 
solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java
##########
@@ -442,23 +442,23 @@ public void modifyRequest(ResponseBuilder rb, 
SearchComponent who, ShardRequest
 
 
   @Override
-  @SuppressWarnings({"unchecked", "rawtypes"})
   public void handleResponses(ResponseBuilder rb, ShardRequest sreq) {
 
     if (!rb.doExpand) {
       return;
     }
     if ((sreq.purpose & ShardRequest.PURPOSE_GET_FIELDS) != 0) {
       SolrQueryRequest req = rb.req;
-      NamedList expanded = (NamedList) req.getContext().get("expanded");
+      @SuppressWarnings("unchecked")
+      NamedList<Object> expanded = (NamedList<Object>) 
req.getContext().get("expanded");
       if (expanded == null) {
-        expanded = new SimpleOrderedMap();
+        expanded = new SimpleOrderedMap<>();
         req.getContext().put("expanded", expanded);
       }
 
       for (ShardResponse srsp : sreq.responses) {
-        NamedList response = srsp.getSolrResponse().getResponse();
-        NamedList ex = (NamedList) response.get("expanded");
+        NamedList<Object> response = srsp.getSolrResponse().getResponse();
+        NamedList<?> ex = (NamedList<?>) response.get("expanded");

Review comment:
       `getResponse()` returns `<Object>` so I went with that, `expanded` has 
items added to it (L465) so it can't be `<?>`. Meanwhile, we're just reading 
values out of `ex` so I was lazy and made it wildcard. I suppose we could do 
`NamedList<SolrDocumentList>` here because we cast it later but I was going for 
quantity over quality at some point here.




-- 
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...@solr.apache.org

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



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

Reply via email to