Uploaded image for project: 'Stripes'
  1. STS-919

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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects versions: Release 1.5.7
    • Fix versions: Release 1.6
    • Components: None
    • Labels:
      None
    • Sprint:

      Description

      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:

          /** 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);
          }
      

        Attachments

          Activity

            People

            • Assignee:
              rgrashel Rick Grashel
              Reporter:
              ecyrd ecyrd
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: