Use instanceof instead of Class#isInstance where feasible

Closes gh-25446
This commit is contained in:
XenoAmess
2020-07-21 23:00:43 +08:00
committed by Sam Brannen
parent 9fe1feea9a
commit c547809e89
10 changed files with 10 additions and 10 deletions

View File

@@ -87,7 +87,7 @@ class KeyGeneratorAdapter implements KeyGenerator {
@Override
public Object generate(Object target, Method method, Object... params) {
JCacheOperation<?> operation = this.cacheOperationSource.getCacheOperation(method, target.getClass());
if (!(AbstractJCacheKeyOperation.class.isInstance(operation))) {
if (!(operation instanceof AbstractJCacheKeyOperation)) {
throw new IllegalStateException("Invalid operation, should be a key-based operation " + operation);
}
CacheKeyInvocationContext<?> invocationContext = createCacheKeyInvocationContext(target, operation, params);