You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@shindig.apache.org by "Henry Kang (JIRA)" <ji...@apache.org> on 2011/04/19 08:04:05 UTC

[jira] [Created] (SHINDIG-1527) It happens NPE when no json object

It happens NPE when no json object
----------------------------------

                 Key: SHINDIG-1527
                 URL: https://issues.apache.org/jira/browse/SHINDIG-1527
             Project: Shindig
          Issue Type: Bug
          Components: Java
    Affects Versions: 2.0.2
         Environment: windows xp
            Reporter: Henry Kang
            Priority: Minor


BaseRequestItem.getTypesParameter() calls BeanJsonConverter.convertToObject().

but if no exists json parameter, means getParameter(parameterName) returns null, 

it happens null point exception.

and the method can't handled NPE. (it can control JSONException)


  public <T> T getTypedParameter(String parameterName, Class<T> dataTypeClass) {
    try {
      return converter.convertToObject(getParameter(parameterName), dataTypeClass);
    } catch (RuntimeException e) {
      if (e.getCause() instanceof JSONException)
        throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, e.getMessage());
      throw e;
    }
  }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (SHINDIG-1527) It happens NPE when no json object

Posted by "Paul Lindner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-1527?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Lindner resolved SHINDIG-1527.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 3.0.0

> It happens NPE when no json object
> ----------------------------------
>
>                 Key: SHINDIG-1527
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1527
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 2.0.2
>         Environment: windows xp
>            Reporter: Henry Kang
>            Priority: Minor
>             Fix For: 3.0.0
>
>
> BaseRequestItem.getTypesParameter() calls BeanJsonConverter.convertToObject().
> but if no exists json parameter, means getParameter(parameterName) returns null, 
> it happens null point exception.
> and the method can't handled NPE. (it can control JSONException)
>   public <T> T getTypedParameter(String parameterName, Class<T> dataTypeClass) {
>     try {
>       return converter.convertToObject(getParameter(parameterName), dataTypeClass);
>     } catch (RuntimeException e) {
>       if (e.getCause() instanceof JSONException)
>         throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, e.getMessage());
>       throw e;
>     }
>   }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Closed] (SHINDIG-1527) It happens NPE when no json object

Posted by "Paul Lindner (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-1527?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Lindner closed SHINDIG-1527.
---------------------------------


part of 2.5.0-beta1 release.

                
> It happens NPE when no json object
> ----------------------------------
>
>                 Key: SHINDIG-1527
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1527
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 2.0.2
>         Environment: windows xp
>            Reporter: Henry Kang
>            Priority: Minor
>             Fix For: 2.5.0-beta1
>
>
> BaseRequestItem.getTypesParameter() calls BeanJsonConverter.convertToObject().
> but if no exists json parameter, means getParameter(parameterName) returns null, 
> it happens null point exception.
> and the method can't handled NPE. (it can control JSONException)
>   public <T> T getTypedParameter(String parameterName, Class<T> dataTypeClass) {
>     try {
>       return converter.convertToObject(getParameter(parameterName), dataTypeClass);
>     } catch (RuntimeException e) {
>       if (e.getCause() instanceof JSONException)
>         throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, e.getMessage());
>       throw e;
>     }
>   }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira