Jdurham2843 commented on a change in pull request #243:
URL: https://github.com/apache/solr/pull/243#discussion_r686473560
##########
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);
+ }
Review comment:
That would be the perfect place for it. After making the changes
regarding your initial suggestions about using the copy-constructor for just
field labels, I wrote a new copy-constructor to handle the three fields, and
didn't make the connection that I could follow the same advice here! I'll make
that change.
--
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]