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

Commit 927cad8

Browse files
sinelawNoam LewisTimur Sadykov
authored
fix: handle error-prone warnings (#1334)
* fix: pom.xml - remove duplicate dependencies / plugin clauses that cause warnings This prevents the following errors: $ mvn install -DskipTests=true [INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for com.google.auth:google-auth-library-oauth2-http:jar:1.20.1-SNAPSHOT [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: junit:junit:jar -> duplicate declaration of version (?) @ line 249, column 17 [WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-failsafe-plugin @ line 193, column 15 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] * fix: add missing @OverRide annotations on overriding methods --------- Co-authored-by: Noam Lewis <noamlewis@google.com> Co-authored-by: Timur Sadykov <stim@google.com>
1 parent 7e26861 commit 927cad8

18 files changed

Lines changed: 46 additions & 18 deletions

appengine/java/com/google/auth/appengine/AppEngineCredentials.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ public static Builder newBuilder() {
139139
return new Builder();
140140
}
141141

142+
@Override
142143
public Builder toBuilder() {
143144
return new Builder(this);
144145
}
@@ -175,6 +176,7 @@ public AppIdentityService getAppIdentityService() {
175176
return appIdentityService;
176177
}
177178

179+
@Override
178180
public AppEngineCredentials build() {
179181
return new AppEngineCredentials(scopes, appIdentityService);
180182
}

oauth2_http/java/com/google/auth/oauth2/CloudShellCredentials.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ public boolean equals(Object obj) {
115115
return this.authPort == other.authPort;
116116
}
117117

118+
@Override
118119
public Builder toBuilder() {
119120
return new Builder(this);
120121
}
@@ -142,6 +143,7 @@ public int getAuthPort() {
142143
return authPort;
143144
}
144145

146+
@Override
145147
public CloudShellCredentials build() {
146148
return new CloudShellCredentials(authPort);
147149
}

oauth2_http/java/com/google/auth/oauth2/ComputeEngineCredentials.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ private void readObject(ObjectInputStream input) throws IOException, ClassNotFou
535535
transportFactory = newInstance(transportFactoryClassName);
536536
}
537537

538+
@Override
538539
public Builder toBuilder() {
539540
return new Builder(this);
540541
}
@@ -675,6 +676,7 @@ public Collection<String> getDefaultScopes() {
675676
return defaultScopes;
676677
}
677678

679+
@Override
678680
public ComputeEngineCredentials build() {
679681
return new ComputeEngineCredentials(this);
680682
}

oauth2_http/java/com/google/auth/oauth2/DownscopedCredentials.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ public Builder setHttpTransportFactory(HttpTransportFactory transportFactory) {
185185
return this;
186186
}
187187

188+
@Override
188189
public DownscopedCredentials build() {
189190
return new DownscopedCredentials(
190191
sourceCredential, credentialAccessBoundary, transportFactory);

oauth2_http/java/com/google/auth/oauth2/ExternalAccountAuthorizedUserCredentials.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ public boolean equals(Object obj) {
294294
&& Objects.equals(this.quotaProjectId, credentials.quotaProjectId);
295295
}
296296

297+
@Override
297298
public Builder toBuilder() {
298299
return new Builder(this);
299300
}
@@ -501,6 +502,7 @@ public Builder setClientSecret(String clientSecret) {
501502
* @param quotaProjectId the quota and billing project id to set
502503
* @return this {@code Builder} object
503504
*/
505+
@Override
504506
@CanIgnoreReturnValue
505507
public Builder setQuotaProjectId(String quotaProjectId) {
506508
super.setQuotaProjectId(quotaProjectId);
@@ -513,12 +515,14 @@ public Builder setQuotaProjectId(String quotaProjectId) {
513515
* @param accessToken the access token
514516
* @return this {@code Builder} object
515517
*/
518+
@Override
516519
@CanIgnoreReturnValue
517520
public Builder setAccessToken(AccessToken accessToken) {
518521
super.setAccessToken(accessToken);
519522
return this;
520523
}
521524

525+
@Override
522526
public ExternalAccountAuthorizedUserCredentials build() {
523527
return new ExternalAccountAuthorizedUserCredentials(this);
524528
}

oauth2_http/java/com/google/auth/oauth2/ExternalAccountCredentials.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,7 @@ public Builder setTokenInfoUrl(String tokenInfoUrl) {
848848
* @param quotaProjectId the quota and billing project id to set
849849
* @return this {@code Builder} object
850850
*/
851+
@Override
851852
@CanIgnoreReturnValue
852853
public Builder setQuotaProjectId(String quotaProjectId) {
853854
super.setQuotaProjectId(quotaProjectId);
@@ -941,6 +942,7 @@ Builder setEnvironmentProvider(EnvironmentProvider environmentProvider) {
941942
return this;
942943
}
943944

945+
@Override
944946
public abstract ExternalAccountCredentials build();
945947
}
946948
}

oauth2_http/java/com/google/auth/oauth2/GdchCredentials.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ public static Builder newBuilder() {
311311
return new Builder();
312312
}
313313

314+
@Override
314315
public Builder toBuilder() {
315316
return new Builder(this);
316317
}
@@ -475,6 +476,7 @@ public int getLifetime() {
475476
return lifetime;
476477
}
477478

479+
@Override
478480
public GdchCredentials build() {
479481
return new GdchCredentials(this);
480482
}

oauth2_http/java/com/google/auth/oauth2/GoogleCredentials.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@ public static Builder newBuilder() {
406406
return new Builder();
407407
}
408408

409+
@Override
409410
public Builder toBuilder() {
410411
return new Builder(this);
411412
}
@@ -502,6 +503,7 @@ protected Builder(GoogleCredentials.Builder builder) {
502503
this.universeDomain = builder.universeDomain;
503504
}
504505

506+
@Override
505507
public GoogleCredentials build() {
506508
return new GoogleCredentials(this);
507509
}

oauth2_http/java/com/google/auth/oauth2/IdTokenCredentials.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ public boolean equals(Object obj) {
149149
&& Objects.equals(this.targetAudience, other.targetAudience);
150150
}
151151

152+
@Override
152153
public Builder toBuilder() {
153154
return new Builder()
154155
.setIdTokenProvider(this.idTokenProvider)
@@ -198,6 +199,7 @@ public List<IdTokenProvider.Option> getOptions() {
198199
return this.options;
199200
}
200201

202+
@Override
201203
public IdTokenCredentials build() {
202204
return new IdTokenCredentials(this);
203205
}

oauth2_http/java/com/google/auth/oauth2/IdentityPoolCredentials.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ public static class Builder extends ExternalAccountCredentials.Builder {
183183
super(credentials);
184184
}
185185

186+
@Override
186187
@CanIgnoreReturnValue
187188
public Builder setWorkforcePoolUserProject(String workforcePoolUserProject) {
188189
super.setWorkforcePoolUserProject(workforcePoolUserProject);

0 commit comments

Comments
 (0)