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

Non-deterministic behavior of CDI.current()

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Duplicate Issue
    • Affects Version/s: 2.0.Beta1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      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

      otherwise the first provider which can access the container is used.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                meetoblivion John Ament
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: