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: missing serialVersionUID of serializable classes #2344

Merged
merged 3 commits into from
Mar 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: make HttpStorageOptions.RetryDependenciesAdapter transient
  • Loading branch information
BenWhitehead committed Mar 13, 2024
commit b0eef60da84159b601e795939c4f8885e5ee87c6
Expand Up @@ -36,6 +36,8 @@
import com.google.cloud.storage.spi.v1.StorageRpc;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableSet;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.util.Set;

Expand All @@ -52,7 +54,7 @@ public class HttpStorageOptions extends StorageOptions {
private static final String DEFAULT_HOST = "https://storage.googleapis.com";

private final HttpRetryAlgorithmManager retryAlgorithmManager;
private final RetryDependenciesAdapter retryDepsAdapter;
private transient RetryDependenciesAdapter retryDepsAdapter;

private HttpStorageOptions(Builder builder, StorageDefaults serviceDefaults) {
super(builder, serviceDefaults);
Expand Down Expand Up @@ -93,6 +95,11 @@ public boolean equals(Object obj) {
return obj instanceof HttpStorageOptions && baseEquals((HttpStorageOptions) obj);
}

private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
this.retryDepsAdapter = new RetryDependenciesAdapter();
}

public static HttpStorageOptions.Builder newBuilder() {
return new HttpStorageOptions.Builder().setHost(DEFAULT_HOST);
}
Expand Down Expand Up @@ -345,8 +352,7 @@ public ServiceRpc create(StorageOptions options) {
* We don't yet want to make HttpStorageOptions itself implement {@link RetryingDependencies} but
* we do need use it in a couple places, for those we create this adapter.
*/
private final class RetryDependenciesAdapter implements RetryingDependencies, Serializable {
private static long serialVersionUID = -7446566394108158974L;
private final class RetryDependenciesAdapter implements RetryingDependencies {
private RetryDependenciesAdapter() {}

@Override
Expand Down