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

fix Bean#getBeanClass() definition

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Minor
    • 2.1 (Discussion)
    • None
    • Beans
    • None

    Description

      currently Bean#getBeanClass() is defined to return the class of the bean it produces but has one important exception: in case of a producer method or field it must return the class of the owner bean of this method or field.

      Imo this only causes troubles and doesn't add any benefit.

      • At the time when 'using' the Bean (create and destroy) we always ONLY need the type which is to be created.
      • At the time we create interceptors we ONLY need the type which is to be created;
      • At the time we create the normalscoping proxies we ONLY need the type which is to be created;

      In fact the only time we need the ownerBean is when scanning the methods and fields in it. And for creating we really need the owner-Bean and not it's bean-class!

      In OWB we worked around this by having our own method getReturnType() which consistently returns the type which gets created.

      Attachments

        Activity

          People

            Unassigned Unassigned
            struberg Mark Struberg (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: