Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-15377

NullPointerException can happen in HttpRequestMethodNotSupportedException.getSupportedHttpMethods()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 4.3.7
    • Fix Version/s: 4.3.8, 5.0 RC1
    • Component/s: Web
    • Labels:
      None
    • Last commented by a User:
      false

      Description

      You can create an object without supportedMethod array.
      public HttpRequestMethodNotSupportedException(String method)

      { this(method, (String[]) null); }

      However when getSupportedHttpMethods() is called there is no null-check for this.supportedMethods in it:

      public Set<HttpMethod> getSupportedHttpMethods() {
      List<HttpMethod> supportedMethods = new LinkedList<HttpMethod>();
      for (String value : this.supportedMethods) {
      HttpMethod resolved = HttpMethod.resolve(value);
      if (resolved != null)

      { supportedMethods.add(resolved); }

      }
      return EnumSet.copyOf(supportedMethods);
      }

        Attachments

          Activity

            People

            • Assignee:
              juergen.hoeller Juergen Hoeller
              Reporter:
              selindek Istvan Ratkai
              Last updater:
              St├ęphane Nicoll
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 5 weeks ago