Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

Commit a15ba8d

Browse files
chore: first pass on cleaning up build warnings (#2843)
* test: fix tests after junit5 introduction Change-Id: I07ec31eda18f13cdab34aaed7e55e5c08ea078df # Conflicts: # google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/PreparedStatementImplTest.java # google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTestUtils.java # google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryRetryTest.java * fix warnings Change-Id: Idac85099557a02fa040ef7d8d695c49004a13e89 * chore: generate libraries at Fri Mar 13 17:59:40 UTC 2026 * improve view name formating Change-Id: I85e271194cfada199186db271b042eeedf9fd7cf * fix tests & address feedback Change-Id: I44e660ab37999be0e98f71db3c089df03c123aad * more tweaks Change-Id: Ia1f48d96c0bb2cfd0596629de87c8015c330276d * chore: generate libraries at Fri Mar 13 19:23:29 UTC 2026 * more tweaks Change-Id: I4f9f1dd6191d2971d95303f9bc939c4d0999c6e7 * more tweaks to Type Change-Id: Ic37e638d362ce976240a978356f7a78662d4e409 * improve errorprone config and suppress some warnings in Types Change-Id: I6d05d0a2b40c11dc0d3888f97a685f2b698a270d * fix integration test Change-Id: Iaee7b16aa966aad6409ec6f7aec88fc0e6d59e56 --------- Co-authored-by: cloud-java-bot <cloud-java-bot@google.com>
1 parent 9771f89 commit a15ba8d

91 files changed

Lines changed: 959 additions & 862 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

google-cloud-bigtable/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@
427427
<compilerArgs>
428428
<arg>-XDcompilePolicy=simple</arg>
429429
<arg>--should-stop=ifError=FLOW</arg>
430-
<arg>-Xplugin:ErrorProne -XepExcludedPaths:.*/generated-sources/.*</arg>
430+
<arg>-Xplugin:ErrorProne -XepDisableWarningsInGeneratedCode -Xep:MissingSummary:OFF -Xep:InlineMeSuggester:OFF -Xep:AutoValueImmutableFields:OFF -Xep:ObjectEqualsForPrimitives:OFF</arg>
431431

432432
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
433433
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,8 +1418,8 @@ public RestoredTableResult restoreTable(RestoreTableRequest request)
14181418
}
14191419

14201420
/**
1421-
* <p>This method is obsolete. For the recommended proto-based approach, please see
1422-
* {@link com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#restoreTableAsync(com.google.bigtable.admin.v2.RestoreTableRequest)}.
1421+
* This method is obsolete. For the recommended proto-based approach, please see {@link
1422+
* com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#restoreTableAsync(com.google.bigtable.admin.v2.RestoreTableRequest)}.
14231423
*
14241424
* <p>Restores a backup to a new table with the specified configuration asynchronously.
14251425
*
@@ -1442,7 +1442,7 @@ public RestoredTableResult restoreTable(RestoreTableRequest request)
14421442
* },
14431443
* MoreExecutors.directExecutor()
14441444
* );
1445-
* </pre>
1445+
* }</pre>
14461446
*/
14471447
@ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.")
14481448
public ApiFuture<RestoredTableResult> restoreTableAsync(RestoreTableRequest request) {

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/internal/NameUtil.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package com.google.cloud.bigtable.admin.v2.internal;
1717

1818
import com.google.api.core.InternalApi;
19+
import com.google.cloud.bigtable.data.v2.models.TableId;
1920
import java.util.regex.Matcher;
2021
import java.util.regex.Pattern;
2122
import javax.annotation.Nonnull;
@@ -53,6 +54,10 @@ public static String formatTableName(String projectId, String instanceId, String
5354
return formatInstanceName(projectId, instanceId) + "/tables/" + tableId;
5455
}
5556

57+
public static String formatTableName(String projectId, String instanceId, TableId tableId) {
58+
return formatInstanceName(projectId, instanceId) + "/tables/" + tableId.getTableId();
59+
}
60+
5661
public static String formatMaterializedViewName(
5762
@Nonnull String projectId, @Nonnull String instanceId, @Nonnull String materializedViewId) {
5863
return formatInstanceName(projectId, instanceId) + "/materializedViews/" + materializedViewId;

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/AppProfile.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting toProto() {
223223
return proto;
224224
}
225225

226+
@SuppressWarnings("EqualsGetClass")
226227
@Override
227228
public boolean equals(Object o) {
228229
if (this == o) {
@@ -320,6 +321,7 @@ MultiClusterRoutingUseAny toProto() {
320321
return proto;
321322
}
322323

324+
@SuppressWarnings("EqualsGetClass")
323325
@Override
324326
public boolean equals(Object o) {
325327
if (this == o) {
@@ -426,6 +428,7 @@ com.google.bigtable.admin.v2.AppProfile.StandardIsolation toProto() {
426428
return proto;
427429
}
428430

431+
@SuppressWarnings("EqualsGetClass")
429432
@Override
430433
public boolean equals(Object o) {
431434
if (this == o) {
@@ -527,6 +530,7 @@ public DataBoostIsolationReadOnly toProto() {
527530
return proto;
528531
}
529532

533+
@SuppressWarnings("EqualsGetClass")
530534
@Override
531535
public boolean equals(Object o) {
532536
if (this == o) {

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Backup.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ public EncryptionInfo getEncryptionInfo() {
223223
return EncryptionInfo.fromProto(proto.getEncryptionInfo());
224224
}
225225

226+
@SuppressWarnings("EqualsGetClass")
226227
@Override
227228
public boolean equals(Object o) {
228229
if (this == o) {

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Cluster.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ public String getKmsKeyName() {
214214
return null;
215215
}
216216

217+
@SuppressWarnings("EqualsGetClass")
217218
@Override
218219
public boolean equals(Object o) {
219220
if (this == o) {

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ClusterAutoscalingConfig.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ public com.google.bigtable.admin.v2.PartialUpdateClusterRequest toProto(String p
177177
return this.builder.build();
178178
}
179179

180+
@SuppressWarnings({"EqualsGetClass", "ObjectEqualsForPrimitives"})
180181
@Override
181182
public boolean equals(Object o) {
182183
if (this == o) {

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateInstanceRequest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
package com.google.cloud.bigtable.admin.v2.models;
1717

1818
import com.google.api.core.InternalApi;
19-
import com.google.bigtable.admin.v2.Instance.Type;
2019
import com.google.cloud.bigtable.admin.v2.internal.NameUtil;
2120
import com.google.common.base.Preconditions;
2221
import com.google.common.collect.Lists;
@@ -74,7 +73,7 @@ private CreateInstanceRequest(@Nonnull String instanceId) {
7473

7574
builder.setInstanceId(instanceId);
7675
builder.getInstanceBuilder().setDisplayName(instanceId);
77-
builder.getInstanceBuilder().setType(Type.PRODUCTION);
76+
builder.getInstanceBuilder().setType(com.google.bigtable.admin.v2.Instance.Type.PRODUCTION);
7877
}
7978

8079
/**
@@ -156,7 +155,7 @@ public CreateInstanceRequest addCluster(
156155
CreateClusterRequest clusterRequest =
157156
CreateClusterRequest.of("ignored-instance-id", clusterId)
158157
.setZone(zone)
159-
.setServeNodes(serveNodes)
158+
.setScalingMode(StaticClusterSize.of(serveNodes))
160159
.setStorageType(storageType);
161160
clusterRequests.add(clusterRequest);
162161

@@ -212,7 +211,7 @@ public CreateInstanceRequest addCmekCluster(
212211
CreateClusterRequest clusterRequest =
213212
CreateClusterRequest.of("ignored-instance-id", clusterId)
214213
.setZone(zone)
215-
.setServeNodes(serveNodes)
214+
.setScalingMode(StaticClusterSize.of(serveNodes))
216215
.setStorageType(storageType)
217216
.setKmsKeyName(kmsKeyName);
218217
clusterRequests.add(clusterRequest);

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Type.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* @see com.google.bigtable.admin.v2.Type
2828
*/
2929
@BetaApi
30+
@SuppressWarnings("SameNameButDifferent")
3031
public interface Type {
3132
/**
3233
* These types are marker types that allow types to be used as the input to aggregate function.

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateInstanceRequest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
import com.google.api.core.InternalApi;
1919
import com.google.bigtable.admin.v2.Instance;
20-
import com.google.bigtable.admin.v2.Instance.Type;
2120
import com.google.bigtable.admin.v2.PartialUpdateInstanceRequest;
2221
import com.google.cloud.bigtable.admin.v2.internal.NameUtil;
2322
import com.google.common.base.Preconditions;
@@ -64,7 +63,7 @@ public UpdateInstanceRequest setDisplayName(@Nonnull String displayName) {
6463
*/
6564
@SuppressWarnings("WeakerAccess")
6665
public UpdateInstanceRequest setProductionType() {
67-
builder.getInstanceBuilder().setType(Type.PRODUCTION);
66+
builder.getInstanceBuilder().setType(Instance.Type.PRODUCTION);
6867
updateFieldMask(Instance.TYPE_FIELD_NUMBER);
6968

7069
return this;

0 commit comments

Comments
 (0)