Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-6644 Offer quick fixes for CDI validations
  3. JBIDE-7680

Quick fix for "Bean class of a session bean cannot be annotated @Interceptor/@Decorator [JSR-299 ยง3.2]" error markers

    XMLWordPrintable

Details

    • Documentation (Ref Guide, User Guide, etc.)
    • Not Required

    Description

      This quick fix should offer to delete @Interceptor/@Decorator annotation

      Test case:

      EXECUTE: Create CDI project
      EXECUTE: Create SessionBeanAnnotatedDecoratorBroken class

      package org.test;
      
      import javax.decorator.Decorator;
      import javax.ejb.Stateless;
      
      @Decorator
      @Stateless
      public class SessionBeanAnnotatedDecoratorBroken {
      
      }
      

      ASSERT: Both annotations (@Decorator and @Stateless) should be marked by problem marker
      EXECUTE: Point mouse to @Decorator or @Stateless annotation
      ASSERT: Text hover with "Delete @Decorator annotation from 'SessionBeanAnnotatedDecoratorBroken' class" appears

      EXECUTE: Create SessionBeanAnnotatedInterceptorBroken class

      package org.test;
      
      import javax.ejb.Singleton;
      import javax.interceptor.AroundInvoke;
      import javax.interceptor.Interceptor;
      import javax.interceptor.InvocationContext;
      
      @Interceptor
      @Singleton
      public class SessionBeanAnnotatedInterceptorBroken {
      	@AroundInvoke
      	public Object alwaysReturnThis(InvocationContext ctx) throws Exception {
      		return ctx.proceed();
      	}
      }
      

      ASSERT: Both annotations (@Interceptor and @Singleton) should be marked by problem marker
      EXECUTE: Point mouse to @Interceptor or @Singleton annotation
      ASSERT: Text hover with "Delete @Interceptor annotation from 'SessionBeanAnnotatedInterceptorBroken' class" appears

      Attachments

        1. SessionBeanAnnotatedDecorator1.png
          21 kB
          Daniel Azarov
        2. SessionBeanAnnotatedDecorator2.png
          23 kB
          Daniel Azarov
        3. SessionBeanAnnotatedInterceptor1.png
          23 kB
          Daniel Azarov
        4. SessionBeanAnnotatedInterceptor2.png
          25 kB
          Daniel Azarov

        Activity

          People

            dazarov_jira Daniel Azarov (Inactive)
            dazarov_jira Daniel Azarov (Inactive)
            Isaac Rooskov Isaac Rooskov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: