Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-139

JAX-RS Response objects are not correctly handled when returned from a resouce method

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • Beta 9
    • Beta 8
    • None
    • None

      The following code is not correctly working:

      @GET
      public Object get() {
      return Response.status(500).build();
      }

      because the returned ResponseImpl instance will not be handled like a javax.ws.rs.core.Response object (although it is derived from it)
      The error is in ResourceMethod.invokeOnTarget() method:

      if (method.getReturnType().equals(Response.class))

      { return (Response) rtn; }

      This can be fixed by using isAssignableFrom() instead of comparing classes by equality.

            patriot1burke@gmail.com Bill Burke (Inactive)
            bstefanescu Bogdan Stefanescu (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: