niallp      2004/06/08 17:54:24

  Modified:    src/share/org/apache/struts/config FormPropertyConfig.java
  Log:
  Fix for bug 29284
  
  Revision  Changes    Path
  1.16      +16 -10    
jakarta-struts/src/share/org/apache/struts/config/FormPropertyConfig.java
  
  Index: FormPropertyConfig.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/config/FormPropertyConfig.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- FormPropertyConfig.java   24 Apr 2004 06:37:00 -0000      1.15
  +++ FormPropertyConfig.java   9 Jun 2004 00:54:24 -0000       1.16
  @@ -288,13 +288,19 @@
                   } else {
                       initialValue =
                           Array.newInstance(clazz.getComponentType(), size);
  -                    for (int i = 0; i < size; i++) {
  -                        try {
  -                            Array.set(initialValue, i,
  +                    if (!(clazz.getComponentType().isPrimitive())) {
  +                        for (int i = 0; i < size; i++) {
  +                            try {
  +                                Array.set(initialValue, i,
                                         clazz.getComponentType().newInstance());
  -                        } catch (Throwable t) {
  -                            log.error("Unable to create instance of 
"+clazz.getName()+" there is probably no zero-arg constructor");
  -                            //FIXME: Should we just dump the entire 
application/module ?
  +                            } catch (Throwable t) {
  +                                log.error("Unable to create instance of " + 
clazz.getName() +
  +                                                                        " for 
property=" + name+
  +                                                                        ", type=" + 
type +
  +                                                                        ", 
initial=" + initial +
  +                                                                        ", size=" + 
size + ".");
  +                                //FIXME: Should we just dump the entire 
application/module ?
  +                            }
                           }
                       }
                   }
  
  
  

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

Reply via email to