Uploaded image for project: 'CDI Specification Issues'
  1. CDI Specification Issues
  2. CDI-227

BeanManager#resolve() is underspecified for corner cases

XMLWordPrintable

      The CDI api's are mainly used to develop (portable) extensions. In practice, we see that those so called portable extensions are not portable at all due to underspecified api's.
      For example BeanManager.resolve(set) doesn't specify how to deal with an empty set or null. This leads to incompatible implementations and unportable extensions. See for example https://issues.apache.org/jira/browse/OWB-625 (Unfortunately Websphere 8 includes openwebbeans < 1.1.3, making Seam3 not out-of-the-box usable). Currently most implementations (weld, owb and candi) return null for an empty set. OWB returns null when null is passed, others will throw an exception.
      To create extensions that are truly portable, we should specify all corner cases (what about BeanManager.getBean((String)null)?). In theory developers should not depend on undefined behavior, but in practice we all do (Seam3 is full of examples).
      Ideally, we should go over the complete public API and specify what should happen with these corner cases: null-values, empty collections, ...
      Just adding that an IllegalArgumentException should be thrown in case of null for example would suffice.
      These things are very easy to incorporate in the TCK and would contribute a lot to the success of portable extensions

              pmuiratbleepbleep Pete Muir (Inactive)
              guy.veraghtert Guy Veraghtert (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: