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

BeanManager#getBeans() shall throw an Exception if called before AfterDeploymentValidation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 1.1.EDR
    • Fix Version/s: 1.1.FD
    • Component/s: Beans
    • Labels:

      Description

      We recently had the erroneous case in DeltaSpike that an Extension did call BeanManager#getBeans() in an @Observes ProcessBean method.

      Doing so leads to random behaviour as the result of getBeans() depends on the order in which the other beans got processed already. E.g. getBeans(Object.class) will return an empty list for the first bean getting processed, and will return all beans -1 for the last bean. That just makes no sense and will create unreproducible bugs.

      PROPOSAL:
      We shall add spec language to BeanManager#getBeans() that any invocation before the AfterDeploymentValidation phase will result in a deployment error.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pmuiratbleepbleep Pete Muir
              Reporter:
              struberg Mark Struberg
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: