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

UriBuilder.path(Class resource) does not throw IllegalArgumentException for unannotated resource

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.2.RC1
    • 1.1.GA
    • jaxrs
    • None

      According to the javadoc comments for javax.ws.rs.core.UriBuilder.path(Class resource), an IllegalArgumentException should be thrown if resource is not annotated with

      {@link javax.ws.rs.Path}

      As currently implemented, path(resource) checks for null resource, but doesn't check for the annotation.

      Simple test to demonstrate bug:

      import org.junit.Test;

      public class UriBuilderTest {

      @Test(expected=IllegalArgumentException.class)
      public void testBuildUriInvalidResource()

      { UriBuilder uriBuilder = UriBuilder.fromResource(Object.class); }

      }

              patriot1burke@gmail.com Bill Burke (Inactive)
              stevideter Stevi Deter (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: