Bug 49542

Summary: IteratedValueExpression and IndexedValueExpression implementation
Product: Taglibs Reporter: Jeremy Boynes <jboynes>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 1.2.0   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Fix equals and serialUid
Remove field added in error

Description Jeremy Boynes 2010-07-02 12:33:06 UTC
The equals() methods on IndexedValueExpression and IteratedValueExpression are inconsistent with the implementation of hashCode() which does not fulfill the contract for equals().

The serialUID values for these two classes do not match the values defined in the specification JavaDoc.

The serialized fields for IteratedValueExpression are in a different order than defined in the specification JavaDoc. This may not really matter as one of those fields contains an IteratedExpression which is not Serializable.
Comment 1 Jeremy Boynes 2010-07-02 12:36:23 UTC
Created attachment 25686 [details]
Fix equals and serialUid

Also adds JavaDoc for methods not defined in base class.
Comment 2 Henri Yandell 2010-07-03 13:50:43 UTC
Why add the private lastContext variable to IteratedExpression?

Other than that it looks good.
Comment 3 Jeremy Boynes 2010-07-03 14:58:15 UTC
Created attachment 25693 [details]
Remove field added in error
Comment 4 Henri Yandell 2010-07-03 15:40:46 UTC
svn ci -m "Improved javadoc per Jeremy's #49542 patch" src/main/java/javax/servlet/jsp/jstl/core/IteratedExpression.java
Sending        src/main/java/javax/servlet/jsp/jstl/core/IteratedExpression.java
Transmitting file data .
Committed revision 960261.

svn ci -m "Fixing equals method to be consistent with hashCode, and making the serialVersionUID be 1L per the spec javadoc. Per Jeremy Boynes' #49542 report"
Sending        spec/src/main/java/javax/servlet/jsp/jstl/core/IndexedValueExpression.java
Sending        spec/src/main/java/javax/servlet/jsp/jstl/core/IteratedValueExpression.java
Transmitting file data ..
Committed revision 960262.