Uploaded image for project: 'OpenEJB'
  1. OpenEJB
  2. OPENEJB-1081

Find most specific setter in ClientInjectionProcessor.findSetter

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Not A Problem
    • None
    • 4.7.0
    • None
    • None

    Description

      The findSetter method doesn't currently return the most specific
      setter. If you were for instance to try inject a String field called
      "myString", and you have 2 methods:
      void setMyString(Object)
      and
      void setMyString(String)

      OpenEJB would use the first it finds, instead of the most specific.

      This path adds the most specific injector functionality. It will prefer the exact class, and if not available prefer the class lowest down (closest to) the property to be injected's class.

      So if you were to inject an IllegalArgumentException, the preference would be as follows: IllegalArgumentException, RuntimeException, Exception, Throwable, Serializable, Object, but NumberFormatException won't be chosen.

      Attachments

        1. findSetter.patch
          3 kB
          Quintin Beukes

        Activity

          People

            Unassigned Unassigned
            quintin@last.za.net Quintin Beukes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: