Skip to content

Commit 1837cae

Browse files
author
Ryan
committed
simplified check for error code.
1 parent f634fe8 commit 1837cae

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/main/org/bson/BSONException.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
package org.bson;
1818

1919
/**
20-
* A general runtime exception raised in BSON processing.
20+
* A general runtime exception raised in BSON processing.
2121
*/
2222
public class BSONException extends RuntimeException {
2323

@@ -56,7 +56,7 @@ public BSONException( final int errorCode, final String msg, final Throwable t )
5656
super( msg, t );
5757
_errorCode = errorCode;
5858
}
59-
59+
6060
/**
6161
* Returns the error code.
6262
* @return The error code.
@@ -66,9 +66,7 @@ public BSONException( final int errorCode, final String msg, final Throwable t )
6666
/**
6767
* Returns true if the error code is set (i.e., not null).
6868
*/
69-
public boolean hasErrorCode() {
70-
return (_errorCode != null) ? true : false;
71-
}
69+
public boolean hasErrorCode() { return (_errorCode != null); }
7270

7371
private Integer _errorCode = null;
7472
}

0 commit comments

Comments
 (0)