Skip to content

Commit 56bb9cc

Browse files
committed
Do minor improvements in CommandMessage and SplittablePayload
1 parent 76115bd commit 56bb9cc

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

driver-core/src/main/com/mongodb/internal/connection/CommandMessage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ private List<BsonElement> getExtraElements(final OperationContext operationConte
286286
throw new MongoClientException("Attempting to use a ClientSession while connected to a server that doesn't support "
287287
+ "sessions");
288288
}
289-
if (getSettings().isSessionSupported() && responseExpected) {
289+
if (getSettings().isSessionSupported() && requireOpMsgResponse()) {
290290
extraElements.add(new BsonElement("lsid", sessionContext.getSessionId()));
291291
}
292292
}

driver-core/src/main/com/mongodb/internal/connection/SplittablePayload.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public String getPayloadName() {
117117
}
118118

119119
boolean hasPayload() {
120-
return writeRequestWithIndexes.size() > 0;
120+
return !writeRequestWithIndexes.isEmpty();
121121
}
122122

123123
public int size() {
@@ -137,10 +137,6 @@ public List<BsonDocument> getPayload() {
137137
.collect(Collectors.toList());
138138
}
139139

140-
public List<WriteRequestWithIndex> getWriteRequestWithIndexes() {
141-
return writeRequestWithIndexes;
142-
}
143-
144140
/**
145141
* @return the current position in the payload
146142
*/

0 commit comments

Comments
 (0)