Jdurham2843 commented on a change in pull request #243:
URL: https://github.com/apache/solr/pull/243#discussion_r686484583



##########
File path: solr/solrj/src/java/org/apache/solr/client/solrj/io/Tuple.java
##########
@@ -275,15 +295,32 @@ public void setMetrics(Map<String, Map<?,?>> metrics) {
   }
 
   public Tuple clone() {
-    Tuple clone = new Tuple();
-    clone.fields.putAll(fields);
-    // TODO This doesn't copy EOF/Exception 
https://issues.apache.org/jira/browse/SOLR-15480
+    Tuple clone = new Tuple(this.fields);
+    if (this.fieldNames != null) {
+      clone.fieldNames = new ArrayList<>(this.fieldNames);
+    }
+    if (this.fieldLabels != null) {
+      clone.fieldLabels = new HashMap<>(this.fieldLabels);
+    }
     return clone;
   }
   
   public void merge(Tuple other) {
-    // TODO This doesn't copy EOF/Exception 
https://issues.apache.org/jira/browse/SOLR-15480
-    fields.putAll(other.getFields());
+    this.putAll(other.getFields());
+    if (other.fieldNames != null) {
+      if (this.fieldNames != null) {
+        this.fieldNames.addAll(other.fieldNames);
+      } else {
+        this.fieldNames = new ArrayList<>(other.fieldNames);
+      }
+    }
+    if (other.fieldLabels != null) {
+      if (this.fieldLabels != null) {
+        this.fieldLabels.putAll(other.fieldLabels);
+      } else {
+        this.fieldLabels = new HashMap<>(other.fieldLabels);

Review comment:
       See 2a of 3. I think the same should apply here as well.




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