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

Incremental validation doesn't re-validate related alternatives.

XMLWordPrintable

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

      EXECUTE: Create a CDI project (w/ CDI support enabled)
      EXECUTE: Add the following classes to the project source folder:

      package org.jboss;
      
      import javax.enterprise.inject.Alternative;
      
      @Alternative
      public class Test {
      }
      
      package org.jboss;
      
      import javax.enterprise.inject.Alternative;
      
      @Alternative
      public class Test1 extends Test {
      }
      
      package org.jboss;
      
      import javax.inject.Inject;
      
      public class Test3 {
      
      	@Inject Test test;
      }
      

      And beans.xml (should be placed in <source folder>/META-INF/ or <web content>/WEB-INF/ in case of dynamic web project):

      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
      	<alternatives>
      		<class&gt;org.jboss.Test1</class&gt;
      	</alternatives>
      </beans>
      

      EXECUTE: Build the project.
      ASSERT: There is no CDI problem markers on Test3.test field.
      EXECUTE: Replace the beans.xml be the following file:

      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
      </beans>
      

      EXECUTE: Save the file.
      FAILURE: The following CDI problem marker doesn't appear on Test3.test field: "No bean is eligible for injection to the injection point [JSR-299 §5.2.1]"
      ASSERT: The following CDI problem marker appears on Test3.test field: "No bean is eligible for injection to the injection point [JSR-299 §5.2.1]"

            alexeykazakov Alexey Kazakov
            alexeykazakov Alexey Kazakov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: