mpo         2003/09/18 13:14:04

  Modified:    src/blocks/woody/java/org/apache/cocoon/woody/binding
                        ValueJXPathBinding.java
  Log:
  Adding warning indicating not needed convertor.
  This seemed more logic then breaking with a ClassCastException
  
  Revision  Changes    Path
  1.3       +7 -2      
cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/ValueJXPathBinding.java
  
  Index: ValueJXPathBinding.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/ValueJXPathBinding.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ValueJXPathBinding.java   8 Sep 2003 15:33:27 -0000       1.2
  +++ ValueJXPathBinding.java   18 Sep 2003 20:14:04 -0000      1.3
  @@ -122,8 +122,13 @@
               Widget widget = frmModel.getWidget(this.fieldId);
               Object value = jxpc.getValue(this.xpath);
   
  -            if (convertor != null)
  -                value = convertor.convertFromString((String)value, 
convertorLocale, null);
  +            if (value != null && convertor != null) {
  +                if (value instanceof String) {
  +                    value = convertor.convertFromString((String)value, 
convertorLocale, null);
  +                } else {
  +                    getLogger().warn("Convertor ignored on backend-value 
which isn't of type String.");   
  +                }                
  +            }
   
               widget.setValue(value);
   
  
  
  

Reply via email to