myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Udo Schnurpfeil (JIRA)" <myfaces-...@incubator.apache.org>
Subject [jira] Created: (MYFACES-576) NPE in PropertyResolverImpl.getType if the array is initilized without values
Date Fri, 16 Sep 2005 17:02:58 GMT
NPE in PropertyResolverImpl.getType if the array is initilized without values
-----------------------------------------------------------------------------

         Key: MYFACES-576
         URL: http://issues.apache.org/jira/browse/MYFACES-576
     Project: MyFaces
        Type: Bug
  Components: Implementation  
    Versions: Nightly Build    
 Environment: e.g. svn reversion 289586
    Reporter: Udo Schnurpfeil
    Priority: Minor


In the current version I get a NullPointerException in line 311
when I have a String[] which is initilized, but has no values
like: String[] base = new String[5];

current:
    if (base.getClass().isArray())
    {
        if (base instanceof Object[]) {
            Object[] array = (Object[]) base;
            return array[index].getClass().getComponentType();
        } else {
            return base.getClass().getComponentType();
        }
    }

my proposal:
    if (base.getClass().isArray())
    {
        if (base instanceof Object[] && ((Object[])base)[index] != null) {
            Object[] array = (Object[]) base;
            return array[index].getClass().getComponentType();
        } else {
            return base.getClass().getComponentType();
        }
    }


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message