All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.java.rules.squid.S3282.html Maven / Gradle / Ivy

There is a newer version: 8.6.0.37351
Show newest version

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

<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

@ExcludeDefaultInterceptors
public class MyExcludedClass implements MessageListener
{

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy