User: ejort   
  Date: 02/03/29 02:17:19

  Modified:    src/main/org/jboss/invocation MarshalledInvocation.java
  Log:
  Fixed a memory leak in the method hashes
  
  Revision  Changes    Path
  1.8       +5 -9      jboss/src/main/org/jboss/invocation/MarshalledInvocation.java
  
  Index: MarshalledInvocation.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/invocation/MarshalledInvocation.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- MarshalledInvocation.java 7 Mar 2002 18:59:52 -0000       1.7
  +++ MarshalledInvocation.java 29 Mar 2002 10:17:18 -0000      1.8
  @@ -34,7 +34,7 @@
   *
   *   @see <related>
   *   @author  <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
  -*   @version $Revision: 1.7 $
  +*   @version $Revision: 1.8 $
   *   Revisions:
   *
   *   <p><b>Revisions:</b>
  @@ -76,7 +76,7 @@
      * @param   intf  
      * @return     
      */
  -   public static Map getInterfaceHashes(Class intf, boolean methodToLong)
  +   public static Map getInterfaceHashes(Class intf)
      {
         // Create method hashes
         Method[] methods = intf.getDeclaredMethods();
  @@ -103,11 +103,7 @@
               byte abyte0[] = messagedigest.digest();
               for(int j = 0; j < Math.min(8, abyte0.length); j++)
                  hash += (long)(abyte0[j] & 0xff) << j * 8;
  -            if (methodToLong)
  -               map.put(method, new Long(hash));
  -            else 
  -               map.put(new Long(hash), method);
  -         
  +            map.put(method.toString(), new Long(hash));
            }
            catch (Exception e)
            {
  @@ -169,7 +165,7 @@
         
         if (methodHashes == null)
         {
  -         methodHashes = getInterfaceHashes(method.getDeclaringClass(), true);
  +         methodHashes = getInterfaceHashes(method.getDeclaringClass());
            
            // Copy and add
            WeakHashMap newHashMap = new WeakHashMap();
  @@ -178,7 +174,7 @@
            hashMap = newHashMap;
         }
         
  -      return ((Long)methodHashes.get(method)).longValue();
  +      return ((Long)methodHashes.get(method.toString())).longValue();
      }
      
      // Constructors --------------------------------------------------
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to