[jboss-jira] [JBoss JIRA] (WFCORE-1168) Incorrect null check in SimpleResourceDefinition.Parameter.setDeprecatedSince

Brian Stansberry (JIRA) issues at jboss.org
Mon Nov 30 14:47:00 EST 2015


     [ https://issues.jboss.org/browse/WFCORE-1168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Stansberry updated WFCORE-1168:
-------------------------------------
    Description: 
The null check checks the field being assigned instead of the param passed in:
 
{code}
        public Parameters setDeprecatedSince(ModelVersion deprecatedSince) {
            if (deprecationData == null) { // <-- OOPS!
                throw ControllerLogger.ROOT_LOGGER.nullVar("deprecatedSince");
            }

            this.deprecationData = new DeprecationData(deprecatedSince);
{code}

The field will always be null, making this method useless.

  was:
The null check checks the field being assigned instead of the param passed in:
 
{code}
        public Parameters setDeprecatedSince(ModelVersion deprecatedSince) {
            if (deprecationData == null) { // <-- OOPS!
                throw ControllerLogger.ROOT_LOGGER.nullVar("deprecatedSince");
            }

            this.deprecationData = new DeprecationData(deprecatedSince);
{code}



> Incorrect null check in SimpleResourceDefinition.Parameter.setDeprecatedSince
> -----------------------------------------------------------------------------
>
>                 Key: WFCORE-1168
>                 URL: https://issues.jboss.org/browse/WFCORE-1168
>             Project: WildFly Core
>          Issue Type: Bug
>          Components: Domain Management
>    Affects Versions: 2.0.3.Final
>            Reporter: Brian Stansberry
>            Assignee: Brian Stansberry
>             Fix For: 2.0.4.Final
>
>
> The null check checks the field being assigned instead of the param passed in:
>  
> {code}
>         public Parameters setDeprecatedSince(ModelVersion deprecatedSince) {
>             if (deprecationData == null) { // <-- OOPS!
>                 throw ControllerLogger.ROOT_LOGGER.nullVar("deprecatedSince");
>             }
>             this.deprecationData = new DeprecationData(deprecatedSince);
> {code}
> The field will always be null, making this method useless.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list