Review request for 7038565, for a findbugs warning for BatchUpdateException

Lance Andersen - Oracle Lance.Andersen at oracle.com
Fri Apr 22 19:34:27 UTC 2011


Hi Remi,

I pushed a revised webrev 

http://cr.openjdk.java.net/~lancea/7038565/webrev.01/


Regards,
lance
On Apr 22, 2011, at 2:22 PM, Rémi Forax wrote:

> 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


Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering 
1 Network Drive 
Burlington, MA 01803
Lance.Andersen at oracle.com




More information about the core-libs-dev mailing list