Skip to content

Commit b4095c3

Browse files
committed
Class identity comparisons wherever possible
Issue: SPR-12926
1 parent 57e0c78 commit b4095c3

File tree

108 files changed

+317
-322
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+317
-322
lines changed

spring-aop/src/main/java/org/springframework/aop/aspectj/AbstractAspectJAdvice.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -381,7 +381,7 @@ else if (maybeBindJoinPointStaticPart(parameterTypes[0])) {
381381
}
382382

383383
private boolean maybeBindJoinPoint(Class<?> candidateParameterType) {
384-
if (candidateParameterType.equals(JoinPoint.class)) {
384+
if (JoinPoint.class == candidateParameterType) {
385385
this.joinPointArgumentIndex = 0;
386386
return true;
387387
}
@@ -391,7 +391,7 @@ private boolean maybeBindJoinPoint(Class<?> candidateParameterType) {
391391
}
392392

393393
private boolean maybeBindProceedingJoinPoint(Class<?> candidateParameterType) {
394-
if (candidateParameterType.equals(ProceedingJoinPoint.class)) {
394+
if (ProceedingJoinPoint.class == candidateParameterType) {
395395
if (!supportsProceedingJoinPoint()) {
396396
throw new IllegalArgumentException("ProceedingJoinPoint is only supported for around advice");
397397
}
@@ -408,7 +408,7 @@ protected boolean supportsProceedingJoinPoint() {
408408
}
409409

410410
private boolean maybeBindJoinPointStaticPart(Class<?> candidateParameterType) {
411-
if (candidateParameterType.equals(JoinPoint.StaticPart.class)) {
411+
if (JoinPoint.StaticPart.class == candidateParameterType) {
412412
this.joinPointStaticPartArgumentIndex = 0;
413413
return true;
414414
}

spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterReturningAdvice.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -93,7 +93,7 @@ private boolean matchesReturnValue(Class<?> type, Method method, Object returnVa
9393
if (returnValue != null) {
9494
return ClassUtils.isAssignableValue(type, returnValue);
9595
}
96-
else if (type.equals(Object.class) && method.getReturnType().equals(void.class)) {
96+
else if (Object.class == type && void.class == method.getReturnType()) {
9797
return true;
9898
}
9999
else{

spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectMetadata.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -72,7 +72,7 @@ public AspectMetadata(Class<?> aspectClass, String aspectName) {
7272

7373
Class<?> currClass = aspectClass;
7474
AjType<?> ajType = null;
75-
while (!currClass.equals(Object.class)) {
75+
while (currClass != Object.class) {
7676
AjType<?> ajTypeToCheck = AjTypeSystem.getAjType(currClass);
7777
if (ajTypeToCheck.isAspect()) {
7878
ajType = ajTypeToCheck;

spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/ReflectiveAspectJAdvisorFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ private Advisor getDeclareParentsAdvisor(Field introductionField) {
157157
return null;
158158
}
159159

160-
if (DeclareParents.class.equals(declareParents.defaultImpl())) {
160+
if (DeclareParents.class == declareParents.defaultImpl()) {
161161
// This is what comes back if it wasn't set. This seems bizarre...
162162
// TODO this restriction possibly should be relaxed
163163
throw new IllegalStateException("defaultImpl must be set on DeclareParents");

spring-aop/src/main/java/org/springframework/aop/framework/CglibAopProxy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ private void validateClassIfNecessary(Class<?> proxySuperClass, ClassLoader prox
255255
* methods across ClassLoaders, and writes warnings to the log for each one found.
256256
*/
257257
private void doValidateClass(Class<?> proxySuperClass, ClassLoader proxyClassLoader) {
258-
if (!Object.class.equals(proxySuperClass)) {
258+
if (Object.class != proxySuperClass) {
259259
Method[] methods = proxySuperClass.getDeclaredMethods();
260260
for (Method method : methods) {
261261
int mod = method.getModifiers();

spring-aop/src/main/java/org/springframework/aop/framework/DefaultAopProxyFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public AopProxy createAopProxy(AdvisedSupport config) throws AopConfigException
7171
*/
7272
private boolean hasNoUserSuppliedProxyInterfaces(AdvisedSupport config) {
7373
Class<?>[] interfaces = config.getProxiedInterfaces();
74-
return (interfaces.length == 0 || (interfaces.length == 1 && SpringProxy.class.equals(interfaces[0])));
74+
return (interfaces.length == 0 || (interfaces.length == 1 && SpringProxy.class == interfaces[0]));
7575
}
7676

7777
}

spring-aop/src/main/java/org/springframework/aop/framework/ProxyProcessorSupport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ protected void evaluateProxyInterfaces(Class<?> beanClass, ProxyFactory proxyFac
126126
* @return whether the given interface is just a container callback
127127
*/
128128
protected boolean isConfigurationCallbackInterface(Class<?> ifc) {
129-
return (ifc.equals(InitializingBean.class) || ifc.equals(DisposableBean.class) ||
129+
return (InitializingBean.class == ifc || DisposableBean.class == ifc ||
130130
ObjectUtils.containsElement(ifc.getInterfaces(), Aware.class));
131131
}
132132

spring-aop/src/main/java/org/springframework/aop/framework/adapter/ThrowsAdviceInterceptor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -109,7 +109,7 @@ private Method getExceptionHandler(Throwable exception) {
109109
logger.trace("Trying to find handler for exception of type [" + exceptionClass.getName() + "]");
110110
}
111111
Method handler = this.exceptionHandlerMap.get(exceptionClass);
112-
while (handler == null && !exceptionClass.equals(Throwable.class)) {
112+
while (handler == null && exceptionClass != Throwable.class) {
113113
exceptionClass = exceptionClass.getSuperclass();
114114
handler = this.exceptionHandlerMap.get(exceptionClass);
115115
}

spring-beans-groovy/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ else if (value instanceof Closure) {
619619
try {
620620
Closure callable = (Closure) value;
621621
Class<?> parameterType = callable.getParameterTypes()[0];
622-
if (parameterType.equals(Object.class)) {
622+
if (Object.class == parameterType) {
623623
this.currentBeanDefinition = new GroovyBeanDefinitionWrapper("");
624624
callable.call(this.currentBeanDefinition);
625625
}

spring-beans/src/main/java/org/springframework/beans/BeanUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -517,12 +517,12 @@ public static boolean isSimpleProperty(Class<?> clazz) {
517517
* @return whether the given type represents a "simple" value type
518518
*/
519519
public static boolean isSimpleValueType(Class<?> clazz) {
520-
return ClassUtils.isPrimitiveOrWrapper(clazz) || clazz.isEnum() ||
520+
return (ClassUtils.isPrimitiveOrWrapper(clazz) || clazz.isEnum() ||
521521
CharSequence.class.isAssignableFrom(clazz) ||
522522
Number.class.isAssignableFrom(clazz) ||
523523
Date.class.isAssignableFrom(clazz) ||
524-
clazz.equals(URI.class) || clazz.equals(URL.class) ||
525-
clazz.equals(Locale.class) || clazz.equals(Class.class);
524+
URI.class == clazz || URL.class == clazz ||
525+
Locale.class == clazz || Class.class == clazz);
526526
}
527527

528528

spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ private CachedIntrospectionResults(Class<?> beanClass) throws BeansException {
288288
// This call is slow so we do it once.
289289
PropertyDescriptor[] pds = this.beanInfo.getPropertyDescriptors();
290290
for (PropertyDescriptor pd : pds) {
291-
if (Class.class.equals(beanClass) &&
291+
if (Class.class == beanClass &&
292292
("classLoader".equals(pd.getName()) || "protectionDomain".equals(pd.getName()))) {
293293
// Ignore Class.getClassLoader() and getProtectionDomain() methods - nobody needs to bind to those
294294
continue;

spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfo.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -153,7 +153,7 @@ public static boolean isCandidateWriteMethod(Method method) {
153153
int nParams = parameterTypes.length;
154154
return (methodName.length() > 3 && methodName.startsWith("set") && Modifier.isPublic(method.getModifiers()) &&
155155
(!void.class.isAssignableFrom(method.getReturnType()) || Modifier.isStatic(method.getModifiers())) &&
156-
(nParams == 1 || (nParams == 2 && parameterTypes[0].equals(int.class))));
156+
(nParams == 1 || (nParams == 2 && int.class == parameterTypes[0])));
157157
}
158158

159159
private void handleCandidateWriteMethod(Method method) throws IntrospectionException {

spring-beans/src/main/java/org/springframework/beans/TypeConverterDelegate.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public <T> T convertIfNecessary(String propertyName, Object oldValue, Object new
201201
// Try to apply some standard type conversion rules if appropriate.
202202

203203
if (convertedValue != null) {
204-
if (Object.class.equals(requiredType)) {
204+
if (Object.class == requiredType) {
205205
return (T) convertedValue;
206206
}
207207
else if (requiredType.isArray()) {
@@ -227,7 +227,7 @@ else if (convertedValue instanceof Map) {
227227
convertedValue = Array.get(convertedValue, 0);
228228
standardConversion = true;
229229
}
230-
if (String.class.equals(requiredType) && ClassUtils.isPrimitiveOrWrapper(convertedValue.getClass())) {
230+
if (String.class == requiredType && ClassUtils.isPrimitiveOrWrapper(convertedValue.getClass())) {
231231
// We can stringify any primitive value...
232232
return (T) convertedValue.toString();
233233
}
@@ -305,7 +305,7 @@ else if (conversionService != null) {
305305
}
306306

307307
if (conversionAttemptEx != null) {
308-
if (editor == null && !standardConversion && requiredType != null && !Object.class.equals(requiredType)) {
308+
if (editor == null && !standardConversion && requiredType != null && Object.class != requiredType) {
309309
throw conversionAttemptEx;
310310
}
311311
logger.debug("Original ConversionService attempt failed - ignored since " +
@@ -318,7 +318,7 @@ else if (conversionService != null) {
318318
private Object attemptToConvertStringToEnum(Class<?> requiredType, String trimmedValue, Object currentConvertedValue) {
319319
Object convertedValue = currentConvertedValue;
320320

321-
if (Enum.class.equals(requiredType)) {
321+
if (Enum.class == requiredType) {
322322
// target type is declared as raw enum, treat the trimmed value as <enum.fqn>.FIELD_NAME
323323
int index = trimmedValue.lastIndexOf(".");
324324
if (index > - 1) {
@@ -370,7 +370,7 @@ private PropertyEditor findDefaultEditor(Class<?> requiredType) {
370370
if (requiredType != null) {
371371
// No custom editor -> check BeanWrapperImpl's default editors.
372372
editor = this.propertyEditorRegistry.getDefaultEditor(requiredType);
373-
if (editor == null && !String.class.equals(requiredType)) {
373+
if (editor == null && String.class != requiredType) {
374374
// No BeanWrapper default editor -> check standard JavaBean editor.
375375
editor = BeanUtils.findEditorByConvention(requiredType);
376376
}
@@ -436,7 +436,7 @@ private Object doConvertValue(Object oldValue, Object newValue, Class<?> require
436436
String newTextValue = (String) convertedValue;
437437
return doConvertTextValue(oldValue, newTextValue, editor);
438438
}
439-
else if (String.class.equals(requiredType)) {
439+
else if (String.class == requiredType) {
440440
returnValue = convertedValue;
441441
}
442442
}

spring-beans/src/main/java/org/springframework/beans/factory/annotation/QualifierAnnotationAutowireCandidateResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public boolean isAutowireCandidate(BeanDefinitionHolder bdHolder, DependencyDesc
146146
MethodParameter methodParam = descriptor.getMethodParameter();
147147
if (methodParam != null) {
148148
Method method = methodParam.getMethod();
149-
if (method == null || void.class.equals(method.getReturnType())) {
149+
if (method == null || void.class == method.getReturnType()) {
150150
match = checkQualifiers(bdHolder, methodParam.getMethodAnnotations());
151151
}
152152
}

spring-beans/src/main/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBean.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -314,7 +314,7 @@ protected Exception createServiceLocatorException(Constructor<Exception> excepti
314314
Class<?>[] paramTypes = exceptionConstructor.getParameterTypes();
315315
Object[] args = new Object[paramTypes.length];
316316
for (int i = 0; i < paramTypes.length; i++) {
317-
if (paramTypes[i].equals(String.class)) {
317+
if (String.class == paramTypes[i]) {
318318
args[i] = cause.getMessage();
319319
}
320320
else if (paramTypes[i].isInstance(cause)) {
@@ -409,7 +409,7 @@ private Class<?> getServiceLocatorMethodReturnType(Method method) throws NoSuchM
409409
Class<?> serviceLocatorReturnType = interfaceMethod.getReturnType();
410410

411411
// Check whether the method is a valid service locator.
412-
if (paramTypes.length > 1 || void.class.equals(serviceLocatorReturnType)) {
412+
if (paramTypes.length > 1 || void.class == serviceLocatorReturnType) {
413413
throw new UnsupportedOperationException(
414414
"May only call methods with signature '<type> xxx()' or '<type> xxx(<idtype> id)' " +
415415
"on factory interface, but tried to call: " + interfaceMethod);

spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ protected Class<?> predictBeanType(String beanName, RootBeanDefinition mbd, Clas
603603
if (bp instanceof SmartInstantiationAwareBeanPostProcessor) {
604604
SmartInstantiationAwareBeanPostProcessor ibp = (SmartInstantiationAwareBeanPostProcessor) bp;
605605
Class<?> predicted = ibp.predictBeanType(targetType, beanName);
606-
if (predicted != null && (typesToMatch.length != 1 || !FactoryBean.class.equals(typesToMatch[0]) ||
606+
if (predicted != null && (typesToMatch.length != 1 || FactoryBean.class != typesToMatch[0] ||
607607
FactoryBean.class.isAssignableFrom(predicted))) {
608608
return predicted;
609609
}
@@ -779,7 +779,7 @@ public void doWith(Method method) throws IllegalArgumentException, IllegalAccess
779779
}
780780
}
781781
});
782-
if (objectType.value != null && !Object.class.equals(objectType.value)) {
782+
if (objectType.value != null && Object.class != objectType.value) {
783783
return objectType.value;
784784
}
785785
}
@@ -1284,7 +1284,7 @@ protected void autowireByType(
12841284
PropertyDescriptor pd = bw.getPropertyDescriptor(propertyName);
12851285
// Don't try autowiring by type for type Object: never makes sense,
12861286
// even if it technically is a unsatisfied, non-simple property.
1287-
if (!Object.class.equals(pd.getPropertyType())) {
1287+
if (Object.class != pd.getPropertyType()) {
12881288
MethodParameter methodParam = BeanUtils.getWriteMethodParameter(pd);
12891289
// Do not allow eager init for type matching in case of a prioritized post-processor.
12901290
boolean eager = !PriorityOrdered.class.isAssignableFrom(bw.getWrappedClass());

spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ else if (containsSingleton(beanName) && !containsBeanDefinition(beanName)) {
516516
RootBeanDefinition mbd = getMergedLocalBeanDefinition(beanName);
517517

518518
Class<?> classToMatch = typeToMatch.getRawClass();
519-
Class<?>[] typesToMatch = (FactoryBean.class.equals(classToMatch) ?
519+
Class<?>[] typesToMatch = (FactoryBean.class == classToMatch ?
520520
new Class<?>[] {classToMatch} : new Class<?>[] {FactoryBean.class, classToMatch});
521521

522522
// Check decorated bean definition, if any: We assume it'll be easier

spring-beans/src/main/java/org/springframework/beans/factory/support/ConstructorResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ else if (factoryMethodToUse != null && typeDiffWeight == minTypeDiffWeight &&
552552
"exists and that it is " +
553553
(isStatic ? "static" : "non-static") + ".");
554554
}
555-
else if (void.class.equals(factoryMethodToUse.getReturnType())) {
555+
else if (void.class == factoryMethodToUse.getReturnType()) {
556556
throw new BeanCreationException(mbd.getResourceDescription(), beanName,
557557
"Invalid factory method '" + mbd.getFactoryMethodName() +
558558
"': needs to have a non-void return type!");

spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -949,10 +949,10 @@ public Object resolveDependency(DependencyDescriptor descriptor, String beanName
949949
if (descriptor.getDependencyType().equals(javaUtilOptionalClass)) {
950950
return new OptionalDependencyFactory().createOptionalDependency(descriptor, beanName);
951951
}
952-
else if (descriptor.getDependencyType().equals(ObjectFactory.class)) {
952+
else if (ObjectFactory.class == descriptor.getDependencyType()) {
953953
return new DependencyObjectFactory(descriptor, beanName);
954954
}
955-
else if (descriptor.getDependencyType().equals(javaxInjectProviderClass)) {
955+
else if (javaxInjectProviderClass == descriptor.getDependencyType()) {
956956
return new DependencyProviderFactory().createDependencyProvider(descriptor, beanName);
957957
}
958958
else {
@@ -1031,10 +1031,10 @@ else if (Collection.class.isAssignableFrom(type) && type.isInterface()) {
10311031
}
10321032
else if (Map.class.isAssignableFrom(type) && type.isInterface()) {
10331033
Class<?> keyType = descriptor.getMapKeyType();
1034-
if (keyType == null || !String.class.isAssignableFrom(keyType)) {
1034+
if (String.class != keyType) {
10351035
if (descriptor.isRequired()) {
10361036
throw new FatalBeanException("Key type [" + keyType + "] of map [" + type.getName() +
1037-
"] must be assignable to [java.lang.String]");
1037+
"] must be [java.lang.String]");
10381038
}
10391039
return null;
10401040
}

spring-beans/src/main/java/org/springframework/beans/factory/support/DisposableBeanAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public DisposableBeanAdapter(Object bean, String beanName, RootBeanDefinition be
130130
throw new BeanDefinitionValidationException("Method '" + destroyMethodName + "' of bean '" +
131131
beanName + "' has more than one parameter - not supported as destroy method");
132132
}
133-
else if (paramTypes.length == 1 && !paramTypes[0].equals(boolean.class)) {
133+
else if (paramTypes.length == 1 && boolean.class != paramTypes[0]) {
134134
throw new BeanDefinitionValidationException("Method '" + destroyMethodName + "' of bean '" +
135135
beanName + "' has a non-boolean parameter - not supported as destroy method");
136136
}

spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomCollectionEditor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,10 @@ protected Collection<Object> createCollection(Class<? extends Collection> collec
159159
"Could not instantiate collection class [" + collectionType.getName() + "]: " + ex.getMessage());
160160
}
161161
}
162-
else if (List.class.equals(collectionType)) {
162+
else if (List.class == collectionType) {
163163
return new ArrayList<Object>(initialCapacity);
164164
}
165-
else if (SortedSet.class.equals(collectionType)) {
165+
else if (SortedSet.class == collectionType) {
166166
return new TreeSet<Object>();
167167
}
168168
else {

spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomMapEditor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ protected Map<Object, Object> createMap(Class<? extends Map> mapType, int initia
137137
"Could not instantiate map class [" + mapType.getName() + "]: " + ex.getMessage());
138138
}
139139
}
140-
else if (SortedMap.class.equals(mapType)) {
140+
else if (SortedMap.class == mapType) {
141141
return new TreeMap<Object, Object>();
142142
}
143143
else {

spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/AnnotationJCacheOperationSource.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -160,10 +160,10 @@ protected CacheResolver getExceptionCacheResolver(CacheResolverFactory factory,
160160
protected CacheResolverFactory determineCacheResolverFactory(CacheDefaults defaults,
161161
Class<? extends CacheResolverFactory> candidate) {
162162

163-
if (!CacheResolverFactory.class.equals(candidate)) {
163+
if (CacheResolverFactory.class != candidate) {
164164
return getBean(candidate);
165165
}
166-
else if (defaults != null && !CacheResolverFactory.class.equals(defaults.cacheResolverFactory())) {
166+
else if (defaults != null && CacheResolverFactory.class != defaults.cacheResolverFactory()) {
167167
return getBean(defaults.cacheResolverFactory());
168168
}
169169
else {
@@ -172,10 +172,10 @@ else if (defaults != null && !CacheResolverFactory.class.equals(defaults.cacheRe
172172
}
173173

174174
protected KeyGenerator determineKeyGenerator(CacheDefaults defaults, Class<? extends CacheKeyGenerator> candidate) {
175-
if (!CacheKeyGenerator.class.equals(candidate)) {
175+
if (CacheKeyGenerator.class != candidate) {
176176
return new KeyGeneratorAdapter(this, getBean(candidate));
177177
}
178-
else if (defaults != null && !CacheKeyGenerator.class.equals(defaults.cacheKeyGenerator())) {
178+
else if (defaults != null && CacheKeyGenerator.class != defaults.cacheKeyGenerator()) {
179179
return new KeyGeneratorAdapter(this, getBean(defaults.cacheKeyGenerator()));
180180
}
181181
else {

0 commit comments

Comments
 (0)