Author: markt Date: Mon Jan 2 20:14:52 2012 New Revision: 1226537 URL: http://svn.apache.org/viewvc?rev=1226537&view=rev Log: Add Eclipse generated equals() and hashCode() methods Required for BZ52405 fix
Modified: tomcat/trunk/java/org/apache/catalina/deploy/ContextEjb.java tomcat/trunk/java/org/apache/catalina/deploy/ContextEnvironment.java tomcat/trunk/java/org/apache/catalina/deploy/ContextHandler.java tomcat/trunk/java/org/apache/catalina/deploy/ContextLocalEjb.java tomcat/trunk/java/org/apache/catalina/deploy/ContextResource.java tomcat/trunk/java/org/apache/catalina/deploy/ContextResourceEnvRef.java tomcat/trunk/java/org/apache/catalina/deploy/ContextResourceLink.java tomcat/trunk/java/org/apache/catalina/deploy/ContextService.java tomcat/trunk/java/org/apache/catalina/deploy/MessageDestination.java tomcat/trunk/java/org/apache/catalina/deploy/MessageDestinationRef.java tomcat/trunk/java/org/apache/catalina/deploy/ResourceBase.java Modified: tomcat/trunk/java/org/apache/catalina/deploy/ContextEjb.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/deploy/ContextEjb.java?rev=1226537&r1=1226536&r2=1226537&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/deploy/ContextEjb.java (original) +++ tomcat/trunk/java/org/apache/catalina/deploy/ContextEjb.java Mon Jan 2 20:14:52 2012 @@ -14,8 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - - package org.apache.catalina.deploy; @@ -28,7 +26,6 @@ package org.apache.catalina.deploy; * @author Peter Rossbach (p...@apache.org) * @version $Id$ */ - public class ContextEjb extends ResourceBase { private static final long serialVersionUID = 1L; @@ -116,4 +113,50 @@ public class ContextEjb extends Resource } + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((home == null) ? 0 : home.hashCode()); + result = prime * result + ((link == null) ? 0 : link.hashCode()); + result = prime * result + ((remote == null) ? 0 : remote.hashCode()); + return result; + } + + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + ContextEjb other = (ContextEjb) obj; + if (home == null) { + if (other.home != null) { + return false; + } + } else if (!home.equals(other.home)) { + return false; + } + if (link == null) { + if (other.link != null) { + return false; + } + } else if (!link.equals(other.link)) { + return false; + } + if (remote == null) { + if (other.remote != null) { + return false; + } + } else if (!remote.equals(other.remote)) { + return false; + } + return true; + } } Modified: tomcat/trunk/java/org/apache/catalina/deploy/ContextEnvironment.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/deploy/ContextEnvironment.java?rev=1226537&r1=1226536&r2=1226537&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/deploy/ContextEnvironment.java (original) +++ tomcat/trunk/java/org/apache/catalina/deploy/ContextEnvironment.java Mon Jan 2 20:14:52 2012 @@ -14,8 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - - package org.apache.catalina.deploy; @@ -26,7 +24,6 @@ package org.apache.catalina.deploy; * @author Craig R. McClanahan * @version $Id$ */ - public class ContextEnvironment extends ResourceBase { private static final long serialVersionUID = 1L; @@ -94,4 +91,39 @@ public class ContextEnvironment extends } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + (override ? 1231 : 1237); + result = prime * result + ((value == null) ? 0 : value.hashCode()); + return result; + } + + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + ContextEnvironment other = (ContextEnvironment) obj; + if (override != other.override) { + return false; + } + if (value == null) { + if (other.value != null) { + return false; + } + } else if (!value.equals(other.value)) { + return false; + } + return true; + } } Modified: tomcat/trunk/java/org/apache/catalina/deploy/ContextHandler.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/deploy/ContextHandler.java?rev=1226537&r1=1226536&r2=1226537&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/deploy/ContextHandler.java (original) +++ tomcat/trunk/java/org/apache/catalina/deploy/ContextHandler.java Mon Jan 2 20:14:52 2012 @@ -146,6 +146,65 @@ public class ContextHandler extends Reso } sb.append("]"); return (sb.toString()); + } + + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + + ((handlerclass == null) ? 0 : handlerclass.hashCode()); + result = prime * result + + ((portNames == null) ? 0 : portNames.hashCode()); + result = prime * result + + ((soapHeaders == null) ? 0 : soapHeaders.hashCode()); + result = prime * result + + ((soapRoles == null) ? 0 : soapRoles.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + ContextHandler other = (ContextHandler) obj; + if (handlerclass == null) { + if (other.handlerclass != null) { + return false; + } + } else if (!handlerclass.equals(other.handlerclass)) { + return false; + } + if (portNames == null) { + if (other.portNames != null) { + return false; + } + } else if (!portNames.equals(other.portNames)) { + return false; + } + if (soapHeaders == null) { + if (other.soapHeaders != null) { + return false; + } + } else if (!soapHeaders.equals(other.soapHeaders)) { + return false; + } + if (soapRoles == null) { + if (other.soapRoles != null) { + return false; + } + } else if (!soapRoles.equals(other.soapRoles)) { + return false; + } + return true; } } Modified: tomcat/trunk/java/org/apache/catalina/deploy/ContextLocalEjb.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/deploy/ContextLocalEjb.java?rev=1226537&r1=1226536&r2=1226537&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/deploy/ContextLocalEjb.java (original) +++ tomcat/trunk/java/org/apache/catalina/deploy/ContextLocalEjb.java Mon Jan 2 20:14:52 2012 @@ -14,8 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - - package org.apache.catalina.deploy; @@ -28,7 +26,6 @@ package org.apache.catalina.deploy; * @author Peter Rossbach (p...@apache.org) * @version $Id$ */ - public class ContextLocalEjb extends ResourceBase { private static final long serialVersionUID = 1L; @@ -111,6 +108,53 @@ public class ContextLocalEjb extends Res } sb.append("]"); return (sb.toString()); + } + + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((home == null) ? 0 : home.hashCode()); + result = prime * result + ((link == null) ? 0 : link.hashCode()); + result = prime * result + ((local == null) ? 0 : local.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + ContextLocalEjb other = (ContextLocalEjb) obj; + if (home == null) { + if (other.home != null) { + return false; + } + } else if (!home.equals(other.home)) { + return false; + } + if (link == null) { + if (other.link != null) { + return false; + } + } else if (!link.equals(other.link)) { + return false; + } + if (local == null) { + if (other.local != null) { + return false; + } + } else if (!local.equals(other.local)) { + return false; + } + return true; } } Modified: tomcat/trunk/java/org/apache/catalina/deploy/ContextResource.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/deploy/ContextResource.java?rev=1226537&r1=1226536&r2=1226537&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/deploy/ContextResource.java (original) +++ tomcat/trunk/java/org/apache/catalina/deploy/ContextResource.java Mon Jan 2 20:14:52 2012 @@ -14,8 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - - package org.apache.catalina.deploy; @@ -28,7 +26,6 @@ package org.apache.catalina.deploy; * @author Peter Rossbach (p...@apache.org) * @version $Id$ */ - public class ContextResource extends ResourceBase { private static final long serialVersionUID = 1L; @@ -128,7 +125,58 @@ public class ContextResource extends Res } sb.append("]"); return (sb.toString()); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((auth == null) ? 0 : auth.hashCode()); + result = prime * result + + ((closeMethod == null) ? 0 : closeMethod.hashCode()); + result = prime * result + ((scope == null) ? 0 : scope.hashCode()); + result = prime * result + (singleton ? 1231 : 1237); + return result; } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + ContextResource other = (ContextResource) obj; + if (auth == null) { + if (other.auth != null) { + return false; + } + } else if (!auth.equals(other.auth)) { + return false; + } + if (closeMethod == null) { + if (other.closeMethod != null) { + return false; + } + } else if (!closeMethod.equals(other.closeMethod)) { + return false; + } + if (scope == null) { + if (other.scope != null) { + return false; + } + } else if (!scope.equals(other.scope)) { + return false; + } + if (singleton != other.singleton) { + return false; + } + return true; + } } Modified: tomcat/trunk/java/org/apache/catalina/deploy/ContextResourceEnvRef.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/deploy/ContextResourceEnvRef.java?rev=1226537&r1=1226536&r2=1226537&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/deploy/ContextResourceEnvRef.java (original) +++ tomcat/trunk/java/org/apache/catalina/deploy/ContextResourceEnvRef.java Mon Jan 2 20:14:52 2012 @@ -14,8 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - - package org.apache.catalina.deploy; @@ -27,7 +25,6 @@ package org.apache.catalina.deploy; * @author Peter Rossbach (p...@apache.org) * @version $Id$ */ - public class ContextResourceEnvRef extends ResourceBase { private static final long serialVersionUID = 1L; @@ -68,9 +65,33 @@ public class ContextResourceEnvRef exten sb.append(override); sb.append("]"); return (sb.toString()); - } + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + (override ? 1231 : 1237); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + ContextResourceEnvRef other = (ContextResourceEnvRef) obj; + if (override != other.override) { + return false; + } + return true; + } } Modified: tomcat/trunk/java/org/apache/catalina/deploy/ContextResourceLink.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/deploy/ContextResourceLink.java?rev=1226537&r1=1226536&r2=1226537&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/deploy/ContextResourceLink.java (original) +++ tomcat/trunk/java/org/apache/catalina/deploy/ContextResourceLink.java Mon Jan 2 20:14:52 2012 @@ -14,8 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - - package org.apache.catalina.deploy; @@ -28,7 +26,6 @@ package org.apache.catalina.deploy; * @author Peter Rossbach (Peter Rossbach (p...@apache.org)) * @version $Id$ */ - public class ContextResourceLink extends ResourceBase { private static final long serialVersionUID = 1L; @@ -81,7 +78,45 @@ public class ContextResourceLink extends } sb.append("]"); return (sb.toString()); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((factory == null) ? 0 : factory.hashCode()); + result = prime * result + ((global == null) ? 0 : global.hashCode()); + return result; } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + ContextResourceLink other = (ContextResourceLink) obj; + if (factory == null) { + if (other.factory != null) { + return false; + } + } else if (!factory.equals(other.factory)) { + return false; + } + if (global == null) { + if (other.global != null) { + return false; + } + } else if (!global.equals(other.global)) { + return false; + } + return true; + } } Modified: tomcat/trunk/java/org/apache/catalina/deploy/ContextService.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/deploy/ContextService.java?rev=1226537&r1=1226536&r2=1226537&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/deploy/ContextService.java (original) +++ tomcat/trunk/java/org/apache/catalina/deploy/ContextService.java Mon Jan 2 20:14:52 2012 @@ -14,10 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - - package org.apache.catalina.deploy; +import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; @@ -29,7 +28,6 @@ import java.util.Iterator; * @author Fabien Carrion * @version $Id$ */ - public class ContextService extends ResourceBase { private static final long serialVersionUID = 1L; @@ -188,7 +186,7 @@ public class ContextService extends Reso * * The instantiation of the handler have to be done. */ - private HashMap<String, ContextHandler> handlers = + private final HashMap<String, ContextHandler> handlers = new HashMap<String, ContextHandler>(); public Iterator<String> getHandlers() { @@ -262,7 +260,97 @@ public class ContextService extends Reso } sb.append("]"); return (sb.toString()); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + + ((displayname == null) ? 0 : displayname.hashCode()); + result = prime * result + + ((handlers == null) ? 0 : handlers.hashCode()); + result = prime * + result + + ((jaxrpcmappingfile == null) ? 0 : jaxrpcmappingfile.hashCode()); + result = prime * result + + ((largeIcon == null) ? 0 : largeIcon.hashCode()); + result = prime * result + + ((serviceInterface == null) ? 0 : serviceInterface.hashCode()); + result = prime * result + Arrays.hashCode(serviceqname); + result = prime * result + + ((smallIcon == null) ? 0 : smallIcon.hashCode()); + result = prime * result + + ((wsdlfile == null) ? 0 : wsdlfile.hashCode()); + return result; } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + ContextService other = (ContextService) obj; + if (displayname == null) { + if (other.displayname != null) { + return false; + } + } else if (!displayname.equals(other.displayname)) { + return false; + } + if (handlers == null) { + if (other.handlers != null) { + return false; + } + } else if (!handlers.equals(other.handlers)) { + return false; + } + if (jaxrpcmappingfile == null) { + if (other.jaxrpcmappingfile != null) { + return false; + } + } else if (!jaxrpcmappingfile.equals(other.jaxrpcmappingfile)) { + return false; + } + if (largeIcon == null) { + if (other.largeIcon != null) { + return false; + } + } else if (!largeIcon.equals(other.largeIcon)) { + return false; + } + if (serviceInterface == null) { + if (other.serviceInterface != null) { + return false; + } + } else if (!serviceInterface.equals(other.serviceInterface)) { + return false; + } + if (!Arrays.equals(serviceqname, other.serviceqname)) { + return false; + } + if (smallIcon == null) { + if (other.smallIcon != null) { + return false; + } + } else if (!smallIcon.equals(other.smallIcon)) { + return false; + } + if (wsdlfile == null) { + if (other.wsdlfile != null) { + return false; + } + } else if (!wsdlfile.equals(other.wsdlfile)) { + return false; + } + return true; + } } Modified: tomcat/trunk/java/org/apache/catalina/deploy/MessageDestination.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/deploy/MessageDestination.java?rev=1226537&r1=1226536&r2=1226537&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/deploy/MessageDestination.java (original) +++ tomcat/trunk/java/org/apache/catalina/deploy/MessageDestination.java Mon Jan 2 20:14:52 2012 @@ -14,11 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - - package org.apache.catalina.deploy; - /** * <p>Representation of a message destination for a web application, as * represented in a <code><message-destination></code> element @@ -28,7 +25,6 @@ package org.apache.catalina.deploy; * @version $Id$ * @since Tomcat 5.0 */ - public class MessageDestination extends ResourceBase { private static final long serialVersionUID = 1L; @@ -108,8 +104,56 @@ public class MessageDestination extends } sb.append("]"); return (sb.toString()); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + + ((displayName == null) ? 0 : displayName.hashCode()); + result = prime * result + + ((largeIcon == null) ? 0 : largeIcon.hashCode()); + result = prime * result + + ((smallIcon == null) ? 0 : smallIcon.hashCode()); + return result; } + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + MessageDestination other = (MessageDestination) obj; + if (displayName == null) { + if (other.displayName != null) { + return false; + } + } else if (!displayName.equals(other.displayName)) { + return false; + } + if (largeIcon == null) { + if (other.largeIcon != null) { + return false; + } + } else if (!largeIcon.equals(other.largeIcon)) { + return false; + } + if (smallIcon == null) { + if (other.smallIcon != null) { + return false; + } + } else if (!smallIcon.equals(other.smallIcon)) { + return false; + } + return true; + } } Modified: tomcat/trunk/java/org/apache/catalina/deploy/MessageDestinationRef.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/deploy/MessageDestinationRef.java?rev=1226537&r1=1226536&r2=1226537&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/deploy/MessageDestinationRef.java (original) +++ tomcat/trunk/java/org/apache/catalina/deploy/MessageDestinationRef.java Mon Jan 2 20:14:52 2012 @@ -14,11 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - - package org.apache.catalina.deploy; - /** * <p>Representation of a message destination reference for a web application, * as represented in a <code><message-destination-ref></code> element @@ -28,7 +25,6 @@ package org.apache.catalina.deploy; * @version $Id$ * @since Tomcat 5.0 */ - public class MessageDestinationRef extends ResourceBase { private static final long serialVersionUID = 1L; @@ -93,8 +89,45 @@ public class MessageDestinationRef exten } sb.append("]"); return (sb.toString()); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((link == null) ? 0 : link.hashCode()); + result = prime * result + ((usage == null) ? 0 : usage.hashCode()); + return result; } + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + MessageDestinationRef other = (MessageDestinationRef) obj; + if (link == null) { + if (other.link != null) { + return false; + } + } else if (!link.equals(other.link)) { + return false; + } + if (usage == null) { + if (other.usage != null) { + return false; + } + } else if (!usage.equals(other.usage)) { + return false; + } + return true; + } } Modified: tomcat/trunk/java/org/apache/catalina/deploy/ResourceBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/deploy/ResourceBase.java?rev=1226537&r1=1226536&r2=1226537&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/deploy/ResourceBase.java (original) +++ tomcat/trunk/java/org/apache/catalina/deploy/ResourceBase.java Mon Jan 2 20:14:52 2012 @@ -14,8 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - - package org.apache.catalina.deploy; import java.io.Serializable; @@ -31,7 +29,6 @@ import java.util.List; * @author Peter Rossbach (p...@apache.org) * @version $Id$ */ - public class ResourceBase implements Serializable, Injectable { private static final long serialVersionUID = 1L; @@ -130,8 +127,75 @@ public class ResourceBase implements Ser return injectionTargets; } - // -------------------------------------------------------- Package Methods + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + + ((description == null) ? 0 : description.hashCode()); + result = prime * result + + ((injectionTargets == null) ? 0 : injectionTargets.hashCode()); + result = prime * result + ((name == null) ? 0 : name.hashCode()); + result = prime * result + + ((properties == null) ? 0 : properties.hashCode()); + result = prime * result + ((type == null) ? 0 : type.hashCode()); + return result; + } + + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + ResourceBase other = (ResourceBase) obj; + if (description == null) { + if (other.description != null) { + return false; + } + } else if (!description.equals(other.description)) { + return false; + } + if (injectionTargets == null) { + if (other.injectionTargets != null) { + return false; + } + } else if (!injectionTargets.equals(other.injectionTargets)) { + return false; + } + if (name == null) { + if (other.name != null) { + return false; + } + } else if (!name.equals(other.name)) { + return false; + } + if (properties == null) { + if (other.properties != null) { + return false; + } + } else if (!properties.equals(other.properties)) { + return false; + } + if (type == null) { + if (other.type != null) { + return false; + } + } else if (!type.equals(other.type)) { + return false; + } + return true; + } + + + // -------------------------------------------------------- Package Methods /** * The NamingResources with which we are associated (if any). @@ -145,6 +209,4 @@ public class ResourceBase implements Ser void setNamingResources(NamingResources resources) { this.resources = resources; } - - } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org