Skip to content
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

fix: Avoid creating message string prematurely for streaming calls #3622

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public abstract class StateCheckingResponseObserver<V> implements ResponseObserv
* ensuring consistent state.
*/
public final void onStart(StreamController controller) {
Preconditions.checkState(!isStarted, getClass() + " is already started.");
Preconditions.checkState(!isStarted, "%s is already started.", getClass());
isStarted = true;

onStartImpl(controller);
Expand All @@ -56,7 +56,7 @@ public final void onStart(StreamController controller) {
* consistent state.
*/
public final void onResponse(V response) {
Preconditions.checkState(!isClosed, getClass() + " received a response after being closed.");
Preconditions.checkState(!isClosed, "%s received a response after being closed.", getClass());
onResponseImpl(response);
}

Expand All @@ -67,7 +67,7 @@ public final void onResponse(V response) {
* state.
*/
public final void onComplete() {
Preconditions.checkState(!isClosed, getClass() + " tried to double close.");
Preconditions.checkState(!isClosed, "%s tried to double close.", getClass());
isClosed = true;
onCompleteImpl();
}
Expand All @@ -79,7 +79,7 @@ public final void onComplete() {
* consistent state.
*/
public final void onError(Throwable t) {
Preconditions.checkState(!isClosed, getClass() + " received error after being closed", t);
Preconditions.checkState(!isClosed, "%s received error after being closed", t, getClass());
isClosed = true;
onErrorImpl(t);
}
Expand Down
Loading