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

EnumCodec stop to work

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 3.6.0
    • Component/s: POJO
    • None

      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

        1. BLABLA.java
          0.1 kB
          f-renout
        2. MongoStorageTest.java
          2 kB
          f-renout
        3. Toto.java
          0.5 kB
          f-renout

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

              Created:
              Updated:
              Resolved: