Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
git diff
diff --git a/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/ResourceMethodRegistry.java b/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/ResourceMethodRegistry.java
index 2106862..6ab27a8 100644
--- a/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/ResourceMethodRegistry.java
+++ b/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/ResourceMethodRegistry.java
@@ -5,16 +5,14 @@ import org.jboss.resteasy.plugins.server.resourcefactory.JndiResourceFactory;
import org.jboss.resteasy.plugins.server.resourcefactory.POJOResourceFactory;
import org.jboss.resteasy.plugins.server.resourcefactory.SingletonResource;
import org.jboss.resteasy.specimpl.UriBuilderImpl;
-import org.jboss.resteasy.spi.HttpRequest;
-import org.jboss.resteasy.spi.InjectorFactory;
-import org.jboss.resteasy.spi.Registry;
-import org.jboss.resteasy.spi.ResourceFactory;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
+import org.jboss.resteasy.spi.*;
+import org.jboss.resteasy.util.FindAnnotation;
import org.jboss.resteasy.util.GetRestful;
import org.jboss.resteasy.util.IsHttpMethod;
import org.jboss.resteasy.util.Types;
import javax.ws.rs.Path;
+import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.List;
import java.util.Set;
@@ -203,6 +201,17 @@ public class ResourceMethodRegistry implements Registry
Method method = findAnnotatedMethod(clazz, implementation);
if (method != null)
{
+
+ Annotation[][] paramAnnotations = method.getParameterAnnotations();
+ int notAnnotatedParamCount = 0;
+ for (Annotation[] paramAnnotation : paramAnnotations) {
+ if (FindAnnotation.findJaxRSAnnotations(paramAnnotation).length == 0) {
+ notAnnotatedParamCount++;
+ if (notAnnotatedParamCount > 1)
+ logger.warn(implementation.getDeclaringClass().getName() + "." + implementation.getName() + "(): Resource methods MUST NOT have more than one parameter that is not annotated with one of the JaxRS Annotations.");
+ }
+ }
+
Path path = method.getAnnotation(Path.class);
Set<String> httpMethods = IsHttpMethod.getHttpMethods(method);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.