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()
}