svn commit: r833586 - /tomcat/trunk/java/org/apache/catalina/deploy/LoginConfig.java

View: New views
1 Messages — Rating Filter:   Alert me  

svn commit: r833586 - /tomcat/trunk/java/org/apache/catalina/deploy/LoginConfig.java

by Mark Thomas :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Author: markt
Date: Fri Nov  6 22:34:38 2009
New Revision: 833586

URL: http://svn.apache.org/viewvc?rev=833586&view=rev
Log:
Fix Eclipse warning
Override equals (and therefore also hashcode) as it is required for fragment merging

Modified:
    tomcat/trunk/java/org/apache/catalina/deploy/LoginConfig.java

Modified: tomcat/trunk/java/org/apache/catalina/deploy/LoginConfig.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/deploy/LoginConfig.java?rev=833586&r1=833585&r2=833586&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/deploy/LoginConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/deploy/LoginConfig.java Fri Nov  6 22:34:38 2009
@@ -35,6 +35,9 @@
 public class LoginConfig implements Serializable {
 
 
+    private static final long serialVersionUID = 1L;
+
+
     // ----------------------------------------------------------- Constructors
 
 
@@ -165,4 +168,59 @@
     }
 
 
+    /* (non-Javadoc)
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result
+                + ((authMethod == null) ? 0 : authMethod.hashCode());
+        result = prime * result
+                + ((errorPage == null) ? 0 : errorPage.hashCode());
+        result = prime * result
+                + ((loginPage == null) ? 0 : loginPage.hashCode());
+        result = prime * result
+                + ((realmName == null) ? 0 : realmName.hashCode());
+        return result;
+    }
+
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (!(obj instanceof LoginConfig))
+            return false;
+        LoginConfig other = (LoginConfig) obj;
+        if (authMethod == null) {
+            if (other.authMethod != null)
+                return false;
+        } else if (!authMethod.equals(other.authMethod))
+            return false;
+        if (errorPage == null) {
+            if (other.errorPage != null)
+                return false;
+        } else if (!errorPage.equals(other.errorPage))
+            return false;
+        if (loginPage == null) {
+            if (other.loginPage != null)
+                return false;
+        } else if (!loginPage.equals(other.loginPage))
+            return false;
+        if (realmName == null) {
+            if (other.realmName != null)
+                return false;
+        } else if (!realmName.equals(other.realmName))
+            return false;
+        return true;
+    }
+
+
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...