Polishing
This commit is contained in:
@@ -19,6 +19,7 @@ package org.springframework.cache.jcache.interceptor;
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
@@ -32,8 +33,6 @@ import org.springframework.cache.interceptor.CacheResolver;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ExceptionTypeFilter;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
/**
|
||||
* A base {@link JCacheOperation} implementation.
|
||||
*
|
||||
@@ -56,8 +55,8 @@ abstract class AbstractJCacheOperation<A extends Annotation> implements JCacheOp
|
||||
* @param cacheResolver the cache resolver to resolve regular caches
|
||||
*/
|
||||
protected AbstractJCacheOperation(CacheMethodDetails<A> methodDetails, CacheResolver cacheResolver) {
|
||||
Assert.notNull(methodDetails, "method details must not be null.");
|
||||
Assert.notNull(cacheResolver, "cache resolver must not be null.");
|
||||
Assert.notNull(methodDetails, "CacheMethodDetails must not be null");
|
||||
Assert.notNull(cacheResolver, "CacheResolver must not be null");
|
||||
this.methodDetails = methodDetails;
|
||||
this.cacheResolver = cacheResolver;
|
||||
this.allParameterDetails = initializeAllParameterDetails(methodDetails.getMethod());
|
||||
@@ -117,7 +116,7 @@ abstract class AbstractJCacheOperation<A extends Annotation> implements JCacheOp
|
||||
protected ExceptionTypeFilter createExceptionTypeFilter(
|
||||
Class<? extends Throwable>[] includes, Class<? extends Throwable>[] excludes) {
|
||||
|
||||
return new ExceptionTypeFilter(asList(includes), asList(excludes), true);
|
||||
return new ExceptionTypeFilter(Arrays.asList(includes), Arrays.asList(excludes), true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,13 +18,12 @@ package org.springframework.cache.jcache.interceptor;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import javax.cache.annotation.CacheMethodDetails;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
/**
|
||||
* The default {@link CacheMethodDetails} implementation.
|
||||
*
|
||||
@@ -46,7 +45,7 @@ class DefaultCacheMethodDetails<A extends Annotation> implements CacheMethodDeta
|
||||
public DefaultCacheMethodDetails(Method method, A cacheAnnotation, String cacheName) {
|
||||
this.method = method;
|
||||
this.annotations = Collections.unmodifiableSet(
|
||||
new LinkedHashSet<>(asList(method.getAnnotations())));
|
||||
new LinkedHashSet<>(Arrays.asList(method.getAnnotations())));
|
||||
this.cacheAnnotation = cacheAnnotation;
|
||||
this.cacheName = cacheName;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -151,7 +151,7 @@ public class TimerManagerTaskScheduler extends TimerManagerAccessor implements T
|
||||
return 0;
|
||||
}
|
||||
long diff = getDelay(TimeUnit.MILLISECONDS) - other.getDelay(TimeUnit.MILLISECONDS);
|
||||
return (diff == 0 ? 0 : ((diff < 0)? -1 : 1));
|
||||
return (diff == 0 ? 0 : ((diff < 0) ? -1 : 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -759,7 +759,7 @@ public class SchedulerFactoryBean extends SchedulerAccessor implements FactoryBe
|
||||
|
||||
@Override
|
||||
public Class<? extends Scheduler> getObjectType() {
|
||||
return (this.scheduler != null) ? this.scheduler.getClass() : Scheduler.class;
|
||||
return (this.scheduler != null ? this.scheduler.getClass() : Scheduler.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user