Jackson JSON Processor
  1. Jackson JSON Processor
  2. JACKSON-189

Beans with overloaded setters aren't handled well

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 1.3
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Testcase included:
      yes
    • Number of attachments :
      2

      Description

      It looks like BasicBeanDescription throws an exception if multiple setters are found for a property:

      Conflicting setter definitions for property "value": OverloadedBean#setValue(1 params) vs OverloadedBean#setValue(1 params)

      I've been able to get around this limitation by subclassing BasicBeanDescription and overriding okNameForSetter to check not just for a reasonable name but also that there is a getter that has a return type the same as the setter's argument. Since okNameForSetter is called so frequently it would be much more efficient to be done only when a potential problem is detected (in BasicBeanDescription.findSetters).

      1. OverloadedSettersTest.java
        0.9 kB
        Bryan Barkley
      2. patch.txt
        3 kB
        Bryan Barkley

        Activity

        Hide
        Tatu Saloranta added a comment -

        I was hoping to get this in 1.5.0, but after working through issues with AnnotationIntrospector design, I realized that there are bigger changes that should be made first (see JACKSON-242), before this issue can be resolved.
        This means that I will defer this issue until 1.6, to be done as part of bigger overhaul of property/annotation handling.

        Show
        Tatu Saloranta added a comment - I was hoping to get this in 1.5.0, but after working through issues with AnnotationIntrospector design, I realized that there are bigger changes that should be made first (see JACKSON-242 ), before this issue can be resolved. This means that I will defer this issue until 1.6, to be done as part of bigger overhaul of property/annotation handling.
        Hide
        David Tanner added a comment -

        Will this be getting any attention? Or is it essentially dead.

        Show
        David Tanner added a comment - Will this be getting any attention? Or is it essentially dead.
        Hide
        Tatu Saloranta added a comment -

        No work is on-going with this.
        This is not to say there isn't still strong desire to improve this area, just that AFAIK no one is actively working on it.
        Patches would be most welcome.

        I may also need to merge some entries as there seem to be duplicate entries (esp. if considering github bug tracker too).

        Show
        Tatu Saloranta added a comment - No work is on-going with this. This is not to say there isn't still strong desire to improve this area, just that AFAIK no one is actively working on it. Patches would be most welcome. I may also need to merge some entries as there seem to be duplicate entries (esp. if considering github bug tracker too).
        Hide
        Petar Tahchiev added a comment -

        Any update here? Do you think this will be fixed soon?

        Show
        Petar Tahchiev added a comment - Any update here? Do you think this will be fixed soon?
        Hide
        Tatu Saloranta added a comment -

        Codehaus Jira will be closed: all bug tracking now via github:

        https://github.com/FasterXML/jackson-databind/issues

        There are two known issues reported there,

        https://github.com/FasterXML/jackson-databind/issues/193
        https://github.com/FasterXML/jackson-databind/issues/327

        which will be worked on and hopefully cover same underlying problem.
        If root cause is different, please file a new bug at github.

        Show
        Tatu Saloranta added a comment - Codehaus Jira will be closed: all bug tracking now via github: https://github.com/FasterXML/jackson-databind/issues There are two known issues reported there, https://github.com/FasterXML/jackson-databind/issues/193 https://github.com/FasterXML/jackson-databind/issues/327 which will be worked on and hopefully cover same underlying problem. If root cause is different, please file a new bug at github.

          People

          • Assignee:
            Tatu Saloranta
            Reporter:
            Bryan Barkley
          • Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: