Skip to content

Commit e7ff956

Browse files
JacksonTianyndu13
authored andcommitted
improve with rawtype
1 parent 10e858c commit e7ff956

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

aliyun-java-sdk-core/src/main/java/com/aliyuncs/policy/cache/ThrottlingPool.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public synchronized static void put(final String key, Object data, int expire) {
1818
ThrottlingPool.remove(key);
1919
if (data != null) {
2020
if (expire >= 0) {
21-
Future future = executor.schedule(new Runnable() {
21+
Future<?> future = executor.schedule(new Runnable() {
2222
@Override
2323
public void run() {
2424
synchronized (ThrottlingPool.class) {
@@ -50,7 +50,7 @@ public synchronized static int getExpire(String key) {
5050
public synchronized static Object remove(String key) {
5151
Entity entity = map.remove(key);
5252
if (entity == null) return null;
53-
Future future = entity.getFuture();
53+
Future<?> future = entity.getFuture();
5454
if (future != null) future.cancel(true);
5555
return entity.getValue();
5656
}
@@ -62,7 +62,7 @@ public synchronized static int size() {
6262
public synchronized static void clear() {
6363
for (Entity entity : map.values()) {
6464
if (entity != null) {
65-
Future future = entity.getFuture();
65+
Future<?> future = entity.getFuture();
6666
if (future != null) future.cancel(true);
6767
}
6868
}
@@ -76,9 +76,9 @@ public synchronized static Map<String, Entity> getPool() {
7676
private static class Entity {
7777
private Object value;
7878
private int expire;
79-
private Future future;
79+
private Future<?> future;
8080

81-
public Entity(Object value, int expire, Future future) {
81+
public Entity(Object value, int expire, Future<?> future) {
8282
this.value = value;
8383
this.expire = expire;
8484
this.future = future;
@@ -92,7 +92,7 @@ public int getExpire() {
9292
return expire;
9393
}
9494

95-
public Future getFuture() {
95+
public Future<?> getFuture() {
9696
return future;
9797
}
9898
}

aliyun-java-sdk-core/src/test/java/com/aliyuncs/auth/InstanceProfileCredentialsProviderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void withFetcherTest() {
3434
final String roleName = "roleName";
3535
InstanceProfileCredentialsProvider provider = new InstanceProfileCredentialsProvider(roleName);
3636
ECSMetadataServiceCredentialsFetcher fetcher = mock(ECSMetadataServiceCredentialsFetcher.class);
37-
doAnswer(new Answer() {
37+
doAnswer(new Answer<Object>() {
3838
@Override
3939
public Object answer(InvocationOnMock invocationOnMock) {
4040
String roleNameAgru = invocationOnMock.getArgument(0, String.class);

0 commit comments

Comments
 (0)