Review request for 7038565, for a findbugs warning for BatchUpdateException
David Holmes
David.Holmes at oracle.com
Sat Apr 23 10:11:40 UTC 2011
Rémi Forax said the following on 04/23/11 04:22:
> On 04/22/2011 06:51 PM, Lance Andersen - Oracle wrote:
>>>
>>> You should use clone() instead of Arrays.copyOf.
>>
>> Can you explain why you have a preference for clone() in this case?
>
> It does the job :)
> Arrays.copyOf() allows to resize the array.
So? That's not a reason to not use Arrays.copyOf. Look at copyOf as the
new improved version of clone.
David
>>> Also updateCounts should be declared final
>>
>> I will make updateCounts final.
>>> and initialized like this:
>>>
>>> public BatchUpdateException(String reason, String SQLState, int
>>> vendorCode,
>>> int []updateCounts,Throwable cause) {
>>> super(reason, SQLState, vendorCode, cause);
>>> this.updateCounts = (updateCounts == null)?
>>> null:updateCounts.clone();
>>> }
>>>
>>
>> Regards,
>> lance
>
> regards,
> rémi
More information about the core-libs-dev
mailing list