commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nico...@apache.org
Subject svn commit: r745775 - /commons/sandbox/monitoring/branches/modules/core/src/main/java/org/apache/commons/monitoring/Role.java
Date Thu, 19 Feb 2009 08:22:25 GMT
Author: nicolas
Date: Thu Feb 19 08:22:25 2009
New Revision: 745775

URL: http://svn.apache.org/viewvc?rev=745775&view=rev
Log:
getMetric( Role ) and getReturn( String ) must return same instance 

Modified:
    commons/sandbox/monitoring/branches/modules/core/src/main/java/org/apache/commons/monitoring/Role.java

Modified: commons/sandbox/monitoring/branches/modules/core/src/main/java/org/apache/commons/monitoring/Role.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/branches/modules/core/src/main/java/org/apache/commons/monitoring/Role.java?rev=745775&r1=745774&r2=745775&view=diff
==============================================================================
--- commons/sandbox/monitoring/branches/modules/core/src/main/java/org/apache/commons/monitoring/Role.java
(original)
+++ commons/sandbox/monitoring/branches/modules/core/src/main/java/org/apache/commons/monitoring/Role.java
Thu Feb 19 08:22:25 2009
@@ -95,11 +95,7 @@
     @Override
     public int hashCode()
     {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ( ( name == null ) ? 0 : name.hashCode() );
-        result = prime * result + ( ( unit == null ) ? 0 : unit.hashCode() );
-        return result;
+        return name.hashCode();
     }
 
     /**
@@ -121,14 +117,9 @@
                 return false;
         }
         else if ( !name.equals( other.name ) )
-            return false;
-        if ( unit == null )
         {
-            if ( other.unit != null )
-                return false;
-        }
-        else if ( !unit.equals( other.unit ) )
             return false;
+        }
         return true;
     }
 



Mime
View raw message