RFR: 8333344: JMX attaching of Subject does not work when security manager not allowed [v6]

Kevin Walls kevinw at openjdk.org
Thu Jun 13 13:07:38 UTC 2024


On Wed, 12 Jun 2024 16:41:36 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Kevin Walls has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>    Undo test policy updates
>
> src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java line 1445:
> 
>> 1443:             } else {
>> 1444:                 throw new PrivilegedActionException(e);
>> 1445:             }
> 
> I assume there no chance that `Exception e` may already be a `PrivilegedActionException` here. You coud avoid casts by using instanceof patterns.
> 
> Suggestion:
> 
>             if (e instanceof RuntimeException rte) {
>                 throw  rte;
>             } else {
>                 throw new PrivilegedActionException(e);
>             }

ok yes will do that.  SecurityException was another carryover from before simplifying the updated calls, think it's no longer needed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19624#discussion_r1638181708


More information about the core-libs-dev mailing list