RFR: 8344560: Add system property for patched runtime [v3]

Mandy Chung mchung at openjdk.org
Tue Nov 26 17:51:40 UTC 2024


On Fri, 22 Nov 2024 17:04:38 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

>> Please review this simple patch which adds a new external system property `jdk.patched` when the runtime has been patched with the `--patch-module` switch. This is useful for two reasons: 1) it allows one to determine at run-time whether or not `--patch-module` has been used (by querying the said property) 2) allows tools, such as `jlink` doing the same without needing to expose internal properties the JVM sets on initialization.
>> 
>> Testing:
>> 
>> - [x] GHA (includes new test)
>> - [x] New jtreg test 
>> 
>> Thoughts?
>
> Severin Gehwolf has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Mention jdk.patched in System class

I think that a system property indicating if the current runtime is patched or not provides just quite limited information and not as useful when diagnosis/troubleshooting.   Patching module content is intended for testing and debugging use and a corner case.    Developers may want to find out which modules are patched or possibly what classes would be patched.   If we had to introduce a system property about patching, would it be more useful to include the name of the modules being patched?

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

PR Comment: https://git.openjdk.org/jdk/pull/22277#issuecomment-2501579406


More information about the core-libs-dev mailing list