axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kent Tong (JIRA)" <j...@apache.org>
Subject [jira] Created: (AXIS2-786) Passing unknown parameters in a GET from a REST client causes NullPointerException in SchemaUtil.java
Date Wed, 31 May 2006 07:41:29 GMT
Passing unknown parameters in a GET from a REST client causes NullPointerException in SchemaUtil.java
-----------------------------------------------------------------------------------------------------

         Key: AXIS2-786
         URL: http://issues.apache.org/jira/browse/AXIS2-786
     Project: Apache Axis 2.0 (Axis2)
        Type: Bug

  Components: core  
    Versions: 1.0    
 Environment: Tomcat 5.5.7. Win XP.
    Reporter: Kent Tong


In SchemaUtil.java, line 104:

                            String[] parameterValuesArray = (String[]) parameterMap.get(name);
                            if (parameterValuesArray.length > 0 &&
                                !"".equals(parameterValuesArray[0]) && parameterValuesArray[0]
!= null)
                            {
                               ...
                            }

If there is no query parameter with this name, then parameterMap.get() will return null. Trying
to get the length field of null will cause a NullPointerException. The correct code should
be:

                            String[] parameterValuesArray = (String[]) parameterMap.get(name);
                            if (parameterValuesArray != null &&
                                !"".equals(parameterValuesArray[0]) && parameterValuesArray[0]
!= null)
                            {
                               ...
                            }


-- 
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


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message