commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1213063 - /commons/sandbox/meiyo/trunk/src/main/java/org/apache/commons/meiyo/classvisitor/Key.java
Date Sun, 11 Dec 2011 21:02:50 GMT
Author: simonetripodi
Date: Sun Dec 11 21:02:49 2011
New Revision: 1213063

URL: http://svn.apache.org/viewvc?rev=1213063&view=rev
Log:
Key instances with null values are prevented

Modified:
    commons/sandbox/meiyo/trunk/src/main/java/org/apache/commons/meiyo/classvisitor/Key.java

Modified: commons/sandbox/meiyo/trunk/src/main/java/org/apache/commons/meiyo/classvisitor/Key.java
URL: http://svn.apache.org/viewvc/commons/sandbox/meiyo/trunk/src/main/java/org/apache/commons/meiyo/classvisitor/Key.java?rev=1213063&r1=1213062&r2=1213063&view=diff
==============================================================================
--- commons/sandbox/meiyo/trunk/src/main/java/org/apache/commons/meiyo/classvisitor/Key.java
(original)
+++ commons/sandbox/meiyo/trunk/src/main/java/org/apache/commons/meiyo/classvisitor/Key.java
Sun Dec 11 21:02:49 2011
@@ -76,8 +76,8 @@ final class Key
     {
         final int prime = 31;
         int result = 1;
-        result = prime * result + ( ( annotatedElementType == null ) ? 0 : annotatedElementType.hashCode()
);
-        result = prime * result + ( ( annotationType == null ) ? 0 : annotationType.hashCode()
);
+        result = prime * result + annotatedElementType.hashCode();
+        result = prime * result + annotationType.hashCode();
         return result;
     }
 
@@ -102,26 +102,12 @@ final class Key
 
         Key other = (Key) obj;
 
-        if ( annotatedElementType == null )
-        {
-            if ( other.getAnnotatedElementType() != null )
-            {
-                return false;
-            }
-        }
-        else if ( !annotatedElementType.equals( other.getAnnotatedElementType() ) )
+        if ( !annotatedElementType.equals( other.getAnnotatedElementType() ) )
         {
             return false;
         }
 
-        if ( annotationType == null )
-        {
-            if ( other.getAnnotationType() != null )
-            {
-                return false;
-            }
-        }
-        else if ( !annotationType.equals( other.getAnnotationType() ) )
+        if ( !annotationType.equals( other.getAnnotationType() ) )
         {
             return false;
         }



Mime
View raw message