mongo-java-driver icon indicating copy to clipboard operation
mongo-java-driver copied to clipboard

Fix type parameters not being passed to fallback property codec

Open GliczDev opened this issue 4 months ago • 3 comments

For some reason, type parameters weren't passed to fallback property codec, which caused an exception when trying to access them. Now, this issue is fixed.

GliczDev avatar Jul 11 '25 00:07 GliczDev

@rozza , I am not sure about the validity of the code changes proposed. For one thing, it breaks 6 unit testing cases; secondly it seems FallbackPropertyCodecProvider opted for calling CodecRegistry#get(Type) intentionally, for the reason that the other get(Type, List<Type>() might not be overridden, thus defeating the purpose of fallback as the last resort. How do you think?

NathanQingyangXu avatar Jul 11 '25 13:07 NathanQingyangXu

@GliczDev looks like this PR needs some tests and as @NathanQingyangXu mentioned this does appear to break some existing test cases.

To run the bson tests and checks run ./gradlew bson:check from the shell.

rozza avatar Jul 21 '25 08:07 rozza

It would also be good to add a regression test where this code path is used.

@rozza I'm sorry, I'm not familiar with mongo-java-driver project structure and tests really. Could you point me where I should add things?

GliczDev avatar Nov 02 '25 09:11 GliczDev