Skip to content

Commit

Permalink
fix: add missing @OverRide annotations on overriding methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Noam Lewis committed Nov 21, 2023
1 parent 3f5d27e commit 2e77c5b
Show file tree
Hide file tree
Showing 17 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public static Builder newBuilder() {
return new Builder();
}

@Override
public Builder toBuilder() {
return new Builder(this);
}
Expand Down Expand Up @@ -175,6 +176,7 @@ public AppIdentityService getAppIdentityService() {
return appIdentityService;
}

@Override
public AppEngineCredentials build() {
return new AppEngineCredentials(scopes, appIdentityService);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public boolean equals(Object obj) {
return this.authPort == other.authPort;
}

@Override
public Builder toBuilder() {
return new Builder(this);
}
Expand Down Expand Up @@ -142,6 +143,7 @@ public int getAuthPort() {
return authPort;
}

@Override
public CloudShellCredentials build() {
return new CloudShellCredentials(authPort);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ private void readObject(ObjectInputStream input) throws IOException, ClassNotFou
transportFactory = newInstance(transportFactoryClassName);
}

@Override
public Builder toBuilder() {
return new Builder(this);
}
Expand Down Expand Up @@ -570,6 +571,7 @@ public Collection<String> getScopes() {
return scopes;
}

@Override
public ComputeEngineCredentials build() {
return new ComputeEngineCredentials(transportFactory, scopes, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ public Builder setHttpTransportFactory(HttpTransportFactory transportFactory) {
return this;
}

@Override
public DownscopedCredentials build() {
return new DownscopedCredentials(
sourceCredential, credentialAccessBoundary, transportFactory);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ public boolean equals(Object obj) {
&& Objects.equals(this.quotaProjectId, credentials.quotaProjectId);
}

@Override
public Builder toBuilder() {
return new Builder(this);
}
Expand Down Expand Up @@ -499,6 +500,7 @@ public Builder setClientSecret(String clientSecret) {
* @param quotaProjectId the quota and billing project id to set
* @return this {@code Builder} object
*/
@Override
@CanIgnoreReturnValue
public Builder setQuotaProjectId(String quotaProjectId) {
super.setQuotaProjectId(quotaProjectId);
Expand All @@ -511,12 +513,14 @@ public Builder setQuotaProjectId(String quotaProjectId) {
* @param accessToken the access token
* @return this {@code Builder} object
*/
@Override
@CanIgnoreReturnValue
public Builder setAccessToken(AccessToken accessToken) {
super.setAccessToken(accessToken);
return this;
}

@Override
public ExternalAccountAuthorizedUserCredentials build() {
return new ExternalAccountAuthorizedUserCredentials(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,7 @@ public Builder setTokenInfoUrl(String tokenInfoUrl) {
* @param quotaProjectId the quota and billing project id to set
* @return this {@code Builder} object
*/
@Override
@CanIgnoreReturnValue
public Builder setQuotaProjectId(String quotaProjectId) {
super.setQuotaProjectId(quotaProjectId);
Expand Down Expand Up @@ -945,6 +946,7 @@ Builder setEnvironmentProvider(EnvironmentProvider environmentProvider) {
return this;
}

@Override
public abstract ExternalAccountCredentials build();
}
}
2 changes: 2 additions & 0 deletions oauth2_http/java/com/google/auth/oauth2/GdchCredentials.java
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ public static Builder newBuilder() {
return new Builder();
}

@Override
public Builder toBuilder() {
return new Builder(this);
}
Expand Down Expand Up @@ -475,6 +476,7 @@ public int getLifetime() {
return lifetime;
}

@Override
public GdchCredentials build() {
return new GdchCredentials(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ public static Builder newBuilder() {
return new Builder();
}

@Override
public Builder toBuilder() {
return new Builder(this);
}
Expand Down Expand Up @@ -356,6 +357,7 @@ protected Builder(GoogleCredentials credentials) {
this.quotaProjectId = credentials.quotaProjectId;
}

@Override
public GoogleCredentials build() {
return new GoogleCredentials(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public boolean equals(Object obj) {
&& Objects.equals(this.targetAudience, other.targetAudience);
}

@Override
public Builder toBuilder() {
return new Builder()
.setIdTokenProvider(this.idTokenProvider)
Expand Down Expand Up @@ -198,6 +199,7 @@ public List<IdTokenProvider.Option> getOptions() {
return this.options;
}

@Override
public IdTokenCredentials build() {
return new IdTokenCredentials(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ public static class Builder extends ExternalAccountCredentials.Builder {
super(credentials);
}

@Override
@CanIgnoreReturnValue
public Builder setWorkforcePoolUserProject(String workforcePoolUserProject) {
super.setWorkforcePoolUserProject(workforcePoolUserProject);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ public boolean equals(Object obj) {
&& Objects.equals(this.iamEndpointOverride, other.iamEndpointOverride);
}

@Override
public Builder toBuilder() {
return new Builder(this.sourceCredentials, this.targetPrincipal);
}
Expand Down Expand Up @@ -686,6 +687,7 @@ public HttpTransportFactory getHttpTransportFactory() {
return transportFactory;
}

@Override
@CanIgnoreReturnValue
public Builder setQuotaProjectId(String quotaProjectId) {
super.setQuotaProjectId(quotaProjectId);
Expand All @@ -708,6 +710,7 @@ public Calendar getCalendar() {
return this.calendar;
}

@Override
public ImpersonatedCredentials build() {
return new ImpersonatedCredentials(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ public ListenableFutureTask<OAuthValue> getTask() {
return this.task;
}

@Override
public void run() {
task.run();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ public Builder setRefreshHandler(OAuth2RefreshHandler handler) {
return this;
}

@Override
public OAuth2CredentialsWithRefresh build() {
return new OAuth2CredentialsWithRefresh(this);
}
Expand Down
1 change: 1 addition & 0 deletions oauth2_http/java/com/google/auth/oauth2/OAuth2Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class OAuth2Utils {

static class DefaultHttpTransportFactory implements HttpTransportFactory {

@Override
public HttpTransport create() {
return HTTP_TRANSPORT;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,7 @@ public static Builder newBuilder() {
return new Builder();
}

@Override
public Builder toBuilder() {
return new Builder(this);
}
Expand Down Expand Up @@ -1074,6 +1075,7 @@ public Builder setHttpTransportFactory(HttpTransportFactory transportFactory) {
return this;
}

@Override
@CanIgnoreReturnValue
public Builder setQuotaProjectId(String quotaProjectId) {
super.setQuotaProjectId(quotaProjectId);
Expand Down Expand Up @@ -1150,6 +1152,7 @@ public boolean isDefaultRetriesEnabled() {
return defaultRetriesEnabled;
}

@Override
public ServiceAccountCredentials build() {
return new ServiceAccountCredentials(this);
}
Expand Down
6 changes: 6 additions & 0 deletions oauth2_http/java/com/google/auth/oauth2/UserCredentials.java
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ public static Builder newBuilder() {
return new Builder();
}

@Override
public Builder toBuilder() {
return new Builder(this);
}
Expand Down Expand Up @@ -419,24 +420,28 @@ public Builder setHttpTransportFactory(HttpTransportFactory transportFactory) {
return this;
}

@Override
@CanIgnoreReturnValue
public Builder setAccessToken(AccessToken token) {
super.setAccessToken(token);
return this;
}

@Override
@CanIgnoreReturnValue
public Builder setExpirationMargin(Duration expirationMargin) {
super.setExpirationMargin(expirationMargin);
return this;
}

@Override
@CanIgnoreReturnValue
public Builder setRefreshMargin(Duration refreshMargin) {
super.setRefreshMargin(refreshMargin);
return this;
}

@Override
@CanIgnoreReturnValue
public Builder setQuotaProjectId(String quotaProjectId) {
super.setQuotaProjectId(quotaProjectId);
Expand All @@ -463,6 +468,7 @@ public HttpTransportFactory getHttpTransportFactory() {
return transportFactory;
}

@Override
public UserCredentials build() {
return new UserCredentials(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ private String tempFilePath(String filename) {
private class LogHandler extends Handler {
LogRecord lastRecord;

@Override
public void publish(LogRecord record) {
lastRecord = record;
}
Expand All @@ -624,8 +625,10 @@ public LogRecord getRecord() {
return lastRecord;
}

@Override
public void close() {}

@Override
public void flush() {}
}

Expand Down

0 comments on commit 2e77c5b

Please sign in to comment.