commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1022324 - /commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java
Date Wed, 13 Oct 2010 23:28:22 GMT
Author: ggregory
Date: Wed Oct 13 23:28:21 2010
New Revision: 1022324

URL: http://svn.apache.org/viewvc?rev=1022324&view=rev
Log:
Implement findbugs recomendation: ... invokes inefficient new Integer(int) constructor; use
Integer.valueOf(int) instead

Modified:
    commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java?rev=1022324&r1=1022323&r2=1022324&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java
(original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/StackKeyedObjectPool.java
Wed Oct 13 23:28:21 2010
@@ -434,10 +434,10 @@ public class StackKeyedObjectPool<K,V> e
     private void incrementActiveCount(K key) {
         _totActive++;
         Integer old = _activeCount.get(key);
-        if(null == old) {
-            _activeCount.put(key,new Integer(1));
+        if (null == old) {
+            _activeCount.put(key, Integer.valueOf(1));
         } else {
-            _activeCount.put(key,new Integer(old.intValue() + 1));
+            _activeCount.put(key, Integer.valueOf(old.intValue() + 1));
         }
     }
 
@@ -455,7 +455,7 @@ public class StackKeyedObjectPool<K,V> e
         } else if(active.intValue() <= 1) {
             _activeCount.remove(key);
         } else {
-            _activeCount.put(key, new Integer(active.intValue() - 1));
+            _activeCount.put(key, Integer.valueOf(active.intValue() - 1));
         }
     }
 



Mime
View raw message