-
Notifications
You must be signed in to change notification settings - Fork 53
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
feat: add FunctionalInterface
annotation
#1515
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ce3aab0
feat: add `FunctionalInterface` annotation
JoeWang1127 a24b853
Merge branch 'main' into feat/add-annotation
JoeWang1127 dcd832f
exclude internal api
JoeWang1127 092fb12
revise according to code review
JoeWang1127 52bc5c4
remove annotation on beta api
JoeWang1127 00fc12d
remove annotation
JoeWang1127 9c844b1
remove annotation
JoeWang1127 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,15 +100,7 @@ public void call(final BidiStreamObserver<RequestT, ResponseT> bidiObserver) { | |
/** Listens to server responses and send requests when the network is free. */ | ||
public void call( | ||
final BidiStreamObserver<RequestT, ResponseT> bidiObserver, ApiCallContext context) { | ||
internalCall( | ||
bidiObserver, | ||
new ClientStreamReadyObserver<RequestT>() { | ||
@Override | ||
public void onReady(ClientStream<RequestT> stream) { | ||
bidiObserver.onReady(stream); | ||
} | ||
}, | ||
context); | ||
internalCall(bidiObserver, bidiObserver, context); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice. |
||
} | ||
|
||
/** | ||
|
@@ -183,11 +175,8 @@ public ClientStream<RequestT> splitCall( | |
ResponseObserver<ResponseT> responseObserver, ApiCallContext context) { | ||
return internalCall( | ||
responseObserver, | ||
new ClientStreamReadyObserver<RequestT>() { | ||
@Override | ||
public void onReady(ClientStream<RequestT> stream) { | ||
// no op | ||
} | ||
stream -> { | ||
// no op | ||
}, | ||
context); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 and above inner-public interface are so weird, probably because we wanted to mimic the same behavior of
java.util.function.Supplier
in Java 7. That being said, I think addingFunctionalInterface
to them are appropriate because they are exposed on the surface through other public methods. But we may want to consider replacing theseSupplier
withjava.util.function.Supplier
as part of the Java 8 adoption project. CC: @suztomoThere 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.
Thanks for the comments.
I'll do a research on replacing
Supplier
withjava.util.function.Supplier
. Leave it as-is as this is out of scope of this PR.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.
It would break binary compatibility, and so we'd need a major rev bump.
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.
Are you referring to the idea of replacing
Supplier
withjava.util.function.Supplier
? I think it depends on how we approach it, if we do it naively yes it would be a breaking change. We could approach it in steps like adding alternatives first, replacing the ones that are not on the surface first etc.