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

EnumCodec stop to work

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Critical - P2 Critical - P2
    • None
    • 3.6.0
    • POJO
    • None

    Description

      It seems that the enum codec stop to work in 3.6.0

      When I use the MongoStorageTest class usin mongo-java-driver 3.5.0
      the test work fine (object is inserted)
      When I change the driver to 3.6.0 I got a nullPointerException

      java.lang.NullPointerException at org.bson.codecs.pojo.PojoCodecImpl.shouldSpecialize(PojoCodecImpl.java:337)

      After trying to debug a little bit it appear that the enum BLABLA is considered having class java.lang.class when converted to TypeWithTypeParameters so the EnumPropertyCodecProvider return null instead of an instance of EnumCodec

      Attachments

        1. BLABLA.java
          0.1 kB
        2. MongoStorageTest.java
          2 kB
        3. Toto.java
          0.5 kB

        Activity

          People

            Unassigned Unassigned
            f-renout f-renout
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: