https://bz.apache.org/bugzilla/show_bug.cgi?id=65256

            Bug ID: 65256
           Summary: ServletContainerInitializer.onStartup() should receive
                    only classes, not interfaces
           Product: Tomcat 9
           Version: 9.0.45
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Servlet
          Assignee: dev@tomcat.apache.org
          Reporter: gr.grzy...@gmail.com
  Target Milestone: -----

Extracting this issue from https://bz.apache.org/bugzilla/show_bug.cgi?id=65244

I've added java.util.EventListener.class to @HandlesTypes and I got ... a lot
of stuff, including:

```
1 = {@3229} "interface javax.faces.validator.Validator"
...
3 = {@3230} "interface javax.faces.event.SystemEventListener"
...
5 = {@3232} "interface javax.faces.event.BehaviorListener"
```

I also got package-info inside the set.

So I got back to the spec:

> The HandlesTypes annotation on the implementation of the
> ServletContainerInitializer is used to express interest in classes that may
> have annotations (type, method or field level annotations) specified in the 
> value of
> the HandlesTypes or if it extends / implements one those classes anywhere in
> the class’ super types.

I don't think I should get `interface javax.faces.validator.Validator` which
exten ds `java.util.EventListener`, because it's not a class - it's an
interface.

This may be more difficult to interpret, but if both classes and interfaces
were needed, the spec would say "types" or "java.lang.Class" instances...

Javadoc says about:

> the Set of application classes that extend, implement, or have been annotated 
> [...]

This time I checked that Jetty (9.4.40) also passes interfaces.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to