[JIRA] Created: (STS-919) MockHttpServletRequest.getIntHeader() should return -1 when item does not exist

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[JIRA] Created: (STS-919) MockHttpServletRequest.getIntHeader() should return -1 when item does not exist

JIRA jira@stripesframework.org
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-development
Reply | Threaded
Open this post in threaded view
|

[JIRA] Commented: (STS-919) MockHttpServletRequest.getIntHeader() should return -1 when item does not exist

JIRA jira@stripesframework.org

    [ http://www.stripesframework.org/jira/browse/STS-919?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13090#comment-13090 ]

Remi VANKEISBELCK commented on STS-919:
---------------------------------------

Could you please create a Pull Request in github ?

> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-development
Reply | Threaded
Open this post in threaded view
|

[JIRA] Commented: (STS-919) MockHttpServletRequest.getIntHeader() should return -1 when item does not exist

JIRA jira@stripesframework.org
In reply to this post by JIRA jira@stripesframework.org

    [ http://www.stripesframework.org/jira/browse/STS-919?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13091#comment-13091 ]

Janne Jalkanen commented on STS-919:
------------------------------------

Can do - I did not realize that Stripes is now on Github.

> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-development