Added null check for return of Sasl.createClient, just in case the GSSAPI mechanism is not supported in whatever Java VM we're running against.
Synchronize close method in MonotonicSession.
Closing input stream in finally block
Closing DBCursor in finally block
Closing DBCursor in finally block
Given BSONBinaryReader optional ownership of the InputBuffer, and if it owns it, close the buffer when the reader is closed.
Given BSONBinaryWriter optional ownership of the OutputBuffer, and if it owns it, close the buffer when the writer is closed.
Wrapping java.nio.ByteBuffer in an interface called ByteBuf, which is Closeable, so that a ByteBuffer doesn't have to be paired with a BufferPool.
The ByteBuf.close method is implemented in a private inner class of PowerOfTwoByteBufferPool to return the underlying ByteBuffer to the pool.
Because of this, BufferPool just needs the get() method, and so is renamed to BufferProvider.  And PooledInputBuffer is no longer necessary,
so has been deleted.
Most of the changes here are just automated refactoring and renaming.
Cleaning up callback code to ensure that the callback is only called once.
FindBugs warnings