From 7b4c9f3ebe5a4ad054f196f8b777816965f38ea7 Mon Sep 17 00:00:00 2001 From: markt Date: Fri, 6 Nov 2009 22:34:38 +0000 Subject: [PATCH] Fix Eclipse warning Override equals (and therefore also hashcode) as it is required for fragment merging git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@833586 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/catalina/deploy/LoginConfig.java | 58 ++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/java/org/apache/catalina/deploy/LoginConfig.java b/java/org/apache/catalina/deploy/LoginConfig.java index 44b939056..67ce86ce0 100644 --- a/java/org/apache/catalina/deploy/LoginConfig.java +++ b/java/org/apache/catalina/deploy/LoginConfig.java @@ -35,6 +35,9 @@ import java.io.Serializable; public class LoginConfig implements Serializable { + private static final long serialVersionUID = 1L; + + // ----------------------------------------------------------- Constructors @@ -165,4 +168,59 @@ public class LoginConfig implements Serializable { } + /* (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; + } + + } -- 2.11.0