== Why is this an issue?

Exclusions for default interceptors can be declared either in xml or as class annotations. Since annotations are more visible to maintainers, they are preferred.


=== Noncompliant code example

[source,xml]
----
<assembly-descriptor>
      <interceptor-binding>
         <ejb-name>MyExcludedClass</ejb-name>
         <exclude-default-interceptors>true</exclude-default-interceptors> <!-- Noncompliant -->
         <exclude-class-interceptors>true</exclude-class-interceptors> <!-- Noncomopliant -->
         <method>
           <method-name>doTheThing</method-name>
         </method>
      </interceptor-binding>

</assembly-descriptor>
----


=== Compliant solution

[source,xml]
----
@ExcludeDefaultInterceptors
public class MyExcludedClass implements MessageListener
{

  @ExcludeClassInterceptors
  @ExcludeDefaultInterceptors
  public void doTheThing() {
    // ...
  }
----


ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

=== Message

Move this exclusion into the class as an annotation.


'''
== Comments And Links
(visible only on this page)

=== on 23 Jul 2015, 13:53:27 Ann Campbell wrote:
Rule origin: \https://groups.google.com/forum/#!topic/sonarqube/cYQdBhf00eo


Project is EJB if it contains JEE Beans (any one of javax.ejb.Singleton, MessageDriven, Stateless or Stateful) (@Local/@Remote interfaces are not mandatory)

endif::env-github,rspecator-view[]
