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

        

Reply via email to