[jboss-cvs] JBossCache/src/org/jboss/cache/marshall ...

Manik Surtani msurtani at belmont.prod.atl2.jboss.com
Wed Aug 30 06:51:47 EDT 2006


  User: msurtani
  Date: 06/08/30 06:51:47

  Modified:    src/org/jboss/cache/marshall  MethodCall.java
  Log:
  Removed misleading equals() method and corresponding hashCode() method
  
  Revision  Changes    Path
  1.2       +56 -71    JBossCache/src/org/jboss/cache/marshall/MethodCall.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: MethodCall.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/marshall/MethodCall.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- MethodCall.java	25 Aug 2006 14:10:08 -0000	1.1
  +++ MethodCall.java	30 Aug 2006 10:51:47 -0000	1.2
  @@ -12,13 +12,13 @@
    * An extension of the JGroups MethodCall class.  The reason for this subclass is a minor
    * optimisation in the way method IDs are dealt with. The JGroups class of the same name uses
    * a short as a method id, which is more efficient as far as network streaming is concerned.
  - *
  + * <p/>
    * However, JBossCache uses this id for a lot of == and switch comparisons.  Java, being an
    * integer oriented virtual machine, goes through a lot of extra steps when performing such simple
    * comparisons or arithmetic on non-integer numeric types.
  - *
  + * <p/>
    * See <a href="http://www.liemur.com/Articles/FineTuningJavaCode-IntOrientedMachine.html">http://www.liemur.com/Articles/FineTuningJavaCode-IntOrientedMachine.html</a>
  - *
  + * <p/>
    * Thanks to Elias Ross/genman for this info.
    *
    * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
  @@ -53,34 +53,19 @@
           return methodIdInteger;
       }
   
  -    public boolean equals(Object o)
  -    {
  -        if (this == o) return true;
  -        if (o == null || getClass() != o.getClass()) return false;
  -
  -        final MethodCall that = (MethodCall) o;
  -
  -        return methodIdInteger == that.methodIdInteger && super.equals(o);
  -
  -    }
  -
  -    public int hashCode()
  -    {
  -        return super.hashCode() * 10 + methodIdInteger;
  -    }
  -
  -
       public String toString()
       {
  -        StringBuffer ret=new StringBuffer();
  -        boolean first=true;
  +      StringBuffer ret = new StringBuffer();
  +      boolean first = true;
           ret.append("MethodName: ");
           ret.append(method_name);
           ret.append("; MethodIdInteger: ");
           ret.append(methodIdInteger);
           ret.append("; Args: (");
  -        if(args != null) {
  -            for(int i=0; i < args.length; i++) {
  +      if (args != null)
  +      {
  +         for (int i = 0; i < args.length; i++)
  +         {
                   if (first)
                   {
                       first = false;
  
  
  



More information about the jboss-cvs-commits mailing list