-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add AsyncOperations to match SyncOperations #1027
Conversation
/** | ||
* <p>This class is not part of the public API and may be removed or changed at any time</p> | ||
*/ | ||
public final class AsyncOperations<TDocument> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied from SyncOperations and just changed the interface types to be the Async equivalents
@@ -74,7 +74,7 @@ | |||
import static java.util.Collections.singletonList; | |||
import static java.util.concurrent.TimeUnit.MILLISECONDS; | |||
|
|||
public final class Operations<TDocument> { | |||
final class Operations<TDocument> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can now be package private
@@ -171,8 +170,6 @@ private static Object checkValueTypes(final Object instance) { | |||
Object actual = instance instanceof Optional ? ((Optional<Object>) instance).orElse(instance) : instance; | |||
if (actual instanceof AsyncReadOperation || actual instanceof AsyncWriteOperation) { | |||
return getClassPrivateFieldValues(actual); | |||
} else if (actual instanceof Operations) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put a break point here and the branch was never entered, so I just removed it
JAVA-4795
One more change to clean up use of internal
operation
packageThe benefit is that, like with
SyncOperation
,AsyncOperations
doesn't expose the concrete class of any operation, and just deals with the interfaces likeAsyncReadOperation
andAsyncWriteOperation
.This gets us closer to a state where we can make all concrete Operation classes package private. The main thing stopping us from doing it now is that driver-legacy was never refactored to use SyncOperations and still constructs each operation directly.