Can I please get a review of this change which proposes to address the issue 
noted in https://bugs.openjdk.org/browse/JDK-8388553?

`java.lang.reflect.ProxyGenerator`, a JDK internal class that relates to 
`java.lang.reflect.Proxy` API, has an (undocumented internal) system property 
which can be set to `true` to write out the bytes of the `Proxy` class 
generated dynamically by this code. Before Java 24, when SecurityManager was 
around, this code of writing out to a file, was wrapped in a 
`PrivilegedAction`.  When we updated this code during the removal of 
SecurityManager in https://bugs.openjdk.org/browse/JDK-8344011, we accidentally 
returned `null` from the `if` block after writing out the class bytes. This 
effectively results in the `ProxyGenerator.generateProxyClass(...)` method 
returning null for any `Proxy` class it generates when that internal system 
property is set to true.

The commit in this PR fixes that oversight. The pre-existing 
`test/jdk/java/lang/reflect/Proxy/Basic1.java` jtreg test has been updated to 
have a `@run` with this system property value set to `true`. The test fails (as 
expected) without the proposed source fix and passes (as expected) with it.

tier testing is currently in progress but I don't expect any surprises there. 
Tomorrow I will go through the original commit of JDK-8344011 just to check if 
there are any other places that might need attention.

---------
- [x] I confirm that I make this contribution in accordance with the [OpenJDK 
Interim AI Policy](https://openjdk.org/legal/ai).

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

Commit messages:
 - copyright year on test file
 - 8388553: Proxy class generation fails when the 
jdk.proxy.ProxyGenerator.saveGeneratedFiles is set to true
 - 8388553: introduce a test

Changes: https://git.openjdk.org/jdk/pull/31993/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=31993&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8388553
  Stats: 13 lines in 2 files changed: 3 ins; 6 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/31993.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/31993/head:pull/31993

PR: https://git.openjdk.org/jdk/pull/31993

Reply via email to