RFR (S) 8057936: java.net.URLClassLoader.findClass uses exceptions in control flow

David Holmes david.holmes at oracle.com
Wed Sep 10 12:39:49 UTC 2014


On 10/09/2014 10:30 PM, David Holmes wrote:
> Hi Claes,
>
> On 10/09/2014 8:11 PM, Claes Redestad wrote:
>> Hi,
>>
>> please review this simple patch to avoid raising
>> PrivilegedActionExceptions
>> when failing to find a class in URLClassLoader.
>>
>>   bug: https://bugs.openjdk.java.net/browse/JDK-8057936
>>   webrev: http://cr.openjdk.java.net/~redestad/8057936/webrev.2/
>
> I read the bug report and looked at the patch. I'm all for reducing the
> exception overhead, but why not just return the exception object
> directly and avoid the need to create a wrapper? Return object and check
> for a Class or Throwable - and rethrow the Throwable.

Sorry email lag - just saw the later version. If the null resource case 
buys you enough then fine. Otherwise next step is to return the 
Throwables :)

David

> David
>
>
>
>
>> /Claes



More information about the core-libs-dev mailing list