You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "John D. Ament (JIRA)" <ji...@apache.org> on 2017/08/06 19:20:02 UTC

[jira] [Created] (OWB-1207) Inconsistent behavior of the instance behind CDI.current()

John D. Ament created OWB-1207:
----------------------------------

             Summary: Inconsistent behavior of the instance behind CDI.current()
                 Key: OWB-1207
                 URL: https://issues.apache.org/jira/browse/OWB-1207
             Project: OpenWebBeans
          Issue Type: Bug
            Reporter: John D. Ament


The behavior of CDI.current() is a bit odd, and seems to have a bug in it.

Suppose I have the following:

{code}
Instance x = CDI.current().select(SomeClass, someQualifiers);
Instance y = CDI.current().select(SomeClass).select(someQualifiers)
{code}

Those two instances should be pointing to same set of beans, have the same set of qualifiers, but they do not.  x will in fact have an extra Default qualifier that y does not have.  The default qualifier is not expected here.  This happens because the return value of `instance()` in `OwbCDI` selects a default qualifier, and the method taking var args for type and annotations does a merge, whereas the second method of selecting just qualifiers does a replacement.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)