RFR: 8349145: Make Class.getProtectionDomain() non-native [v4]
Coleen Phillimore
coleenp at openjdk.org
Mon Feb 10 13:31:12 UTC 2025
On Mon, 10 Feb 2025 10:09:59 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> 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.
>
> Okay so this pattern of assigning the final fields in the constructor that is never called is just for appeasing the javac compiler.
Yes.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23396#discussion_r1948979011
More information about the core-libs-dev
mailing list