Skip to content

Commit a78a3a5

Browse files
author
Noam Lewis
committed
fix: remove -Xlint:unchecked, suppress all existing violations
1 parent 7e6e937 commit a78a3a5

File tree

9 files changed

+11
-2
lines changed

9 files changed

+11
-2
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ public static ExternalAccountCredentials fromStream(
396396
* @param transportFactory HTTP transport factory, creates the transport used to get access tokens
397397
* @return the credentials defined by the JSON
398398
*/
399+
@SuppressWarnings("unchecked")
399400
static ExternalAccountCredentials fromJson(
400401
Map<String, Object> json, HttpTransportFactory transportFactory) {
401402
checkNotNull(json);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public class IdentityPoolCredentialSource extends ExternalAccountCredentials.Cre
6565
*
6666
* <p>Optional headers can be present, and should be keyed by `headers`.
6767
*/
68+
@SuppressWarnings("unchecked")
6869
public IdentityPoolCredentialSource(Map<String, Object> credentialSourceMap) {
6970
super(credentialSourceMap);
7071

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ public byte[] sign(byte[] toSign) {
362362
* @return the credentials defined by the JSON
363363
* @throws IOException if the credential cannot be created from the JSON.
364364
*/
365+
@SuppressWarnings("unchecked")
365366
static ImpersonatedCredentials fromJson(
366367
Map<String, Object> json, HttpTransportFactory transportFactory) throws IOException {
367368

@@ -419,7 +420,7 @@ public boolean createScopedRequired() {
419420
@Override
420421
public GoogleCredentials createScoped(Collection<String> scopes) {
421422
return toBuilder()
422-
.setScopes(new ArrayList(scopes))
423+
.setScopes(new ArrayList<>(scopes))
423424
.setLifetime(this.lifetime)
424425
.setDelegates(this.delegates)
425426
.setHttpTransportFactory(this.transportFactory)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ static String validateOptionalString(Map<String, Object> map, String key, String
170170
}
171171

172172
/** Return the specified list of strings from JSON or throw a helpful error message. */
173+
@SuppressWarnings("unchecked")
173174
static List<String> validateOptionalListString(
174175
Map<String, Object> map, String key, String errorPrefix) throws IOException {
175176
Object value = map.get(key);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public class PluggableAuthCredentialSource extends ExternalAccountCredentials.Cr
8080
// location.
8181
@Nullable final String outputFilePath;
8282

83+
@SuppressWarnings("unchecked")
8384
public PluggableAuthCredentialSource(Map<String, Object> credentialSourceMap) {
8485
super(credentialSourceMap);
8586

oauth2_http/javatests/com/google/auth/oauth2/AwsCredentialsTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ public void refreshAccessToken_withServiceAccountImpersonationOptions() throws I
210210
}
211211

212212
@Test
213+
@SuppressWarnings("unchecked")
213214
public void retrieveSubjectToken() throws IOException {
214215
MockExternalAccountCredentialsTransportFactory transportFactory =
215216
new MockExternalAccountCredentialsTransportFactory();
@@ -254,6 +255,7 @@ public void retrieveSubjectToken() throws IOException {
254255
}
255256

256257
@Test
258+
@SuppressWarnings("unchecked")
257259
public void retrieveSubjectTokenWithSessionTokenUrl() throws IOException {
258260
MockExternalAccountCredentialsTransportFactory transportFactory =
259261
new MockExternalAccountCredentialsTransportFactory();

oauth2_http/javatests/com/google/auth/oauth2/ExternalAccountCredentialsTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ public void fromJson_pluggableAuthCredentialsWorkforce() {
346346
}
347347

348348
@Test
349+
@SuppressWarnings("unchecked")
349350
public void fromJson_pluggableAuthCredentials_allExecutableOptionsSet() {
350351
GenericJson json = buildJsonPluggableAuthCredential();
351352
Map<String, Object> credentialSourceMap = (Map<String, Object>) json.get("credential_source");
@@ -400,6 +401,7 @@ public void fromJson_pluggableAuthCredentialsWithServiceAccountImpersonationOpti
400401
}
401402

402403
@Test
404+
@SuppressWarnings("unchecked")
403405
public void fromJson_pluggableAuthCredentials_withUniverseDomain() {
404406
GenericJson json = buildJsonPluggableAuthCredential();
405407
json.set("universe_domain", "universeDomain");

oauth2_http/javatests/com/google/auth/oauth2/MockExternalAccountCredentialsTransport.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ public void addScopeSequence(List<String>... scopes) {
112112
}
113113

114114
@Override
115+
@SuppressWarnings("unchecked")
115116
public LowLevelHttpRequest buildRequest(final String method, final String url) {
116117
MockLowLevelHttpRequest request =
117118
new MockLowLevelHttpRequest(url) {

pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@
232232
<source>1.8</source>
233233
<target>1.8</target>
234234
<encoding>UTF-8</encoding>
235-
<compilerArgument>-Xlint:unchecked</compilerArgument>
236235
</configuration>
237236
</plugin>
238237
<plugin>

0 commit comments

Comments
 (0)