Skip to content

Commit 3ce25ef

Browse files
elharochingor13
authored andcommitted
Fix assorted warnings (#186)
* warnings * revert
1 parent ddaa80c commit 3ce25ef

File tree

5 files changed

+2
-12
lines changed

5 files changed

+2
-12
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ static long validateLong(Map<String, Object> map, String key, String errorPrefix
201201
/**
202202
* Return the specified map from JSON or throw a helpful error message.
203203
*/
204-
@SuppressWarnings("unchecked")
204+
@SuppressWarnings({ "unchecked", "rawtypes" })
205205
static Map<String, Object> validateMap(Map<String, Object> map, String key, String errorPrefix)
206206
throws IOException {
207207
Object value = map.get(key);

google-auth-library-java/oauth2_http/javatests/com/google/auth/oauth2/ClientIdTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void constructor() {
6666

6767
@Test(expected = NullPointerException.class)
6868
public void constructor_nullClientId_throws() {
69-
ClientId clientId = ClientId.newBuilder()
69+
ClientId.newBuilder()
7070
.setClientSecret(CLIENT_SECRET)
7171
.build();
7272
}

google-auth-library-java/oauth2_http/javatests/com/google/auth/oauth2/ComputeEngineCredentialsTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
import com.google.api.client.http.HttpTransport;
4444
import com.google.api.client.http.LowLevelHttpRequest;
4545
import com.google.api.client.http.LowLevelHttpResponse;
46-
import com.google.api.client.json.GenericJson;
4746
import com.google.api.client.testing.http.MockLowLevelHttpRequest;
4847
import com.google.api.client.testing.http.MockLowLevelHttpResponse;
4948
import com.google.api.client.util.Clock;
@@ -232,7 +231,6 @@ public LowLevelHttpResponse execute() throws IOException {
232231
ComputeEngineCredentials.newBuilder().setHttpTransportFactory(transportFactory).build();
233232

234233
try {
235-
byte[] bytes = {0xD, 0xE, 0xA, 0xD};
236234
credentials.getAccount();
237235
fail("Fetching default service account should have failed");
238236
} catch (RuntimeException e) {
@@ -269,7 +267,6 @@ public LowLevelHttpResponse execute() throws IOException {
269267
ComputeEngineCredentials.newBuilder().setHttpTransportFactory(transportFactory).build();
270268

271269
try {
272-
byte[] bytes = {0xD, 0xE, 0xA, 0xD};
273270
credentials.getAccount();
274271
fail("Fetching default service account should have failed");
275272
} catch (RuntimeException e) {

google-auth-library-java/oauth2_http/javatests/com/google/auth/oauth2/DefaultCredentialsProviderTest.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,6 @@ private static class TestDefaultCredentialsProvider extends DefaultCredentialsPr
586586
private final Map<String, String> properties = new HashMap<>();
587587
private final Map<String, InputStream> files = new HashMap<>();
588588
private boolean fileSandbox = false;
589-
private int forNameCallCount = 0;
590589

591590
TestDefaultCredentialsProvider () {
592591
}
@@ -620,7 +619,6 @@ void setProperty(String property, String value) {
620619

621620
@Override
622621
Class<?> forName(String className) throws ClassNotFoundException {
623-
forNameCallCount++;
624622
Class<?> lookup = types.get(className);
625623
if (lookup != null) {
626624
return lookup;
@@ -633,10 +631,6 @@ protected boolean isOnGAEStandard7() {
633631
return getProperty("isOnGAEStandard7", "false").equals("true");
634632
}
635633

636-
int getForNameCallCount() {
637-
return forNameCallCount;
638-
}
639-
640634
@Override
641635
boolean isFile(File file) {
642636
if (fileSandbox) {

google-auth-library-java/oauth2_http/javatests/com/google/auth/oauth2/MockTokenServerTransport.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
import java.io.IOException;
4646
import java.net.URI;
4747
import java.util.ArrayDeque;
48-
import java.util.Arrays;
4948
import java.util.Collections;
5049
import java.util.HashMap;
5150
import java.util.Map;

0 commit comments

Comments
 (0)