Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 31605 invoked from network); 13 Oct 2010 23:29:19 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Oct 2010 23:29:19 -0000 Received: (qmail 515 invoked by uid 500); 13 Oct 2010 23:29:18 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 307 invoked by uid 500); 13 Oct 2010 23:29:18 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 300 invoked by uid 99); 13 Oct 2010 23:29:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Oct 2010 23:29:18 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Oct 2010 23:29:18 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3C14A23889BF; Wed, 13 Oct 2010 23:28:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@commons.apache.org From: ggregory@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101013232822.3C14A23889BF@eris.apache.org> 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 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 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)); } }