|
From: Andreas H. <a...@ho...> - 2008-08-10 11:49:17
|
Hello,
I recently created a resource that contained two @Path with limit set to
false. This failed with "It is illegal to have @Path.limited() == false on
your class then use a @Path on a method too".
This came from ResourceMethodRegistry.addResourceFactory, I'm not sure of the
correct behavior according to the spec, but it seems to me that it should be
possible to have several methods that are not limited within the same class.
I did a quick "fix" that I'm not even sure really works, but I have attached
the diff at the end of the e-mail for reference.
// Andreas
Index:
jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/ResourceMethodRegistry.java
===================================================================
---
jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/ResourceMethodRegistry.java
(revision 286)
+++
jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/ResourceMethodRegistry.java
(working copy)
@@ -126,11 +126,12 @@
* @param clazz specific class
* @param offset path segment offset. > 0 means we're within a locator.
*/
- public void addResourceFactory(ResourceFactory ref, String base, Class<?>
clazz, int offset, boolean limited)
+ public void addResourceFactory(ResourceFactory ref, String base, Class<?>
clazz, int offset, boolean limited0)
{
if (ref != null) ref.registered(new InjectorFactoryImpl(null,
providerFactory));
for (Method method : clazz.getMethods())
{
+ boolean limited = limited0;
Path path = method.getAnnotation(Path.class);
Set<String> httpMethods = IsHttpMethod.getHttpMethods(method);
if (path == null && httpMethods == null) continue;
|