[JAVA-2714] EnumCodec stop to work Created: 20/Dec/17  Updated: 20/Dec/17  Resolved: 20/Dec/17

Status: Closed
Project: Java Driver
Component/s: POJO
Affects Version/s: 3.6.0
Fix Version/s: None

Type: Bug Priority: Critical - P2
Reporter: f-renout Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Java Source File BLABLA.java     Java Source File MongoStorageTest.java     Java Source File Toto.java    
Issue Links:
Duplicate
duplicates JAVA-2709 Pojo with method returning an Enum - ... Closed

 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



 Comments   
Comment by Jeffrey Yemin [ 20/Dec/17 ]

Glad to hear it.

Comment by f-renout [ 20/Dec/17 ]

I tried and the SNAPSHOT version fixes the issue

Comment by Jeffrey Yemin [ 20/Dec/17 ]

This could be a duplicate of JAVA-2709, which has been fixed and is scheduled for release in 3.6.1. If you'd like you can test against the 3.6.1-SNAPSHOT build, available at https://oss.sonatype.org/content/repositories/snapshots to see if it fixes the issue.

Generated at Thu Feb 08 08:57:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.