A few more BSON fixes
This commit is contained in:
parent
112870b537
commit
b8d6f57602
Binary file not shown.
Binary file not shown.
|
@ -265,12 +265,15 @@ public class RubyBSONCallback implements BSONCallback {
|
||||||
|
|
||||||
public void gotObjectId( String name , ObjectId id ){
|
public void gotObjectId( String name , ObjectId id ){
|
||||||
byte[] jbytes = id.toByteArray();
|
byte[] jbytes = id.toByteArray();
|
||||||
RubyArray arg = ja2ra(jbytes);
|
RubyArray arg = RubyArray.newArray( _runtime, 12 );
|
||||||
|
for( int i=0; i<jbytes.length; i++) {
|
||||||
|
arg.store( i, _runtime.newFixnum(jbytes[i] & 0xFF) );
|
||||||
|
}
|
||||||
Object[] args = new Object[] { arg };
|
Object[] args = new Object[] { arg };
|
||||||
|
|
||||||
Object result = JavaEmbedUtils.invokeMethod(_runtime, _rbclsObjectId, "new", args, Object.class);
|
Object result = JavaEmbedUtils.invokeMethod(_runtime, _rbclsObjectId, "new", args, Object.class);
|
||||||
|
|
||||||
_put( name, (RubyObject)result );
|
_put( name, (RubyObject)result );
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Incredibly annoying to deserialize to a Ruby DBRef. Might just
|
// TODO: Incredibly annoying to deserialize to a Ruby DBRef. Might just
|
||||||
|
|
|
@ -565,8 +565,6 @@ module BSON
|
||||||
ARRAY
|
ARRAY
|
||||||
when Regexp
|
when Regexp
|
||||||
REGEX
|
REGEX
|
||||||
when ObjectID
|
|
||||||
OID
|
|
||||||
when ObjectId
|
when ObjectId
|
||||||
OID
|
OID
|
||||||
when DBRef
|
when DBRef
|
||||||
|
|
Loading…
Reference in New Issue