]
John Ament closed CDI-674.
--------------------------
Resolution: Duplicate Issue
Already fixed, tag was out of date.
Non-deterministic behavior of CDI.current()
-------------------------------------------
Key: CDI-674
URL:
https://issues.jboss.org/browse/CDI-674
Project: CDI Specification Issues
Issue Type: Bug
Affects Versions: 2.0.Beta1
Reporter: John Ament
The behavior of CDI.current() is not deterministic. It uses {{findAny()}}. It should
use {{findFirst()}}
{{.findAny().orElseThrow(() -> new IllegalStateException("Unable to access
CDI"));}}
This also seems to go against what the javadocs say
bq. otherwise the first provider which can access the container is used.