[lworld] RFR: 8327639: [lworld] test/jdk/java/lang/invoke/callerSensitive/CallerSensitiveAccess.java fails with --enable-preview

Mandy Chung mchung at openjdk.org
Mon Mar 11 17:18:06 UTC 2024


On Mon, 11 Mar 2024 14:31:24 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

> The test contains a bug in which it attempts to use streams from ModuleReader.list() after the ModuleReader has been closed.  Closing ModuleReader closes the underlying streams to the Jar/Zip file.
> 
> The bug is only exercised when a patched module is read. Currently, --enable-preview uses module patching of the java.base module to include a set of classes that have been converted to be value classes.
> 
> The test is modified to cache the results of the stream in a List and keep the scoped structure used by try-with-resources.

Thanks for fixing this.    It would be good to compute `callerSensitiveMethods(Object.class.getModule())` once and save the resulting List in a static field.   Otherwise looks good.

-------------

Marked as reviewed by mchung (Committer).

PR Review: https://git.openjdk.org/valhalla/pull/1042#pullrequestreview-1928519623



More information about the valhalla-dev mailing list