Review request for 7038565, for a findbugs warning for BatchUpdateException
Rémi Forax
forax at univ-mlv.fr
Fri Apr 22 18:22:35 UTC 2011
On 04/22/2011 06:51 PM, Lance Andersen - Oracle wrote:
> Hi Remi,
>
> Thank you for the feedback.
[...]
>>
>> 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.
>> 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