RFR: 8349145: Make Class.getProtectionDomain() non-native [v4]
Coleen Phillimore
coleenp at openjdk.org
Thu Feb 6 12:15:13 UTC 2025
On Thu, 6 Feb 2025 07:29:26 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> @DanHeidinga suggested this for my other PR as a convention that's used for the j.l.Class constructor.
>
> I am still missing what can actually set a PD here, sorry. ??
Because the field is final, it has to be initialized in the constructor in Java code. My initial patch for modifiers chose to initialize to zero but that's not quite correct. The constructor cannot be called nor can it be made accessible with setAccessible(). So the constructor for java.lang.Class is essentially the Hotspot code JavaClasses::create_mirror(). This is where the PD is assigned.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23396#discussion_r1944618468
More information about the core-libs-dev
mailing list