You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Adam Johnson (Created) (JIRA)" <ji...@apache.org> on 2011/10/06 19:50:31 UTC

[jira] [Created] (CXF-3847) ResponseBuilderImpl.status - validation against instance var instead of parameter

ResponseBuilderImpl.status - validation against instance var instead of parameter
---------------------------------------------------------------------------------

                 Key: CXF-3847
                 URL: https://issues.apache.org/jira/browse/CXF-3847
             Project: CXF
          Issue Type: Bug
          Components: JAX-RS
    Affects Versions: 2.4.2, 2.2.12, 2.4.3
            Reporter: Adam Johnson
            Priority: Minor


ResponseBuilderImpl.java
{code}
    public ResponseBuilder status(int s) {
        if (status < 100 || status > 599) {
            throw new IllegalArgumentException("Illegal status value : " + s);
        }
        status = s;
        return this;
    }
{code}

Noticed we were calling this with a value of 999 and not getting the IllegalArgumentException.   If I add a second call immediately following I do get the exception.

Verified the issue exists in our version (2.2.12) and current version.

I expect the if statement should be checking the parameter 's' and not the instance variable 'status'.

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

        

[jira] [Resolved] (CXF-3847) ResponseBuilderImpl.status - validation against instance var instead of parameter

Posted by "Sergey Beryozkin (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3847?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Beryozkin resolved CXF-3847.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.5
                   2.4.4
                   2.3.8
         Assignee: Sergey Beryozkin
    
> ResponseBuilderImpl.status - validation against instance var instead of parameter
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-3847
>                 URL: https://issues.apache.org/jira/browse/CXF-3847
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.2.12, 2.4.2, 2.4.3
>            Reporter: Adam Johnson
>            Assignee: Sergey Beryozkin
>            Priority: Minor
>              Labels: ResponseBuilder, status
>             Fix For: 2.3.8, 2.4.4, 2.5
>
>
> ResponseBuilderImpl.java
> {code}
>     public ResponseBuilder status(int s) {
>         if (status < 100 || status > 599) {
>             throw new IllegalArgumentException("Illegal status value : " + s);
>         }
>         status = s;
>         return this;
>     }
> {code}
> Noticed we were calling this with a value of 999 and not getting the IllegalArgumentException.   If I add a second call immediately following I do get the exception.
> Verified the issue exists in our version (2.2.12) and current version.
> I expect the if statement should be checking the parameter 's' and not the instance variable 'status'.

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