Skip to content

Commit 93271bb

Browse files
committed
JAVA-877: move org.bson.LazyDBList to com.mongodb
1 parent 4ede426 commit 93271bb

5 files changed

Lines changed: 47 additions & 4 deletions

File tree

src/main/com/mongodb/DBCollection.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
package com.mongodb;
2020

2121
// Mongo
22-
23-
import org.bson.LazyDBList;
2422
import org.bson.types.ObjectId;
2523

2624
import java.util.ArrayList;

src/main/com/mongodb/LazyDBCallback.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package com.mongodb;
1717

1818
import java.util.Iterator;
19+
import java.util.List;
1920
import java.util.logging.Logger;
2021

2122
import org.bson.LazyBSONCallback;
@@ -45,6 +46,11 @@ public Object createObject( byte[] data, int offset ){
4546
return o;
4647
}
4748

49+
@Override
50+
public List createArray(byte[] data, int offset) {
51+
return new LazyDBList(data, offset, this);
52+
}
53+
4854
public Object createDBRef( String ns, ObjectId id ){
4955
return new DBRef( _db, ns, id );
5056
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright (c) 2008 - 2013 10gen, Inc. <http://10gen.com>
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.mongodb;
17+
18+
import org.bson.LazyBSONCallback;
19+
import org.bson.io.BSONByteBuffer;
20+
21+
public class LazyDBList extends org.bson.LazyDBList {
22+
23+
public LazyDBList(final byte[] data, final LazyBSONCallback callback) {
24+
super(data, callback);
25+
}
26+
27+
public LazyDBList(final byte[] data, final int offset, final LazyBSONCallback callback) {
28+
super(data, offset, callback);
29+
}
30+
31+
public LazyDBList(final BSONByteBuffer buffer, final LazyBSONCallback callback) {
32+
super(buffer, callback);
33+
}
34+
35+
public LazyDBList(final BSONByteBuffer buffer, final int offset, final LazyBSONCallback callback) {
36+
super(buffer, offset, callback);
37+
}
38+
}

src/main/org/bson/LazyBSONCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public Object createObject( byte[] data, int offset ){
6464

6565
@SuppressWarnings("rawtypes")
6666
public List createArray( byte[] data, int offset ){
67-
return new LazyDBList( data, offset, this );
67+
return new LazyBSONList( data, offset, this );
6868
}
6969

7070
public Object createDBRef( String ns, ObjectId id ){

src/main/org/bson/LazyDBList.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010

1111
/**
1212
* @author scotthernandez
13-
*
13+
* @deprecated Please use {@link com.mongodb.LazyDBList} instead.
1414
*/
15+
@Deprecated
1516
public class LazyDBList extends LazyBSONList implements DBObject {
1617
private static final long serialVersionUID = -4415279469780082174L;
1718

0 commit comments

Comments
 (0)