qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject svn commit: r947640 - /qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQConstant.java
Date Mon, 24 May 2010 13:38:23 GMT
Author: robbie
Date: Mon May 24 13:38:23 2010
New Revision: 947640

URL: http://svn.apache.org/viewvc?rev=947640&view=rev
Log:
QPID-2610: Corrected Map usage and removed Integer object creation

Applied patch from Andrew Kennedy <andrew.international@gmail.com>

Modified:
    qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQConstant.java

Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQConstant.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQConstant.java?rev=947640&r1=947639&r2=947640&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQConstant.java (original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQConstant.java Mon
May 24 13:38:23 2010
@@ -46,7 +46,7 @@ import org.apache.qpid.framing.AMQShortS
 public final class AMQConstant
 {
     /** Defines a map from codes to constants. */
-    private static Map _codeMap = new HashMap();
+    private static Map<Integer, AMQConstant> _codeMap = new HashMap<Integer, AMQConstant>();
 
     /** Indicates that the method completed successfully. */
     public static final AMQConstant REPLY_SUCCESS = new AMQConstant(200, "reply success",
true);
@@ -181,7 +181,7 @@ public final class AMQConstant
         _name = new AMQShortString(name);
         if (map)
         {
-            _codeMap.put(new Integer(code), this);
+            _codeMap.put(Integer.valueOf(code), this);
         }
     }
 
@@ -195,7 +195,7 @@ public final class AMQConstant
      */
     public static AMQConstant getConstant(int code)
     {
-        AMQConstant c = (AMQConstant) _codeMap.get(new Integer(code));
+        AMQConstant c = _codeMap.get(Integer.valueOf(code));
         if (c == null)
         {
             c = new AMQConstant(code, "unknown code", false);



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message