Re: RFR: 8272347: ObjectMethods::bootstrap should specify NPE if any argument except lookup is null [v3]
On Mon, 30 Aug 2021 01:45:49 GMT, Mandy Chung wrote: >> Vicente Romero has updated the pull request incrementally with one >> additional commit since the last revision: >> >> clarifying that the names parameter is ignored in some cases > > src/java.base/share/classes/java/lang/runtime/ObjectMethods.java line 345: > >> 343: Arrays.stream(getters).forEach(Objects::requireNonNull); >> 344: MethodType methodType; >> 345: if (type instanceof MethodType) > > Since you are modifying this file, do you mind taking Jesper's suggestion [1] > posted in another PR to use pattern matching. > > Suggestion: > > if (type instanceof MethodType mt) > methodType = mt; > > > [1] https://github.com/openjdk/valhalla/pull/528#discussion_r688100918 sure I will do this before pushing, thanks - PR: https://git.openjdk.java.net/jdk/pull/5226
Re: RFR: 8272347: ObjectMethods::bootstrap should specify NPE if any argument except lookup is null [v3]
On Thu, 26 Aug 2021 02:36:47 GMT, Vicente Romero wrote: >> Please review this simple PR along with the associated CSR. The PR is >> basically adding a line the the specification of method >> `java.lang.runtime.ObjectMethods::bootstrap` stating under what conditions a >> NPE will be thrown. >> >> TIA >> >> link to the [CSR](https://bugs.openjdk.java.net/browse/JDK-8272852) > > Vicente Romero has updated the pull request incrementally with one additional > commit since the last revision: > > clarifying that the names parameter is ignored in some cases Marked as reviewed by mchung (Reviewer). src/java.base/share/classes/java/lang/runtime/ObjectMethods.java line 345: > 343: Arrays.stream(getters).forEach(Objects::requireNonNull); > 344: MethodType methodType; > 345: if (type instanceof MethodType) Since you are modifying this file, do you mind taking Jesper's suggestion [1] posted in another PR to use pattern matching. Suggestion: if (type instanceof MethodType mt) methodType = mt; [1] https://github.com/openjdk/valhalla/pull/528#discussion_r688100918 - PR: https://git.openjdk.java.net/jdk/pull/5226
Re: RFR: 8272347: ObjectMethods::bootstrap should specify NPE if any argument except lookup is null [v3]
> Please review this simple PR along with the associated CSR. The PR is > basically adding a line the the specification of method > `java.lang.runtime.ObjectMethods::bootstrap` stating under what conditions a > NPE will be thrown. > > TIA > > link to the [CSR](https://bugs.openjdk.java.net/browse/JDK-8272852) Vicente Romero has updated the pull request incrementally with one additional commit since the last revision: clarifying that the names parameter is ignored in some cases - Changes: - all: https://git.openjdk.java.net/jdk/pull/5226/files - new: https://git.openjdk.java.net/jdk/pull/5226/files/89086ca1..102cd1aa Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=5226&range=02 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=5226&range=01-02 Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/5226.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/5226/head:pull/5226 PR: https://git.openjdk.java.net/jdk/pull/5226