We found that the bytecode fields of reactivemongo.bson.BSONObjectID changed from 0.12.5 to 0.12.7. This is not a request for any change just a warning for users that might be using java serialization of BSONObjectID.
I extracted the class file from the jars and ran javap against them (emphasis mine)
~/.i/c/o/r/jars $ javap -p BSONObjectID-12.5.class
Compiled from "types.scala"
public class reactivemongo.bson.BSONObjectID implements reactivemongo.bson.BSONValue,scala.Serializable,scala.Equals {
public static final long serialVersionUID;
private final byte[] raw;
private final byte code;
private java.lang.String stringify;
private int hashCode;
private volatile byte bitmap$0;
public static boolean fromTime$default$2();
public static reactivemongo.bson.BSONObjectID fromTime(long, boolean);
public static reactivemongo.bson.BSONObjectID generate();
public static scala.util.Try<reactivemongo.bson.BSONObjectID> parse(java.lang.String);
public static scala.Option<byte[]> unapply(reactivemongo.bson.BSONObjectID);
public static reactivemongo.bson.BSONObjectID apply(byte[]);
public static reactivemongo.bson.BSONObjectID apply(java.lang.String);
private java.lang.String stringify$lzycompute();
private int hashCode$lzycompute();
private byte[] raw();
public byte code();
public java.lang.String stringify();
public java.lang.String toString();
public boolean canEqual(java.lang.Object);
public boolean equals(java.lang.Object);
public int hashCode();
public long time();
public int timeSecond();
public byte[] valueAsArray();
public reactivemongo.bson.BSONObjectID(byte[]);
}
~/.i/c/o/r/jars $ javap -p BSONObjectID-12.7.class
Compiled from "types.scala"
public class reactivemongo.bson.BSONObjectID implements reactivemongo.bson.BSONValue,scala.Serializable,scala.Equals {
public static final long serialVersionUID;
private final byte[] reactivemongo$bson$BSONObjectID$$raw;
private final byte code;
private java.lang.String stringify;
private int hashCode;
private volatile byte bitmap$0;
public static boolean fromTime$default$2();
public static reactivemongo.bson.BSONObjectID fromTime(long, boolean);
public static reactivemongo.bson.BSONObjectID generate();
public static scala.util.Try<reactivemongo.bson.BSONObjectID> parse(java.lang.String);
public static scala.Option<byte[]> unapply(reactivemongo.bson.BSONObjectID);
public static reactivemongo.bson.BSONObjectID apply(byte[]);
public static reactivemongo.bson.BSONObjectID apply(java.lang.String);
private java.lang.String stringify$lzycompute();
private int hashCode$lzycompute();
public byte[] reactivemongo$bson$BSONObjectID$$raw();
public byte code();
public java.lang.String stringify();
public java.lang.String toString();
public boolean canEqual(java.lang.Object);
public boolean equals(java.lang.Object);
public int hashCode();
public long time();
public int timeSecond();
public byte[] valueAsArray();
public int byteSize();
public reactivemongo.bson.BSONObjectID(byte[]);
}
And here is the diff of the above output
~/.i/c/o/r/jars $ diff (javap -p BSONObjectID-12.5.class|psub) (javap -p BSONObjectID-12.7.class|psub)
4c4
< private final byte[] raw;
---
> private final byte[] reactivemongo$bson$BSONObjectID$$raw;
18c18
< private byte[] raw();
---
> public byte[] reactivemongo$bson$BSONObjectID$$raw();
27a28
> public int byteSize();
~/.i/c/o/r/jars $
@inline override private[reactivemongo] def byteSize = raw.size
Since this method is annotated with @inline and it references the private field raw, the scala compiler must have decided to compile things differently.
Cheers