You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mime4j-dev@james.apache.org by "Jaechang Nam (JIRA)" <mi...@james.apache.org> on 2016/12/23 01:10:58 UTC

[jira] [Updated] (MIME4J-258) A potential NPE

     [ https://issues.apache.org/jira/browse/MIME4J-258?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jaechang Nam updated MIME4J-258:
--------------------------------
    Description: 
In dom/src/main/java/org/apache/james/mime4j/field/Fields.java, the conditions in return statement may cause NPE when 'parameters' is null. (found a current github mirror snapshot as of cb48082fb7cbbfb111c926cc8ae953d7261c235c) 

{code}
157     public static ContentTypeField contentType(String mimeType, NameValuePair... parameters) {
158         return contentType(mimeType, parameters != null || parameters.length == 0 ? Arrays.asList(parameters) : null);
159     }
{code}

Intended this?
{code}
158         return contentType(mimeType, parameters != null? Arrays.asList(parameters) : null);
{code}

  was:
In dom/src/main/java/org/apache/james/mime4j/field/Fields.java, the conditions in return statement may cause NPE when 'parameters' is null. (found a current github snapshot as of cb48082fb7cbbfb111c926cc8ae953d7261c235c) 

{code}
157     public static ContentTypeField contentType(String mimeType, NameValuePair... parameters) {
158         return contentType(mimeType, parameters != null || parameters.length == 0 ? Arrays.asList(parameters) : null);
159     }
{code}

Intended this?
{code}
158         return contentType(mimeType, parameters != null? Arrays.asList(parameters) : null);
{code}


> A potential NPE
> ---------------
>
>                 Key: MIME4J-258
>                 URL: https://issues.apache.org/jira/browse/MIME4J-258
>             Project: James Mime4j
>          Issue Type: Bug
>          Components: dom
>            Reporter: Jaechang Nam
>            Priority: Trivial
>
> In dom/src/main/java/org/apache/james/mime4j/field/Fields.java, the conditions in return statement may cause NPE when 'parameters' is null. (found a current github mirror snapshot as of cb48082fb7cbbfb111c926cc8ae953d7261c235c) 
> {code}
> 157     public static ContentTypeField contentType(String mimeType, NameValuePair... parameters) {
> 158         return contentType(mimeType, parameters != null || parameters.length == 0 ? Arrays.asList(parameters) : null);
> 159     }
> {code}
> Intended this?
> {code}
> 158         return contentType(mimeType, parameters != null? Arrays.asList(parameters) : null);
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)