Skip to content

Commit 9eff876

Browse files
committed
Change BSONReader and BSONWriter to BsonReader and BsonWriter in all comments
1 parent 0e446bd commit 9eff876

25 files changed

Lines changed: 156 additions & 157 deletions

bson/src/main/org/bson/AbstractBsonReader.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public abstract class AbstractBsonReader implements Closeable, BsonReader {
4040
private boolean closed;
4141

4242
/**
43-
* Initializes a new instance of the BSONReader class.
43+
* Initializes a new instance of the BsonReader class.
4444
*
4545
*/
4646
protected AbstractBsonReader() {
@@ -154,7 +154,7 @@ public boolean readBoolean() {
154154
}
155155

156156
@Override
157-
public abstract BsonType readBSONType();
157+
public abstract BsonType readBsonType();
158158

159159
@Override
160160
public long readDateTime() {
@@ -179,7 +179,7 @@ public void readEndArray() {
179179
throwInvalidContextType("readEndArray", getContext().getContextType(), BsonContextType.ARRAY);
180180
}
181181
if (getState() == State.TYPE) {
182-
readBSONType(); // will set state to EndOfArray if at end of array
182+
readBsonType(); // will set state to EndOfArray if at end of array
183183
}
184184
if (getState() != State.END_OF_ARRAY) {
185185
throwInvalidState("ReadEndArray", State.END_OF_ARRAY);
@@ -200,7 +200,7 @@ public void readEndDocument() {
200200
getContext().getContextType(), BsonContextType.DOCUMENT, BsonContextType.SCOPE_DOCUMENT);
201201
}
202202
if (getState() == State.TYPE) {
203-
readBSONType(); // will set state to EndOfDocument if at end of document
203+
readBsonType(); // will set state to EndOfDocument if at end of document
204204
}
205205
if (getState() != State.END_OF_DOCUMENT) {
206206
throwInvalidState("readEndDocument", State.END_OF_DOCUMENT);
@@ -413,7 +413,7 @@ public void readMinKey(final String name) {
413413
@Override
414414
public String readName() {
415415
if (state == State.TYPE) {
416-
readBSONType();
416+
readBsonType();
417417
}
418418
if (state != State.NAME) {
419419
throwInvalidState("readName", State.NAME);
@@ -515,7 +515,7 @@ protected void throwInvalidState(final String methodName, final State... validSt
515515
*/
516516
protected void verifyBSONType(final String methodName, final BsonType requiredBsonType) {
517517
if (state == State.INITIAL || state == State.SCOPE_DOCUMENT || state == State.TYPE) {
518-
readBSONType();
518+
readBsonType();
519519
}
520520
if (state == State.NAME) {
521521
// ignore name
@@ -538,7 +538,7 @@ protected void verifyBSONType(final String methodName, final BsonType requiredBs
538538
* @throws BsonSerializationException
539539
*/
540540
protected void verifyName(final String expectedName) {
541-
readBSONType();
541+
readBsonType();
542542
String actualName = readName();
543543
if (!actualName.equals(expectedName)) {
544544
String message = format("Expected element name to be '%s', not '%s'.",
@@ -549,7 +549,7 @@ protected void verifyName(final String expectedName) {
549549

550550
protected void checkPreconditions(final String methodName, final BsonType type) {
551551
if (isClosed()) {
552-
throw new IllegalStateException("BSONWriter is closed");
552+
throw new IllegalStateException("BsonWriter is closed");
553553
}
554554

555555
verifyBSONType(methodName, type);

bson/src/main/org/bson/AbstractBsonWriter.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public abstract class AbstractBsonWriter implements BsonWriter, Closeable {
4242
private boolean closed;
4343

4444
/**
45-
* Initializes a new instance of the BSONWriter class.
45+
* Initializes a new instance of the BsonWriter class.
4646
*
4747
* @param settings The writer settings.
4848
*/
@@ -51,7 +51,7 @@ protected AbstractBsonWriter(final BsonWriterSettings settings) {
5151
}
5252

5353
/**
54-
* Initializes a new instance of the BSONWriter class.
54+
* Initializes a new instance of the BsonWriter class.
5555
*
5656
* @param settings The writer settings.
5757
* @param validator the field name validator
@@ -283,7 +283,7 @@ protected boolean checkState(final State[] validStates) {
283283

284284
protected void checkPreconditions(final String methodName, final State... validStates) {
285285
if (isClosed()) {
286-
throw new IllegalStateException("BSONWriter");
286+
throw new IllegalStateException("BsonWriter");
287287
}
288288

289289
if (!checkState(validStates)) {
@@ -353,7 +353,7 @@ public void pipe(final BsonReader reader) {
353353
private void pipeDocument(final BsonReader reader) {
354354
reader.readStartDocument();
355355
writeStartDocument();
356-
while (reader.readBSONType() != BsonType.END_OF_DOCUMENT) {
356+
while (reader.readBsonType() != BsonType.END_OF_DOCUMENT) {
357357
writeName(reader.readName());
358358
pipeValue(reader);
359359
}
@@ -364,7 +364,7 @@ private void pipeDocument(final BsonReader reader) {
364364
private void pipeArray(final BsonReader reader) {
365365
reader.readStartArray();
366366
writeStartArray();
367-
while (reader.readBSONType() != BsonType.END_OF_DOCUMENT) {
367+
while (reader.readBsonType() != BsonType.END_OF_DOCUMENT) {
368368
pipeValue(reader);
369369
}
370370
reader.readEndArray();

bson/src/main/org/bson/BsonBinaryReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public InputBuffer getBuffer() {
6363
}
6464

6565
@Override
66-
public BsonType readBSONType() {
66+
public BsonType readBsonType() {
6767
if (isClosed()) {
6868
throw new IllegalStateException("BSONBinaryWriter");
6969
}

bson/src/main/org/bson/BsonContextType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
package org.bson;
1818

1919
/**
20-
* Used by BSONReader and BSONWriter implementations to represent the current context.
20+
* Used by BsonReader and BsonWriter implementations to represent the current context.
2121
*
2222
* @since 3.0.0
2323
*/

bson/src/main/org/bson/BsonDocumentReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ protected void doSkipValue() {
154154
}
155155

156156
@Override
157-
public BsonType readBSONType() {
157+
public BsonType readBsonType() {
158158
if (getState() == State.INITIAL || getState() == State.SCOPE_DOCUMENT) {
159159
// there is an implied type of Document for the top level and for scope documents
160160
setCurrentBsonType(BsonType.DOCUMENT);

bson/src/main/org/bson/BsonReader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
*/
3030
public interface BsonReader {
3131
/**
32-
* @return The current BSONType.
32+
* @return The current BsonType.
3333
*/
3434
BsonType getCurrentBsonType();
3535

@@ -75,7 +75,7 @@ public interface BsonReader {
7575
*
7676
* @return A BSONType.
7777
*/
78-
BsonType readBSONType();
78+
BsonType readBsonType();
7979

8080
/**
8181
* Reads a BSON DateTime from the reader.

bson/src/main/org/bson/BsonWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ public interface BsonWriter {
335335
void writeUndefined(String name);
336336

337337
/**
338-
* Reads a single document from a BSONReader and writes it to this.
338+
* Reads a single document from a BsonReader and writes it to this.
339339
*
340340
* @param reader The source.
341341
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public BsonArray decode(final BsonReader reader) {
4343
reader.readStartArray();
4444

4545
List<BsonValue> list = new ArrayList<BsonValue>();
46-
while (reader.readBSONType() != BsonType.END_OF_DOCUMENT) {
46+
while (reader.readBsonType() != BsonType.END_OF_DOCUMENT) {
4747
list.add(readValue(reader));
4848
}
4949

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public BsonDocument decode(final BsonReader reader) {
6666
List<BsonElement> keyValuePairs = new ArrayList<BsonElement>();
6767

6868
reader.readStartDocument();
69-
while (reader.readBSONType() != BsonType.END_OF_DOCUMENT) {
69+
while (reader.readBsonType() != BsonType.END_OF_DOCUMENT) {
7070
String fieldName = reader.readName();
7171
keyValuePairs.add(new BsonElement(fieldName, readValue(reader)));
7272
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
import org.bson.types.Undefined;
2222

2323
/**
24-
* Allows reading and writing of the BSON Undefined type. On encoding, it will write the correct type to the BSONWriter, but ignore the
25-
* value, and on decoding it will read the type off the BSONReader and return an Undefined type, which simply represents a placeholder for
24+
* Allows reading and writing of the BSON Undefined type. On encoding, it will write the correct type to the BsonWriter, but ignore the
25+
* value, and on decoding it will read the type off the BsonReader and return an Undefined type, which simply represents a placeholder for
2626
* the undefined value.
2727
* <p/>
2828
* The undefined type is deprecated (see the spec).

0 commit comments

Comments
 (0)