There is only one problem left.

And that is the handling of a null pointer.
Because it could be the case that the iterator iterates and get's a null value back.
then a nullpointer exception would be thrown.

In the previous release (without the toString()) this was also not handled very well.
Because in the html you would get a option with a null string value of label. (and i 
think it should be "")
Maybe it never happens (null) but?

johan

----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, May 20, 2001 11:21 PM
Subject: cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html 
OptionsTag.java


> craigmcc    01/05/20 14:21:23
> 
>   Modified:    src/share/org/apache/struts/taglib/html OptionsTag.java
>   Log:
>   Port fix for Bugzilla #1825 to the HEAD branch.
>   
>   Revision  Changes    Path
>   1.8       +2 -2      
>jakarta-struts/src/share/org/apache/struts/taglib/html/OptionsTag.java
>   
>   Index: OptionsTag.java
>   ===================================================================
>   RCS file: 
>/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/OptionsTag.java,v
>   retrieving revision 1.7
>   retrieving revision 1.8
>   diff -u -r1.7 -r1.8
>   --- OptionsTag.java 2001/04/29 00:38:04 1.7
>   +++ OptionsTag.java 2001/05/20 21:21:23 1.8
>   @@ -240,10 +240,10 @@
>    
>                  // Render the options tags for each element of the values coll.
>                  while (valuesIterator.hasNext()) {
>   -                  String value = (String) valuesIterator.next();
>   +                  String value = valuesIterator.next().toString();
>                      String label = value;
>                      if (labelsIterator.hasNext())
>   -                      label = (String) labelsIterator.next();
>   +                      label = labelsIterator.next().toString();
>                      addOption(sb, value, label,
>                                selectTag.isMatched(value));
>                  }
>   
>   
> 

Reply via email to