reuvenlax commented on code in PR #41746:
URL: https://github.com/apache/beam/pull/41746#discussion_r4732738109
##########
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/Schema.java:
##########
@@ -1370,15 +1644,15 @@ public Builder addOptions(Options options) {
}
Options.Builder toBuilder() {
- return new Builder(new HashMap<>(this.options));
+ return this.options.isEmpty() ? new Builder() : new
Builder(this.options);
Review Comment:
This is incorrect. The Builder constructor _already_ makes a defensive copy
of the HashMap.
--
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]