Details
-
Bug
-
Resolution: Done
-
Major
-
4.2.0.Beta3
-
None
Description
The JAX-RS validator reports a false problem on Interceptors and Filters with binding annotations, when multiple binding anntotations on the target Resource or Resource Methods are involved.
Eg:
@Target({ ElementType.TYPE, ElementType.METHOD }) @Retention(value = RetentionPolicy.RUNTIME) @NameBinding public @interface RequestIfNoneMatchBinding { }
and
@Target({ ElementType.TYPE, ElementType.METHOD }) @Retention(value = RetentionPolicy.RUNTIME) @NameBinding public @interface CacheInvalidationBinding {}
with
@Provider @PreMatching @RequestIfNoneMatchBinding public class RequestIfNoneMatchFilter implements ContainerRequestFilter { @Override public void filter(final ContainerRequestContext requestContext) throws IOException { ... } }
on
@RequestScoped @Path("/foo") public class RestResource { @GET @RequestIfNoneMatchBinding @CacheControlBinding public Response getAll() { return Response.ok().build(); } }
The RequestIfNoneMatchFilter class will have a JAX-RS problem reported while it should not be the case.
The spec mentions that the resource/resource method should be annotated with all the same binding annotations as the Filter/Interceptor, which is the case here. Nothing prevents a resource / resource method to be bound to multiple Filter or Interceptor
Attachments
Issue Links
- relates to
-
JBIDE-18078 Wrong problem marker on binding annotation
- Closed