Janne Jalkanen (JIRA)
11 years ago
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}
-------------------------------------------------------------------------------
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
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira