dgraham     2003/07/04 11:26:19

  Modified:    src/share/org/apache/struts/util LabelValueBean.java
  Log:
  Can't use super.hashCode() when value is null because it breaks the 
  equals() contract.  Just use a constant number instead.
  
  Revision  Changes    Path
  1.6       +7 -7      
jakarta-struts/src/share/org/apache/struts/util/LabelValueBean.java
  
  Index: LabelValueBean.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/util/LabelValueBean.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- LabelValueBean.java       3 Jul 2003 03:08:44 -0000       1.5
  +++ LabelValueBean.java       4 Jul 2003 18:26:19 -0000       1.6
  @@ -69,8 +69,8 @@
    * to the user, and a corresponding value to be returned to the server. One
    * example is the <code>&lt;html:options&gt;</code> tag.
    *
  - * @author  Craig R. McClanahan
  - * @author  Martin F N Cooper
  + * @author Craig R. McClanahan
  + * @author Martin F N Cooper
    * @author David Graham
    * @version $Revision$ $Date$
    */
  @@ -177,6 +177,6 @@
        * @see java.lang.Object#hashCode()
        */
       public int hashCode() {
  -        return (getValue() == null) ? super.hashCode() : getValue().hashCode();
  +        return (this.getValue() == null) ? 17 : this.getValue().hashCode();
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to