This is using 3.4.0-SNAPSHOT as of today, when decoding a mgo encoded object with decimal128 values.
org.bson.BSONException: Unexpected BSON type: DECIMAL128 at org.bson.BsonBinaryReader.doSkipValue(BsonBinaryReader.java:357) ~[mongo-java-driver-3.4.0-SNAPSHOT.jar:na] at org.bson.AbstractBsonReader.skipValue(AbstractBsonReader.java:492) ~[mongo-java-driver-3.4.0-SNAPSHOT.jar:na] at org.bson.LazyBSONObject.keySet(LazyBSONObject.java:151) ~[mongo-java-driver-3.4.0-SNAPSHOT.jar:na] at com.mongodb.LazyDBCallback.createObject(LazyDBCallback.java:41) ~[mongo-java-driver-3.4.0-SNAPSHOT.jar:na] at org.bson.LazyBSONCallback.gotBinary(LazyBSONCallback.java:41) ~[mongo-java-driver-3.4.0-SNAPSHOT.jar:na] at org.bson.LazyBSONDecoder.decode(LazyBSONDecoder.java:63) ~[mongo-java-driver-3.4.0-SNAPSHOT.jar:na] at com.mongodb.LazyDBDecoder.readObject(LazyDBDecoder.java:39) ~[mongo-java-driver-3.4.0-SNAPSHOT.jar:na]
On the encoding side, the following test case will complain about Can't serialize class org.bson.types.Decimal128.
BSONObject obj = new BasicBSONObject(); obj.put("i", Decimal128.parse("1")); OutputBuffer ob = new BasicOutputBuffer(); DBEncoder encoder = DefaultDBEncoder.FACTORY.create(); encoder.writeObject(ob, obj);
- related to
-
JAVA-2298 Improve test coverage for legacy BSON implementation
- Closed