ErickErickson commented on a change in pull request #1556:
URL: https://github.com/apache/lucene-solr/pull/1556#discussion_r436978229



##########
File path: solr/core/src/java/org/apache/solr/core/RequestParams.java
##########
@@ -85,32 +85,25 @@ public static ParamSet createParamSet(Map map, Long 
version) {
    * This converts Lists to arrays of strings. Because Solr expects
    * params to be String[]
    */
-
-  @SuppressWarnings({"unchecked", "rawtypes"})
-  private static Map getMapCopy(Map value) {
-    @SuppressWarnings({"rawtypes"})
-    Map copy = new LinkedHashMap<>();
-    for (Object o1 : value.entrySet()) {
-      @SuppressWarnings({"rawtypes"})
-      Map.Entry entry = (Map.Entry) o1;
+  private static Map<String,String[]> getMapCopy(Map<String,?> value) {
+    Map<String, String[]> copy = new LinkedHashMap<>();
+    for (Map.Entry<String, ?> entry : value.entrySet()) {
       if ("".equals(entry.getKey())) {
-        copy.put(entry.getKey(), entry.getValue());
-        continue;
+        // nocommit
+        // copy.put(entry.getKey(), entry.getValue());

Review comment:
       This smells badly. If the key is "", then the raw value would be put in 
the return in the old code, even if null, whereas the changed code if the value 
was NOT null, it'd be the entry.getValue().toString() rather than 
entry.getValue().
   
   That said, I think the change is better and any place in the that relies on 
the old behavior should be fixed.




----------------------------------------------------------------
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...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to