Skip to content

Commit 3a8549e

Browse files
author
Brendan W. McAdams
committed
Fix dangling compile issues w/ tags; correct logic on getLastError defaults
1 parent 0d65bed commit 3a8549e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/com/mongodb/WriteConcern.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ public WriteConcern( String w , int wtimeout , boolean fsync, boolean j , Boolea
242242
public BasicDBObject getCommand(){
243243
BasicDBObject _command = new BasicDBObject( "getlasterror" , 1 );
244244

245-
if ( _wValue instanceof Integer && ( (Integer) _wValue > 0) ){
245+
if ( _wValue instanceof Integer && ( (Integer) _wValue > 0) ||
246+
( _wValue instanceof String && _wValue != null ) ){
246247
_command.put( "w" , _wValue );
247248
_command.put( "wtimeout" , _wtimeout );
248249
}

src/test/com/mongodb/ReplSetTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ public static void main( String args[] )
8585
while ( true ){
8686
_sleep();
8787
try {
88-
DBObject x = c.findOne(new BasicDBObject( "_id", 17 ), null,
89-
ReadPreference.withTags( new BasicDBObject("dc", "proximacentauri") ));
88+
DBObject x = c.findOne(new BasicDBObject( "_id", 17 ), null);
9089
System.out.println( x );
9190
Integer n = (Integer) x.get( "x" );
9291
if (n != null && n >= 150 )

0 commit comments

Comments
 (0)