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

Revisit manipulation with InjectionPoint(s) in ProducerConfigurator

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 2.0 .Final
    • 2.0.Beta1
    • None
    • None

    Description

      Currently, ProducerConfigurator allows to add or replace injection points.

      Firstly, addInjectionPoints - if you think about this, it does not really make sense. You already have producer method defined, it has some body and uses its parameter within that method body. So if you add any IP, the method would not make use of it anyway.

      Secondly, replacing IP with injectionPoints - now this seems useful, but in fact it won't work. As it stands, replacing them in Weld only affects validation phase, not the injection itself. This means that if you have following producer:

      @Produces public Foo produceIt (@Default Bar) { //do stuff}
      

      and meant to replace the parameter with, say, @MyCustom Bar, you would in the end still end up with @Default Bar.

      The problem here is that spec states the following:

      Implementations of Producer and InjectionTarget must ensure that the set of injection points returned by getInjectionPoints() are injected by produce() or inject().

      However, spec says nothing about what should happen when you change implementation's set on IPs later.

      Note: I think we bumped into similar issue with BeanConfigurator (or some other configurator as well). I will try to dig up that discussion.

      Attachments

        Activity

          People

            asabotdu@redhat.com Antoine Sabot-Durand (Inactive)
            manovotn Matěj Novotný
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: