RFR: 8345079: Simplify/cleanup Exception handling in RMIConnectionImpl [v2]

Kevin Walls kevinw at openjdk.org
Fri Jan 17 19:16:35 UTC 2025


On Fri, 17 Jan 2025 18:18:48 GMT, Kevin Walls <kevinw at openjdk.org> wrote:

>> src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java line 212:
>> 
>>> 210:                 throw (SecurityException) e;
>>> 211:             if (e instanceof RuntimeException)
>>> 212:                 throw (RuntimeException) e;
>> 
>> Throughout all these changes: SecurityException is  a RuntimeException, so you do not need to check for both.
>> 
>> An alternative is to:
>> 
>> } catch (RuntimeException r) {
>>     throw r;
>> } catch (Exception e) {
>>     ....
>> }
>
> OK sure, I was just making it super explicit.  Can update.

Updated - re-ran all of the management tests, looks good.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23072#discussion_r1920640875


More information about the serviceability-dev mailing list