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

As-you-type CDI validation

    XMLWordPrintable

Details

    • Validation that occurs as-you-type has been added for context dependency injection.
    • Documented as Feature Request

    Description

      It would be great to have as-you-type CDI (JSR-299) validation for Java and beans.xml files.

      1. Create a cdi project.
      2. Create the following bean:

      package test;
      
      import javax.enterprise.inject.Produces;
      import javax.inject.Inject;
      import javax.inject.Named;
      
      public class Test {
      
      	@Inject @Named Test2 create;
      
      	@Produces
      	@Named
      	public Test2 create() {
      		return new Test2();
      	}
      
      	@Produces
      	@Named("create")
      	public Test2 create2() {
      		return new Test2();
      	}
      
      	public static class Test2 {
      	}
      }
      

      3. There three waring messages. One on the injection sying there is an ambiguous injection point. And two on the producers sying there a two beans with the same EL names.
      4. Comment line #18: // @Named("create"). Don't save the file!
      5. All the warings are gone.

      6. Save the file.
      7. Open the beans.xml
      8. Add the following code there:

      <alternatives>
      	<class&gt;test.Test</class&gt;
      </alternatives>
      

      9. Don't save the file.
      10. There is an error on test.Test since the class bean is not an alternative.

      https://vimeo.com/47965113

      Attachments

        1. JBIDE-10611.ogv
          1.43 MB
        2. out-3.avi
          4.80 MB

        Issue Links

          Activity

            People

              alexeykazakov Alexey Kazakov
              alexeykazakov Alexey Kazakov
              Isaac Rooskov Isaac Rooskov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: