On Fri, 15 Nov 2024 01:20:34 GMT, Alexander Matveev <almat...@openjdk.org> wrote:
>> Alexey Semenyuk has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Remove redundant "method.setAccessible(true);" calls > > test/jdk/tools/jpackage/helpers/jdk/jpackage/test/TestMethodSupplier.java > line 433: > >> 431: withTestAnnotations = true; >> 432: } >> 433: verifyAnnotationsCorrect(method); > > This code blocks looks confusing. Why we need `method.setAccessible(true)` > for all methods? Also, `if` statement looks confusing with empty `if > (withTestAnnotations).` Good point about `method.setAccessible(true)`! Looks like it is needed when `Method::invoke()` is used, but not when querying annotations. Removed redundant `method.setAccessible(true)` calls. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21996#discussion_r1843967405