diff --git a/aliyun-java-sdk-core/src/main/java/com/aliyuncs/policy/cache/ThrottlingPool.java b/aliyun-java-sdk-core/src/main/java/com/aliyuncs/policy/cache/ThrottlingPool.java index 709f1362ae..c2537cad97 100644 --- a/aliyun-java-sdk-core/src/main/java/com/aliyuncs/policy/cache/ThrottlingPool.java +++ b/aliyun-java-sdk-core/src/main/java/com/aliyuncs/policy/cache/ThrottlingPool.java @@ -18,7 +18,7 @@ public synchronized static void put(final String key, Object data, int expire) { ThrottlingPool.remove(key); if (data != null) { if (expire >= 0) { - Future future = executor.schedule(new Runnable() { + Future future = executor.schedule(new Runnable() { @Override public void run() { synchronized (ThrottlingPool.class) { @@ -50,7 +50,7 @@ public synchronized static int getExpire(String key) { public synchronized static Object remove(String key) { Entity entity = map.remove(key); if (entity == null) return null; - Future future = entity.getFuture(); + Future future = entity.getFuture(); if (future != null) future.cancel(true); return entity.getValue(); } @@ -62,7 +62,7 @@ public synchronized static int size() { public synchronized static void clear() { for (Entity entity : map.values()) { if (entity != null) { - Future future = entity.getFuture(); + Future future = entity.getFuture(); if (future != null) future.cancel(true); } } @@ -76,9 +76,9 @@ public synchronized static Map getPool() { private static class Entity { private Object value; private int expire; - private Future future; + private Future future; - public Entity(Object value, int expire, Future future) { + public Entity(Object value, int expire, Future future) { this.value = value; this.expire = expire; this.future = future; @@ -92,7 +92,7 @@ public int getExpire() { return expire; } - public Future getFuture() { + public Future getFuture() { return future; } } diff --git a/aliyun-java-sdk-core/src/test/java/com/aliyuncs/auth/InstanceProfileCredentialsProviderTest.java b/aliyun-java-sdk-core/src/test/java/com/aliyuncs/auth/InstanceProfileCredentialsProviderTest.java index c3e4dff682..3ad02e6aa6 100644 --- a/aliyun-java-sdk-core/src/test/java/com/aliyuncs/auth/InstanceProfileCredentialsProviderTest.java +++ b/aliyun-java-sdk-core/src/test/java/com/aliyuncs/auth/InstanceProfileCredentialsProviderTest.java @@ -34,7 +34,7 @@ public void withFetcherTest() { final String roleName = "roleName"; InstanceProfileCredentialsProvider provider = new InstanceProfileCredentialsProvider(roleName); ECSMetadataServiceCredentialsFetcher fetcher = mock(ECSMetadataServiceCredentialsFetcher.class); - doAnswer(new Answer() { + doAnswer(new Answer() { @Override public Object answer(InvocationOnMock invocationOnMock) { String roleNameAgru = invocationOnMock.getArgument(0, String.class);