Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-9418

In case of "Interceptor/Decorator cannot have a method with a parameter annotated @Observes [JSR-299 ยง10.4.2]" CDICoreValidator mixes up messages for Interceptor and for Decorator

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.3.0.M3
    • 3.3.0.M2
    • cdi
    • None

      Test case:

      EXECUTE: Create CDI project
      EXECUTE: Create ObserverInDecorator class

      package org.test;
      
      import javax.decorator.Decorator;
      import javax.decorator.Delegate;
      import javax.enterprise.event.Observes;
      import javax.inject.Inject;
      
      @Decorator
      public class ObserverInDecorator {
      	@Inject @Delegate @AAnnotation String str;
      	
      	public void method(@Observes String param){
      		
      	}
      }
      

      ASSERT: @Observes annotation should be marked by problem marker
      EXECUTE: Point mouse to @Observes annotation
      FAIL: Message is "Interceptor cannot have a method with a parameter annotated @Observes"

      EXECUTE: Create ObserverInInterceptor class

      package org.test;
      
      import javax.enterprise.event.Observes;
      import javax.interceptor.Interceptor;
      
      @Interceptor
      @FooBinding
      public class ObserverInInterceptor {
      	
      	public void method(@Observes String param){
      		
      	}
      }
      

      ASSERT: @Observes annotation should be marked by problem marker
      EXECUTE: Point mouse to @Observes annotation
      FAIL: Message is "Decorator cannot have a method with a parameter annotated @Observes"

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

              Created:
              Updated:
              Resolved: