On Wed, 21 Oct 2026 11:06:23 GMT, Chris Hegarty <[email protected]> wrote:

>> Fixes a rare NullPointerException in X500Principal.hashCode() and equals() 
>> on aarch64, where thisX500Name is null.
>> 
>> I made `thisX500Name` final. The field was non-final only because 
>> `readObject` sets it, and deserialization doesn't run a constructor. I used 
>> `Unsafe.putReference` in `readObject` for that, which is how the JDK handles 
>> this elsewhere:
>> 
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Chris Hegarty has updated the pull request with a new target base due to a 
> merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains four additional 
> commits since the last revision:
> 
>  - Merge remote-tracking branch 'upstream/master' into 
> x500principal-safe-publication
>  - volatile
>  - revert
>  - Make X500Principal.thisX500Name final to fix unsafe publication

Changing X500Principal.thisX500Name to be final, as you had in the first 
commit, would make this clearer. It would avoid need the need for 
X500Name.x500Principal volatile.

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

PR Comment: https://git.openjdk.org/jdk/pull/33253#issuecomment-6345546052

Reply via email to