myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdud...@apache.org
Subject cvs commit: incubator-myfaces/src/myfaces/org/apache/myfaces/config ManagedBeanBuilder.java
Date Wed, 05 Jan 2005 16:22:58 GMT
bdudney     2005/01/05 08:22:57

  Modified:    src/myfaces/org/apache/myfaces/config
                        ManagedBeanBuilder.java
  Log:
  added fail early code so that if you specify a non-existent property in the managed-bean
stuff it will fail early instead of a lame error message that leads down a rabit trail.
  
  Revision  Changes    Path
  1.5       +17 -2     incubator-myfaces/src/myfaces/org/apache/myfaces/config/ManagedBeanBuilder.java
  
  Index: ManagedBeanBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/myfaces/org/apache/myfaces/config/ManagedBeanBuilder.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ManagedBeanBuilder.java	13 Oct 2004 11:50:59 -0000	1.4
  +++ ManagedBeanBuilder.java	5 Jan 2005 16:22:57 -0000	1.5
  @@ -34,6 +34,9 @@
    * @author Anton Koinov
    *
    * $Log$
  + * Revision 1.5  2005/01/05 16:22:57  bdudney
  + * added fail early code so that if you specify a non-existent property in the managed-bean
stuff it will fail early instead of a lame error message that leads down a rabit trail.
  + *
    * Revision 1.4  2004/10/13 11:50:59  matze
    * renamed packages to org.apache
    *
  @@ -56,7 +59,16 @@
           switch (beanConfiguration.getInitMode())
           {
               case ManagedBean.INIT_MODE_PROPERTIES:
  -                initializeProperties(facesContext, beanConfiguration.getManagedProperties(),
bean);
  +                try {
  +                  initializeProperties(facesContext, beanConfiguration
  +                      .getManagedProperties(), bean);
  +                } catch (IllegalArgumentException e) {
  +                  throw new IllegalArgumentException(
  +                          e.getMessage()
  +                              + " for bean '"
  +                              + beanConfiguration.getManagedBeanName()
  +                              + "' check the configuration to make sure all properties
correspond with get/set methods");
  +                }
                   break;
   
               case ManagedBean.INIT_MODE_MAP:
  @@ -131,6 +143,9 @@
               {
                   propertyClass = ClassUtils
                       .simpleJavaTypeToClass(property.getPropertyClass());
  +            }
  +            if(null == propertyClass) {
  +              throw new IllegalArgumentException("unable to find the type of property "
+ property.getPropertyName());
               }
               Object coercedValue = ClassUtils.convertToType(value, propertyClass);
               propertyResolver.setValue(
  
  
  

Mime
View raw message