cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francesco Chicchiriccò (JIRA) <j...@apache.org>
Subject [jira] [Assigned] (CXF-6845) Some methods in MessageUtils prone to NPE
Date Tue, 29 Mar 2016 10:30:25 GMT

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

Francesco Chicchiriccò reassigned CXF-6845:
-------------------------------------------

    Assignee: Francesco Chicchiriccò

> Some methods in MessageUtils prone to NPE
> -----------------------------------------
>
>                 Key: CXF-6845
>                 URL: https://issues.apache.org/jira/browse/CXF-6845
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 3.0.9
>            Reporter: Francesco Chicchiriccò
>            Assignee: Francesco Chicchiriccò
>             Fix For: 3.0.10, 3.1.7, 3.2.0
>
>         Attachments: CXF-6845.diff
>
>
> When attempting to upgrade Syncope 1.2 from CXF 3.0.8 to 3.0.9, I receive NPE due to
some methods in {{MessageUtils}} - see for example
> {code}
>     public static boolean getContextualBoolean(Message m, String key, boolean defaultValue)
{
>         Object o = m.getContextualProperty(key);
>         if (o != null) {
>             return PropertyUtils.isTrue(o);
>         }
>         return defaultValue;
>     }
> {code}
> As you can see, if {{m}} is NULL, NPE is thrown.
> See for reference the same method from 3.1.6:
> {code}
>     public static boolean getContextualBoolean(Message m, String key, boolean defaultValue)
{
>         if (m != null) {
>             Object o = m.getContextualProperty(key);
>             if (o != null) {
>                 return PropertyUtils.isTrue(o);
>             }
>         }
>         return defaultValue;
>     }
> {code}



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

Mime
View raw message