cpoerschke commented on a change in pull request #169:
URL: https://github.com/apache/solr/pull/169#discussion_r653753413



##########
File path: 
solr/solrj/src/java/org/apache/solr/client/solrj/io/ops/GroupOperation.java
##########
@@ -106,19 +104,15 @@ public Explanation toExplanation(StreamFactory factory) 
throws IOException {
       });
   }
 
-  @SuppressWarnings({"unchecked"})
   public Tuple reduce() {
-    @SuppressWarnings({"rawtypes"})
-    LinkedList ll = new LinkedList();
+    LinkedList<Map<String,Object>> ll = new LinkedList<>();
     while(priorityQueue.size() > 0) {
       ll.addFirst(priorityQueue.poll().getFields());
       //This will clear priority queue and so it will be ready for the next 
group.
     }
 
-    @SuppressWarnings({"rawtypes"})
-    List<Map> list = new ArrayList<>(ll);
-    @SuppressWarnings({"rawtypes"})
-    Map groupHead = list.get(0);
+    List<Map<String,Object>> list = new ArrayList<>(ll);
+    Map<String,Object> groupHead = list.get(0);

Review comment:
       observation re: existing code i.e. unrelated to the changes in this pull 
request: `list` could be empty at this point

##########
File path: 
solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/MonteCarloEvaluator.java
##########
@@ -35,21 +35,19 @@
 public class MonteCarloEvaluator extends RecursiveEvaluator {
   protected static final long serialVersionUID = 1L;
 
-  @SuppressWarnings({"rawtypes"})
-  private Map variables = new LinkedHashMap();
+  private Map<String, Object> variables = new LinkedHashMap<>();
 
-  @SuppressWarnings({"unchecked"})
   public MonteCarloEvaluator(StreamExpression expression, StreamFactory 
factory) throws IOException{
     super(expression, factory);
 
     List<StreamExpressionNamedParameter> namedParams = 
factory.getNamedOperands(expression);
     //Get all the named params
     Set<String> echo = null;
     boolean echoAll = false;
-    for(StreamExpressionParameter np : namedParams) {
-      String name = ((StreamExpressionNamedParameter)np).getName();
+    for(StreamExpressionNamedParameter np : namedParams) {
+      String name = np.getName();
 
-      StreamExpressionParameter param = 
((StreamExpressionNamedParameter)np).getParameter();
+      StreamExpressionParameter param = np.getParameter();

Review comment:
       Just pushed a commit for similar change in two other classes also.




-- 
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.

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