commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: svn commit: r1573561 - /commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/DelegatingConnection.java
Date Mon, 03 Mar 2014 20:38:03 GMT
On 03/03/2014 16:31, Gary Gregory wrote:
> It reads better to me.
> 
> Gary
> 
> -------- Original message --------
> From: Simone Tripodi <simonetripodi@apache.org> 
> Date:03/03/2014  10:40  (GMT-05:00) 
> To: Commons Developers List <dev@commons.apache.org> 
> Subject: Re: svn commit: r1573561 - /commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/DelegatingConnection.java

> 
> Hi there,
> just a matter of curiosity: would
> 
> +        if(traces != null && !traces.isEmpty() {
> 
> be better or not compared to
> 
> +        if(traces != null && traces.size() > 0) {
> 
> That should be the same, right?

My only concern at this point is performance and that size() call is way
below the noise level at this point.

I have no objection if folks want to paint that bike shed a different
colour as long as it has no measurable, negative impact on performance.

Mark


> TIA all the best
> -Simo
> 
> http://people.apache.org/~simonetripodi/
> http://twitter.com/simonetripodi
> 
> 
> On Mon, Mar 3, 2014 at 2:43 PM, <markt@apache.org> wrote:
> 
>> Author: markt
>> Date: Mon Mar  3 13:43:28 2014
>> New Revision: 1573561
>>
>> URL: http://svn.apache.org/r1573561
>> Log:
>> Another small performance tweak.
>>
>> Modified:
>>
>> commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/DelegatingConnection.java
>>
>> Modified:
>> commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/DelegatingConnection.java
>> URL:
>> http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/DelegatingConnection.java?rev=1573561&r1=1573560&r2=1573561&view=diff
>>
>> ==============================================================================
>> ---
>> commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/DelegatingConnection.java
>> (original)
>> +++
>> commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/DelegatingConnection.java
>> Mon Mar  3 13:43:28 2014
>> @@ -623,7 +623,7 @@ public class DelegatingConnection<C exte
>>           // Statement's when it is closed.
>>           // DBCP-288. Not all the traced objects will be statements
>>           List<AbandonedTrace> traces = getTrace();
>> -        if(traces != null) {
>> +        if(traces != null && traces.size() > 0) {
>>               Iterator<AbandonedTrace> traceIter = traces.iterator();
>>               while (traceIter.hasNext()) {
>>                   Object trace = traceIter.next();
>>
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message