javaee / interceptors-spec

interceptors-spec~interceptors-spec-repository
Other
6 stars 3 forks source link

Incompatible change regarding @Interceptor annotation #27

Closed glassfishrobot closed 7 years ago

glassfishrobot commented 10 years ago

The Interceptors 1.1 specification says:

The @Interceptor annotation may be used to explicitly designate a class as an interceptor class. Support for this annotation is not required.

which implies that an interceptor class (@Interceptor class Foo), that is bound using the @Interceptors(Foo.class) annotation may be annotated with the @Interceptor annotation (with no interceptor bindings) to be explicitly designated as an interceptor class.

In addition, the JavaDoc for the Interceptor annotation (version 1.2) says:

This annotation is optional if the Interceptors annotation or the EJB deployment descriptor are used to associate the interceptor with the target class. It is required when an interceptor binding is used.

which is in line with the above.

However, the Interceptors 1.2 specification says:

All interceptors declared using the Interceptor annotation should specify at least one interceptor binding. If an interceptor declared using the Interceptor annotation does not declare any interceptor binding, non-portable behavior results.

Now, the interceptor (@Interceptor class Foo) which does not specify any interceptor binding but uses the @Interceptor annotation suddenly relies on non-portable behavior.

Affected Versions

[1.2]

glassfishrobot commented 10 years ago

Reported by jharting

glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA INTERCEPTORS_SPEC-27

ldemichiel commented 7 years ago

Fixed in Interceptors 1.2 rev A specification