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

POJO that implements a generic interface cannot be serialized

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 3.6.0
    • 3.5.0
    • POJO
    • None

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: