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

Regression (4.9.x to 4.11.x) lack of generic support in Maps

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Unknown Unknown
    • None
    • 4.11.0, 4.11.1, 4.11.2
    • None
    • None

    Description

      Summary

      4.9.x versions of the Java driver would handle this scenario gracefully:

      A class with a property like:

      public Map<String, MyGenericType<Animal>> decorators;

      where Animal is an abstract class with a discriminator.

      Such a field in a class now produces:

      CodecConfigurationException with the message: "[x] contains generic types that have not been specialised. Top level classes with generic types are not supported by the PojoCodec."

      Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).

      Version 4.11.x of the Java driver produces the error.  Version 4.9.x of the driver works fine.

      This is also affecting a widely used Java library, Quarkus: https://github.com/quarkusio/quarkus/issues/36397

       

      Attachments

        Activity

          People

            ross@mongodb.com Ross Lawley
            robert@unitydynamics.com Robert Fox
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: