On Fri, 13 Sep 2024 15:57:41 GMT, Jorn Vernee <jver...@openjdk.org> wrote:
>> Claes Redestad has updated the pull request incrementally with six >> additional commits since the last revision: >> >> - no clone >> - Update src/java.base/share/classes/java/lang/invoke/MethodHandles.java >> >> Co-authored-by: ExE Boss <3889017+exe-b...@users.noreply.github.com> >> - Update src/java.base/share/classes/java/lang/invoke/MethodHandles.java >> >> Co-authored-by: ExE Boss <3889017+exe-b...@users.noreply.github.com> >> - Update src/java.base/share/classes/java/lang/invoke/MethodHandles.java >> >> Co-authored-by: ExE Boss <3889017+exe-b...@users.noreply.github.com> >> - Update src/java.base/share/classes/java/lang/invoke/MethodHandles.java >> >> Co-authored-by: ExE Boss <3889017+exe-b...@users.noreply.github.com> >> - Update >> src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java >> >> Co-authored-by: ExE Boss <3889017+exe-b...@users.noreply.github.com> > > src/java.base/share/classes/java/lang/invoke/MethodHandles.java line 2223: > >> 2221: } >> 2222: >> 2223: return makeHiddenClassDefiner(bytes.clone(), false, >> options.clone()) > > Why do we need to clone here, but not in `defineHiddenClass`? > `makeHiddenClassDefiner` seems to always turn the options in flags right > away, so I don't think we need to clone? I started out adding the .clone() as a standard precaution, analyzed to make sure it wasn't needed then removed it in one out of two places. Now both removed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21002#discussion_r1759615920