Author: markt Date: Sat Jan 16 13:54:04 2010 New Revision: 899949 URL: http://svn.apache.org/viewvc?rev=899949&view=rev Log: TCK failure: Can't use the string representation to test for equality as whitespace must be ignored. Use the parsed nodes instead.
Modified: tomcat/trunk/java/org/apache/el/ValueExpressionImpl.java tomcat/trunk/java/org/apache/el/parser/SimpleNode.java Modified: tomcat/trunk/java/org/apache/el/ValueExpressionImpl.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/el/ValueExpressionImpl.java?rev=899949&r1=899948&r2=899949&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/el/ValueExpressionImpl.java (original) +++ tomcat/trunk/java/org/apache/el/ValueExpressionImpl.java Sat Jan 16 13:54:04 2010 @@ -203,7 +203,7 @@ */ @Override public int hashCode() { - return this.expr.hashCode(); + return this.getNode().hashCode(); } /* Modified: tomcat/trunk/java/org/apache/el/parser/SimpleNode.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/el/parser/SimpleNode.java?rev=899949&r1=899948&r2=899949&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/el/parser/SimpleNode.java (original) +++ tomcat/trunk/java/org/apache/el/parser/SimpleNode.java Sat Jan 16 13:54:04 2010 @@ -18,6 +18,8 @@ package org.apache.el.parser; +import java.util.Arrays; + import javax.el.ELException; import javax.el.MethodInfo; import javax.el.PropertyNotWritableException; @@ -164,6 +166,45 @@ throw new UnsupportedOperationException(); } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + Arrays.hashCode(children); + result = prime * result + id; + result = prime * result + ((image == null) ? 0 : image.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (!(obj instanceof SimpleNode)) { + return false; + } + SimpleNode other = (SimpleNode) obj; + if (!Arrays.equals(children, other.children)) { + return false; + } + if (id != other.id) { + return false; + } + if (image == null) { + if (other.image != null) { + return false; + } + } else if (!image.equals(other.image)) { + return false; + } + return true; + } + /** * @since EL 2.2 */ --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org