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

Abstract classes should not be included into CDI model as beans

XMLWordPrintable

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

      EXECUTE: Create class

      @Named("mybean")
      public abstract class MyBean {
      }
      

      ASSERT: There is no bean MyBean available for injection.
      ASSERT: Bean name "mybean" is not available for EL.

      One exception is the providing of built-in beans (e.g. specification requires CDI implementation to provide bean with type javax.validation.Validator), but such a bean can be provided by CDI implementations in a non-standard way, so that we should ensure the bean instance in model binding it to an abstract type.

      The other temporal exception is to be made for handling injection points in abstract types, it should be covered by separate issue. Now both validation, open-ons, tests access injection points through beans obtained with getBeans(IPath). We should consider migrating to getInjections(IPath), but that may involve extensive changes. So, let method getBeans(IPath) be out of the scope of this issue, and let us comment it properly that it currently returns both beans and bean-like CDI annotated objects.

            scabanovich Viacheslav Kabanovich (Inactive)
            scabanovich Viacheslav Kabanovich (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: