Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-1522

Conditional observer should not use javax.enterprise.context.spi.Context.get(Contextual<T>, CreationalContext<T>)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 2.1.0.Final
    • 2.1.0.CR1
    • None
    • None

    Description

      The problem is a context might try to create a new bean instance even if no CreationalContext is given.

      It seems the CDI spec is not completely clear in this area:

      The get() method may not create a new instance of the given contextual type unless a CreationalContext is given.

      But it doesn't specify which of the two methods. The javadoc on the other hand states the javax.enterprise.context.spi.Context.get(Contextual<T>, CreationalContext<T>) method returns "the contextual instance".

      Nevertheless I think it would be definitely better to call javax.enterprise.context.spi.Context.get(Contextual<T>) to avoid confusion.

      Attachments

        Activity

          People

            mkouba@redhat.com Martin Kouba
            mkouba@redhat.com Martin Kouba
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: