On Fri, 14 Jun 2024 14:00:58 GMT, Kevin Walls <kev...@openjdk.org> wrote:

>> 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.

I still don't understand how a SecurityException could be wrapped into a PAE 
without these lines.

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

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

Reply via email to