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

Kevin Walls kevinw at openjdk.org
Fri Jun 14 14:03:14 UTC 2024


On Fri, 14 Jun 2024 12:03:07 GMT, Weijun Wang <weijun at openjdk.org> wrote:

>> Kevin Walls has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Separate SM allowed and not allowed cases
>
> src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java line 1461:
> 
>> 1459:                 throw rte;
>> 1460:             } else {
>> 1461:                 throw new PrivilegedActionException(e);
> 
> The 4 lines above seems unnecessary now. Plus, do not wrap `PrivilegedActionException` inside `PrivilegedActionException`.

It needs to recognise and throw RuntimeException so that a SecurityException isn't wrapped in a PrivilegedActionException (which gets caught by those blocks of code which call extractException(pe) and  look at what Exception it contains).

(test/jdk/javax/management/remote/mandatory/notif/NotificationAccessControllerTest.java tests this)

I can add a check to make sure PrivilgedActionException doesn't get wrapped.  Daniel I think mentioned this also.

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

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


More information about the serviceability-dev mailing list