Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2653

POJO that implements a generic interface cannot be serialized

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6.0
    • Affects Version/s: 3.5.0
    • Component/s: POJO
    • None

      I ran into a problem with POJO classes that implement a generic interface. Basically, the getDeclaredMethods function used in PojoBuilderHelper returns signatures for both the generic property type and the actual property type and then it gets upset because it thinks there are two methods with the same name and different types. I've attached a minimal example that demonstrates this issue. Unfortunately, due to JAVA-2620, adding @BsonIgnore to the property/methods in question doesn't fix this.

            Assignee:
            ross@mongodb.com Ross Lawley
            Reporter:
            vuser Zoe Snape
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: