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

Quick fix for "Observer method has a parameter annotated @Disposes [JSR-299 ยง10.4.2]" error marker

XMLWordPrintable

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

      This quick fix should offer next:
      1. Delete @Disposes annotation
      2. Delete @Observes annotation

      Test case:

      EXECUTE: Create CDI project
      EXECUTE: Create TestBean class

      package org.test;
      
      import javax.enterprise.event.Observes;
      import javax.enterprise.inject.Disposes;
      import javax.enterprise.inject.Produces;
      
      public class TestBean {
      	@Produces
      	public String produce(){
      		return "a";
      	}
      	
      	public void method(@Observes String param1, @Disposes String param2){
      		
      	}
      }
      

      ASSERT: @Observes and @Disposes annotations should be marked by problem markers
      EXECUTE: Point mouse to @Observes or @Disposes annotations
      ASSERT: Text hover with quick fixes appears

        1. DisposerInObserver1.png
          43 kB
          Daniel Azarov
        2. DisposerInObserver2.png
          44 kB
          Daniel Azarov

              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

                Created:
                Updated:
                Resolved: