Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-184

@Any should allow injection of type if exactly one bean present

XMLWordPrintable

    • Workaround Exists
    • Hide

      Use @Current

      Show
      Use @Current
    • Low

      Typically @Any is used to inject a built-in type that allows dynamic select of a bean. However, if there is exactly one bean of a type present, then @Any should be able to stand in for @Current.

      @Any Drink drink;

      See AnyInjectionTest in the tck.

      Currently, the RI is throwing the following exception:

      "An injection point annotated javax.enterprise.inject.Any must have a type parameter"

      at org.jboss.webbeans.BeanValidator.checkFacadeInjectionPoint(BeanValidator.java:201)
      at org.jboss.webbeans.BeanValidator.validate(BeanValidator.java:103)
      at org.jboss.webbeans.bootstrap.WebBeansBootstrap.boot(WebBeansBootstrap.java:210)

              pmuiratbleepbleep Pete Muir (Inactive)
              dan.j.allen Dan Allen (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: