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

DocumentCodec cannot serialize embedded Set

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.0.1, 3.1.0
    • Affects Version/s: 3.0.0
    • Component/s: Codecs
    • Labels:
      None

      If an org.bson.Document contains a field whose value is a Set, serialization fails with

      org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class java.util.Collections$UnmodifiableSet.
      	at org.bson.codecs.configuration.CodecCache.getOrThrow(CodecCache.java:46)
      	at org.bson.codecs.configuration.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:63)
      	at org.bson.codecs.configuration.ChildCodecRegistry.get(ChildCodecRegistry.java:51)
      	at org.bson.codecs.DocumentCodec.writeValue(DocumentCodec.java:174)
      	at org.bson.codecs.DocumentCodec.writeMap(DocumentCodec.java:189)
      	at org.bson.codecs.DocumentCodec.writeValue(DocumentCodec.java:172)
      ...
      	at org.bson.codecs.DocumentCodec.encode(DocumentCodec.java:131)
      	at org.bson.codecs.DocumentCodec.encode(DocumentCodec.java:45)
      

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            jkemnade Jochen Kemnade
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: