Skip to content

Commit 01a259b

Browse files
committed
Renamed BsonDocumentWrapper document property to wrappedDocument
1 parent 37d74e1 commit 01a259b

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

bson/src/main/org/bson/codecs/BsonDocumentWrapperCodec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void encode(final BsonWriter writer, final BsonDocumentWrapper value) {
5959
bsonDocumentCodec.encode(writer, value);
6060
} else {
6161
Encoder encoder = value.getEncoder();
62-
encoder.encode(writer, value.getDocument());
62+
encoder.encode(writer, value.getWrappedDocument());
6363
}
6464
}
6565

bson/src/main/org/bson/types/BsonDocumentWrapper.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,26 +39,26 @@ public class BsonDocumentWrapper<T> extends BsonDocument {
3939

4040
private static final long serialVersionUID = 4164303588753136248L;
4141

42-
private final transient T document;
42+
private final transient T wrappedDocument;
4343
private final transient Encoder<T> encoder;
4444
private BsonDocument unwrapped;
4545

4646
/**
4747
* Construct a new instance with the given document and encoder for the document.
4848
*
49-
* @param document the wrapped document
49+
* @param wrappedDocument the wrapped document
5050
* @param encoder the encoder for the wrapped document
5151
*/
52-
public BsonDocumentWrapper(final T document, final Encoder<T> encoder) {
53-
if (document == null) {
52+
public BsonDocumentWrapper(final T wrappedDocument, final Encoder<T> encoder) {
53+
if (wrappedDocument == null) {
5454
throw new IllegalArgumentException("Document can not be null");
5555
}
56-
this.document = document;
56+
this.wrappedDocument = wrappedDocument;
5757
this.encoder = encoder;
5858
}
5959

60-
public T getDocument() {
61-
return document;
60+
public T getWrappedDocument() {
61+
return wrappedDocument;
6262
}
6363

6464
public Encoder<T> getEncoder() {
@@ -151,7 +151,7 @@ private BsonDocument getUnwrapped() {
151151
if (unwrapped == null) {
152152
BsonDocument unwrapped = new BsonDocument();
153153
BsonWriter writer = new BsonDocumentWriter(unwrapped);
154-
encoder.encode(writer, document);
154+
encoder.encode(writer, wrappedDocument);
155155
this.unwrapped = unwrapped;
156156
}
157157
return unwrapped;

driver/src/main/org/mongodb/operation/BsonDocumentWrapperHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class BsonDocumentWrapperHelper {
3030
static <T> List<T> toList(final BsonArray array) {
3131
List<T> list = new ArrayList<T>();
3232
for (BsonValue cur : array) {
33-
list.add(((BsonDocumentWrapper<T>) cur).getDocument());
33+
list.add(((BsonDocumentWrapper<T>) cur).getWrappedDocument());
3434
}
3535
return list;
3636
}
@@ -40,7 +40,7 @@ static <T> T toDocument(final BsonDocument document) {
4040
if (document == null) {
4141
return null;
4242
}
43-
return ((BsonDocumentWrapper<T>) document).getDocument();
43+
return ((BsonDocumentWrapper<T>) document).getWrappedDocument();
4444
}
4545

4646
private BsonDocumentWrapperHelper() {

0 commit comments

Comments
 (0)