RFR: (jaxp) 8005473 : Warnings compiling jaxp

Joe Wang huizhe.wang at oracle.com
Thu Dec 27 18:03:06 UTC 2012


Thanks all!

I've updated the webrev with Remi's suggestion.

-Joe

On 12/27/2012 5:25 AM, Remi Forax wrote:
> On 12/27/2012 12:06 AM, Joe Wang wrote:
>> Hi,
>>
>> This is a patch to clean up compiling warnings in jaxp.
>>
>> Bug: http://bugs.sun.com/view_bug.do?bug_id=8005473
>> Webrev: http://cr.openjdk.java.net/~joehw/jdk8/8005473/webrev/
>>
>> Thanks,
>> Joe
>
> Hi Joe,
>   Method method = clazz.getMethod(DOM_LEVEL3_METHOD);
> is equivalent to
>   Method method = clazz.getMethod(DOM_LEVEL3_METHOD, new Class<?>[0]);
> so you allocate an empty array each time you call getMethod.
>
> A better patch is to cast null to Class<?>[] (or Object[] for invoke)
>    Method method = clazz.getMethod(DOM_LEVEL3_METHOD, (Class<?>[])null);
>
> cheers,
> Rémi
>
>



More information about the core-libs-dev mailing list