MockHttpServletRequest.getIntHeader() should return -1 when item does not exist
-------------------------------------------------------------------------------

                 Key: STS-919
                 URL: http://www.stripesframework.org/jira/browse/STS-919
             Project: Stripes
          Issue Type: Bug
    Affects Versions: Release 1.5.7
            Reporter: Janne Jalkanen


According to servlet specification, ServletRequest.getIntHeader() should return 
-1 when the header in question does not exist. Stripes instead throws a 
NullPointerException...

Fix is easy:

{code}
    /** Gets the named header as an int. Must have been set as an Integer with 
addHeader(). */
    public int getIntHeader(String name) {
        if( !this.headers.containsKey(name) ) return -1;
        return (Integer) this.headers.get(name);
    }
{code}

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to