Skip to content

Instantly share code, notes, and snippets.

@suztomo
Last active September 18, 2024 15:51
Show Gist options
  • Save suztomo/0dc82b1b04d9364ecb35421f8b65cc63 to your computer and use it in GitHub Desktop.
Save suztomo/0dc82b1b04d9364ecb35421f8b65cc63 to your computer and use it in GitHub Desktop.
AutoValue generated source files show differences
package com.google.api.generator.gapic.model;
import com.google.common.collect.ImmutableList;
import java.util.List;
import javax.annotation.Generated;
import javax.annotation.Nullable;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_Service extends Service {
private final String name;
@Nullable
private final String apiVersion;
private final String defaultHost;
private final ImmutableList<String> oauthScopes;
private final String pakkage;
private final String protoPakkage;
private final String originalJavaPackage;
private final String overriddenName;
private final boolean isDeprecated;
private final ImmutableList<Method> methods;
@Nullable
private final String description;
private AutoValue_Service(
String name,
@Nullable String apiVersion,
String defaultHost,
ImmutableList<String> oauthScopes,
String pakkage,
String protoPakkage,
String originalJavaPackage,
String overriddenName,
boolean isDeprecated,
ImmutableList<Method> methods,
@Nullable String description) {
this.name = name;
this.apiVersion = apiVersion;
this.defaultHost = defaultHost;
this.oauthScopes = oauthScopes;
this.pakkage = pakkage;
this.protoPakkage = protoPakkage;
this.originalJavaPackage = originalJavaPackage;
this.overriddenName = overriddenName;
this.isDeprecated = isDeprecated;
this.methods = methods;
this.description = description;
}
@Override
public String name() {
return name;
}
@Nullable
@Override
public String apiVersion() {
return apiVersion;
}
@Override
public String defaultHost() {
return defaultHost;
}
@Override
public ImmutableList<String> oauthScopes() {
return oauthScopes;
}
@Override
public String pakkage() {
return pakkage;
}
@Override
public String protoPakkage() {
return protoPakkage;
}
@Override
public String originalJavaPackage() {
return originalJavaPackage;
}
@Override
public String overriddenName() {
return overriddenName;
}
@Override
public boolean isDeprecated() {
return isDeprecated;
}
@Override
public ImmutableList<Method> methods() {
return methods;
}
@Nullable
@Override
public String description() {
return description;
}
@Override
public String toString() {
return "Service{"
+ "name=" + name + ", "
+ "apiVersion=" + apiVersion + ", "
+ "defaultHost=" + defaultHost + ", "
+ "oauthScopes=" + oauthScopes + ", "
+ "pakkage=" + pakkage + ", "
+ "protoPakkage=" + protoPakkage + ", "
+ "originalJavaPackage=" + originalJavaPackage + ", "
+ "overriddenName=" + overriddenName + ", "
+ "isDeprecated=" + isDeprecated + ", "
+ "methods=" + methods + ", "
+ "description=" + description
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Service) {
Service that = (Service) o;
return this.name.equals(that.name())
&& (this.apiVersion == null ? that.apiVersion() == null : this.apiVersion.equals(that.apiVersion()))
&& this.defaultHost.equals(that.defaultHost())
&& this.oauthScopes.equals(that.oauthScopes())
&& this.pakkage.equals(that.pakkage())
&& this.protoPakkage.equals(that.protoPakkage())
&& this.originalJavaPackage.equals(that.originalJavaPackage())
&& this.overriddenName.equals(that.overriddenName())
&& this.isDeprecated == that.isDeprecated()
&& this.methods.equals(that.methods())
&& (this.description == null ? that.description() == null : this.description.equals(that.description()));
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= name.hashCode();
h$ *= 1000003;
h$ ^= (apiVersion == null) ? 0 : apiVersion.hashCode();
h$ *= 1000003;
h$ ^= defaultHost.hashCode();
h$ *= 1000003;
h$ ^= oauthScopes.hashCode();
h$ *= 1000003;
h$ ^= pakkage.hashCode();
h$ *= 1000003;
h$ ^= protoPakkage.hashCode();
h$ *= 1000003;
h$ ^= originalJavaPackage.hashCode();
h$ *= 1000003;
h$ ^= overriddenName.hashCode();
h$ *= 1000003;
h$ ^= isDeprecated ? 1231 : 1237;
h$ *= 1000003;
h$ ^= methods.hashCode();
h$ *= 1000003;
h$ ^= (description == null) ? 0 : description.hashCode();
return h$;
}
@Override
public Service.Builder toBuilder() {
return new AutoValue_Service.Builder(this);
}
static final class Builder extends Service.Builder {
private String name;
private String apiVersion;
private String defaultHost;
private ImmutableList<String> oauthScopes;
private String pakkage;
private String protoPakkage;
private String originalJavaPackage;
private String overriddenName;
private boolean isDeprecated;
private ImmutableList<Method> methods;
private String description;
private byte set$0;
Builder() {
}
Builder(Service source) {
this.name = source.name();
this.apiVersion = source.apiVersion();
this.defaultHost = source.defaultHost();
this.oauthScopes = source.oauthScopes();
this.pakkage = source.pakkage();
this.protoPakkage = source.protoPakkage();
this.originalJavaPackage = source.originalJavaPackage();
this.overriddenName = source.overriddenName();
this.isDeprecated = source.isDeprecated();
this.methods = source.methods();
this.description = source.description();
set$0 = (byte) 1;
}
@Override
public Service.Builder setName(String name) {
if (name == null) {
throw new NullPointerException("Null name");
}
this.name = name;
return this;
}
@Override
public Service.Builder setApiVersion(String apiVersion) {
this.apiVersion = apiVersion;
return this;
}
@Override
public Service.Builder setDefaultHost(String defaultHost) {
if (defaultHost == null) {
throw new NullPointerException("Null defaultHost");
}
this.defaultHost = defaultHost;
return this;
}
@Override
public Service.Builder setOauthScopes(List<String> oauthScopes) {
this.oauthScopes = ImmutableList.copyOf(oauthScopes);
return this;
}
@Override
public Service.Builder setPakkage(String pakkage) {
if (pakkage == null) {
throw new NullPointerException("Null pakkage");
}
this.pakkage = pakkage;
return this;
}
@Override
public Service.Builder setProtoPakkage(String protoPakkage) {
if (protoPakkage == null) {
throw new NullPointerException("Null protoPakkage");
}
this.protoPakkage = protoPakkage;
return this;
}
@Override
public Service.Builder setOriginalJavaPackage(String originalJavaPackage) {
if (originalJavaPackage == null) {
throw new NullPointerException("Null originalJavaPackage");
}
this.originalJavaPackage = originalJavaPackage;
return this;
}
@Override
public Service.Builder setOverriddenName(String overriddenName) {
if (overriddenName == null) {
throw new NullPointerException("Null overriddenName");
}
this.overriddenName = overriddenName;
return this;
}
@Override
public Service.Builder setIsDeprecated(boolean isDeprecated) {
this.isDeprecated = isDeprecated;
set$0 |= (byte) 1;
return this;
}
@Override
public Service.Builder setMethods(List<Method> methods) {
this.methods = ImmutableList.copyOf(methods);
return this;
}
@Override
public Service.Builder setDescription(String description) {
this.description = description;
return this;
}
@Override
public Service build() {
if (set$0 != 1
|| this.name == null
|| this.defaultHost == null
|| this.oauthScopes == null
|| this.pakkage == null
|| this.protoPakkage == null
|| this.originalJavaPackage == null
|| this.overriddenName == null
|| this.methods == null) {
StringBuilder missing = new StringBuilder();
if (this.name == null) {
missing.append(" name");
}
if (this.defaultHost == null) {
missing.append(" defaultHost");
}
if (this.oauthScopes == null) {
missing.append(" oauthScopes");
}
if (this.pakkage == null) {
missing.append(" pakkage");
}
if (this.protoPakkage == null) {
missing.append(" protoPakkage");
}
if (this.originalJavaPackage == null) {
missing.append(" originalJavaPackage");
}
if (this.overriddenName == null) {
missing.append(" overriddenName");
}
if ((set$0 & 1) == 0) {
missing.append(" isDeprecated");
}
if (this.methods == null) {
missing.append(" methods");
}
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_Service(
this.name,
this.apiVersion,
this.defaultHost,
this.oauthScopes,
this.pakkage,
this.protoPakkage,
this.originalJavaPackage,
this.overriddenName,
this.isDeprecated,
this.methods,
this.description);
}
}
}
suztomo@suztomo2:~/sdk-platform-java$ find . -name generated-sources > /tmp/generated-sources-list
suztomo@suztomo2:~/sdk-platform-java$ cd ..
suztomo@suztomo2:~$ for P in $(cat /tmp/generated-sources-list ); do
> diff --brief --recursive "sdk-platform-java/${P}" "sdk-platform-java-jspecify/${P}"
> done
Files sdk-platform-java/./java-core/google-cloud-core/target/generated-sources/annotations/com/google/cloud/AutoValue_Binding.java and sdk-platform-java-jspecify/./java-core/google-cloud-core/target/generated-sources/annotations/com/google/cloud/AutoValue_Binding.java differ
Files sdk-platform-java/./java-core/google-cloud-core/target/generated-sources/annotations/com/google/cloud/AutoValue_Condition.java and sdk-platform-java-jspecify/./java-core/google-cloud-core/target/generated-sources/annotations/com/google/cloud/AutoValue_Condition.java differ
Files sdk-platform-java/./gax-java/gax/target/generated-sources/annotations/com/google/api/gax/batching/AutoValue_BatchEntry.java and sdk-platform-java-jspecify/./gax-java/gax/target/generated-sources/annotations/com/google/api/gax/batching/AutoValue_BatchEntry.java differ
Files sdk-platform-java/./gax-java/gax/target/generated-sources/annotations/com/google/api/gax/batching/AutoValue_BatchingSettings.java and sdk-platform-java-jspecify/./gax-java/gax/target/generated-sources/annotations/com/google/api/gax/batching/AutoValue_BatchingSettings.java differ
Files sdk-platform-java/./gax-java/gax/target/generated-sources/annotations/com/google/api/gax/batching/AutoValue_DynamicFlowControlSettings.java and sdk-platform-java-jspecify/./gax-java/gax/target/generated-sources/annotations/com/google/api/gax/batching/AutoValue_DynamicFlowControlSettings.java differ
Files sdk-platform-java/./gax-java/gax/target/generated-sources/annotations/com/google/api/gax/batching/AutoValue_FlowControlSettings.java and sdk-platform-java-jspecify/./gax-java/gax/target/generated-sources/annotations/com/google/api/gax/batching/AutoValue_FlowControlSettings.java differ
Files sdk-platform-java/./gax-java/gax/target/generated-sources/annotations/com/google/api/gax/core/AutoValue_FixedCredentialsProvider.java and sdk-platform-java-jspecify/./gax-java/gax/target/generated-sources/annotations/com/google/api/gax/core/AutoValue_FixedCredentialsProvider.java differ
Files sdk-platform-java/./gax-java/gax/target/generated-sources/annotations/com/google/api/gax/core/AutoValue_GoogleCredentialsProvider.java and sdk-platform-java-jspecify/./gax-java/gax/target/generated-sources/annotations/com/google/api/gax/core/AutoValue_GoogleCredentialsProvider.java differ
Files sdk-platform-java/./gax-java/gax/target/generated-sources/annotations/com/google/api/gax/rpc/AutoValue_ClientContext.java and sdk-platform-java-jspecify/./gax-java/gax/target/generated-sources/annotations/com/google/api/gax/rpc/AutoValue_ClientContext.java differ
Files sdk-platform-java/./gax-java/gax/target/generated-sources/annotations/com/google/api/gax/rpc/AutoValue_EndpointContext.java and sdk-platform-java-jspecify/./gax-java/gax/target/generated-sources/annotations/com/google/api/gax/rpc/AutoValue_EndpointContext.java differ
Files sdk-platform-java/./gax-java/gax/target/generated-sources/annotations/com/google/api/gax/rpc/AutoValue_ErrorDetails.java and sdk-platform-java-jspecify/./gax-java/gax/target/generated-sources/annotations/com/google/api/gax/rpc/AutoValue_ErrorDetails.java differ
Files sdk-platform-java/./gax-java/gax/target/generated-sources/annotations/com/google/api/gax/rpc/AutoValue_FixedHeaderProvider.java and sdk-platform-java-jspecify/./gax-java/gax/target/generated-sources/annotations/com/google/api/gax/rpc/AutoValue_FixedHeaderProvider.java differ
Files sdk-platform-java/./gax-java/gax-httpjson/target/generated-sources/annotations/com/google/api/gax/httpjson/AutoValue_ApiMethodDescriptor.java and sdk-platform-java-jspecify/./gax-java/gax-httpjson/target/generated-sources/annotations/com/google/api/gax/httpjson/AutoValue_ApiMethodDescriptor.java differ
Files sdk-platform-java/./gax-java/gax-httpjson/target/generated-sources/annotations/com/google/api/gax/httpjson/AutoValue_HttpJsonCallOptions.java and sdk-platform-java-jspecify/./gax-java/gax-httpjson/target/generated-sources/annotations/com/google/api/gax/httpjson/AutoValue_HttpJsonCallOptions.java differ
Files sdk-platform-java/./gax-java/gax-httpjson/target/generated-sources/annotations/com/google/api/gax/httpjson/AutoValue_HttpJsonMetadata.java and sdk-platform-java-jspecify/./gax-java/gax-httpjson/target/generated-sources/annotations/com/google/api/gax/httpjson/AutoValue_HttpJsonMetadata.java differ
Files sdk-platform-java/./gax-java/gax-httpjson/target/generated-sources/annotations/com/google/api/gax/httpjson/AutoValue_HttpRequestRunnable_RunnableResult.java and sdk-platform-java-jspecify/./gax-java/gax-httpjson/target/generated-sources/annotations/com/google/api/gax/httpjson/AutoValue_HttpRequestRunnable_RunnableResult.java differ
Files sdk-platform-java/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/engine/ast/AutoValue_AnnotationNode.java and sdk-platform-java-jspecify/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/engine/ast/AutoValue_AnnotationNode.java differ
Files sdk-platform-java/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/engine/ast/AutoValue_ClassDefinition.java and sdk-platform-java-jspecify/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/engine/ast/AutoValue_ClassDefinition.java differ
Files sdk-platform-java/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/engine/ast/AutoValue_ConcreteReference.java and sdk-platform-java-jspecify/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/engine/ast/AutoValue_ConcreteReference.java differ
Files sdk-platform-java/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/engine/ast/AutoValue_MethodDefinition.java and sdk-platform-java-jspecify/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/engine/ast/AutoValue_MethodDefinition.java differ
Files sdk-platform-java/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/engine/ast/AutoValue_MethodInvocationExpr.java and sdk-platform-java-jspecify/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/engine/ast/AutoValue_MethodInvocationExpr.java differ
Files sdk-platform-java/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/engine/ast/AutoValue_ThrowExpr.java and sdk-platform-java-jspecify/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/engine/ast/AutoValue_ThrowExpr.java differ
Files sdk-platform-java/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/engine/ast/AutoValue_TryCatchStatement.java and sdk-platform-java-jspecify/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/engine/ast/AutoValue_TryCatchStatement.java differ
Files sdk-platform-java/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/engine/ast/AutoValue_TypeNode.java and sdk-platform-java-jspecify/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/engine/ast/AutoValue_TypeNode.java differ
Files sdk-platform-java/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/engine/ast/AutoValue_VaporReference.java and sdk-platform-java-jspecify/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/engine/ast/AutoValue_VaporReference.java differ
Files sdk-platform-java/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/engine/ast/AutoValue_VariableExpr.java and sdk-platform-java-jspecify/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/engine/ast/AutoValue_VariableExpr.java differ
Files sdk-platform-java/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/gapic/composer/common/AutoValue_TransportContext.java and sdk-platform-java-jspecify/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/gapic/composer/common/AutoValue_TransportContext.java differ
Files sdk-platform-java/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/gapic/model/AutoValue_Field.java and sdk-platform-java-jspecify/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/gapic/model/AutoValue_Field.java differ
Files sdk-platform-java/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/gapic/model/AutoValue_GapicBatchingSettings.java and sdk-platform-java-jspecify/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/gapic/model/AutoValue_GapicBatchingSettings.java differ
Files sdk-platform-java/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/gapic/model/AutoValue_GapicContext.java and sdk-platform-java-jspecify/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/gapic/model/AutoValue_GapicContext.java differ
Files sdk-platform-java/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/gapic/model/AutoValue_HttpBindings_HttpBinding.java and sdk-platform-java-jspecify/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/gapic/model/AutoValue_HttpBindings_HttpBinding.java differ
Files sdk-platform-java/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/gapic/model/AutoValue_LongrunningOperation.java and sdk-platform-java-jspecify/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/gapic/model/AutoValue_LongrunningOperation.java differ
Files sdk-platform-java/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/gapic/model/AutoValue_Message.java and sdk-platform-java-jspecify/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/gapic/model/AutoValue_Message.java differ
Files sdk-platform-java/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/gapic/model/AutoValue_Method.java and sdk-platform-java-jspecify/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/gapic/model/AutoValue_Method.java differ
Files sdk-platform-java/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/gapic/model/AutoValue_ResourceName.java and sdk-platform-java-jspecify/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/gapic/model/AutoValue_ResourceName.java differ
Files sdk-platform-java/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/gapic/model/AutoValue_Service.java and sdk-platform-java-jspecify/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/gapic/model/AutoValue_Service.java differ
suztomo@suztomo2:~$ for P in $(cat /tmp/generated-sources-list ); do diff --brief --^Ccursive "sdk-platform-java/${P}" "sdk-platform-java-jspecify/${P}"; done
suztomo@suztomo2:~$ diff sdk-platform-java/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/gapic/model/AutoValue_Service.java sdk-platform-java-jspecify/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/gapic/model/AutoValue_Service.java
6c6
< import javax.annotation.Nullable;
---
> import org.jspecify.annotations.Nullable;
13,14c13
< @Nullable
< private final String apiVersion;
---
> private final @Nullable String apiVersion;
32,33c31
< @Nullable
< private final String description;
---
> private final @Nullable String description;
65d62
< @Nullable
67c64
< public String apiVersion() {
---
> public @Nullable String apiVersion() {
111d107
< @Nullable
113c109
< public String description() {
---
> public @Nullable String description() {
135c131
< public boolean equals(Object o) {
---
> public boolean equals(@Nullable Object o) {
190,197c186,193
< private String name;
< private String apiVersion;
< private String defaultHost;
< private ImmutableList<String> oauthScopes;
< private String pakkage;
< private String protoPakkage;
< private String originalJavaPackage;
< private String overriddenName;
---
> private @Nullable String name;
> private @Nullable String apiVersion;
> private @Nullable String defaultHost;
> private @Nullable ImmutableList<String> oauthScopes;
> private @Nullable String pakkage;
> private @Nullable String protoPakkage;
> private @Nullable String originalJavaPackage;
> private @Nullable String overriddenName;
199,200c195,196
< private ImmutableList<Method> methods;
< private String description;
---
> private @Nullable ImmutableList<Method> methods;
> private @Nullable String description;
suztomo@suztomo2:~$ diff sdk-platform-java/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/gapic/model/AutoValue_Service.java sdk-platform-java-jspecify/./gapic-generator-java/target/generated-sources/annotations/com/google/api/generator/gapic/model/AutoValue_Service.java
6c6
< import javax.annotation.Nullable;
---
> import org.jspecify.annotations.Nullable;
13,14c13
< @Nullable
< private final String apiVersion;
---
> private final @Nullable String apiVersion;
32,33c31
< @Nullable
< private final String description;
---
> private final @Nullable String description;
65d62
< @Nullable
67c64
< public String apiVersion() {
---
> public @Nullable String apiVersion() {
111d107
< @Nullable
113c109
< public String description() {
---
> public @Nullable String description() {
135c131
< public boolean equals(Object o) {
---
> public boolean equals(@Nullable Object o) {
190,197c186,193
< private String name;
< private String apiVersion;
< private String defaultHost;
< private ImmutableList<String> oauthScopes;
< private String pakkage;
< private String protoPakkage;
< private String originalJavaPackage;
< private String overriddenName;
---
> private @Nullable String name;
> private @Nullable String apiVersion;
> private @Nullable String defaultHost;
> private @Nullable ImmutableList<String> oauthScopes;
> private @Nullable String pakkage;
> private @Nullable String protoPakkage;
> private @Nullable String originalJavaPackage;
> private @Nullable String overriddenName;
199,200c195,196
< private ImmutableList<Method> methods;
< private String description;
---
> private @Nullable ImmutableList<Method> methods;
> private @Nullable String description;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment