Browse Source

All branches in a conditional structure should not have exactly the same implementation

pull/1767/head
igor-suhorukov 7 years ago committed by Juergen Hoeller
parent
commit
93abe0e94b
  1. 6
      spring-aop/src/main/java/org/springframework/aop/aspectj/AbstractAspectJAdvice.java
  2. 6
      spring-beans/src/main/java/org/springframework/beans/MutablePropertyValues.java
  3. 7
      spring-beans/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionReader.java
  4. 5
      spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectivePropertyAccessor.java
  5. 5
      spring-web/src/main/java/org/springframework/web/util/UrlPathHelper.java

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

@ -385,10 +385,8 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
int numUnboundArgs = this.parameterTypes.length; int numUnboundArgs = this.parameterTypes.length;
Class<?>[] parameterTypes = this.aspectJAdviceMethod.getParameterTypes(); Class<?>[] parameterTypes = this.aspectJAdviceMethod.getParameterTypes();
if (maybeBindJoinPoint(parameterTypes[0]) || maybeBindProceedingJoinPoint(parameterTypes[0])) { if (maybeBindJoinPoint(parameterTypes[0]) || maybeBindProceedingJoinPoint(parameterTypes[0]) ||
numUnboundArgs--; maybeBindJoinPointStaticPart(parameterTypes[0])) {
}
else if (maybeBindJoinPointStaticPart(parameterTypes[0])) {
numUnboundArgs--; numUnboundArgs--;
} }

6
spring-beans/src/main/java/org/springframework/beans/MutablePropertyValues.java

@ -285,11 +285,7 @@ public class MutablePropertyValues implements PropertyValues, Serializable {
for (PropertyValue newPv : this.propertyValueList) { for (PropertyValue newPv : this.propertyValueList) {
// if there wasn't an old one, add it // if there wasn't an old one, add it
PropertyValue pvOld = old.getPropertyValue(newPv.getName()); PropertyValue pvOld = old.getPropertyValue(newPv.getName());
if (pvOld == null) { if (pvOld == null || !pvOld.equals(newPv)) {
changes.addPropertyValue(newPv);
}
else if (!pvOld.equals(newPv)) {
// it's changed
changes.addPropertyValue(newPv); changes.addPropertyValue(newPv);
} }
} }

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

@ -409,12 +409,7 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp
} }
private boolean addDeferredProperty(String property, Object newValue) { private boolean addDeferredProperty(String property, Object newValue) {
if (newValue instanceof List) { if (newValue instanceof List || newValue instanceof Map) {
this.deferredProperties.put(this.currentBeanDefinition.getBeanName() + '.' + property,
new DeferredProperty(this.currentBeanDefinition, property, newValue));
return true;
}
else if (newValue instanceof Map) {
this.deferredProperties.put(this.currentBeanDefinition.getBeanName() + '.' + property, this.deferredProperties.put(this.currentBeanDefinition.getBeanName() + '.' + property,
new DeferredProperty(this.currentBeanDefinition, property, newValue)); new DeferredProperty(this.currentBeanDefinition, property, newValue));
return true; return true;

5
spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectivePropertyAccessor.java

@ -347,10 +347,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
if (typeDescriptor == null) { if (typeDescriptor == null) {
// Attempt to populate the cache entry // Attempt to populate the cache entry
try { try {
if (canRead(context, target, name)) { if (canRead(context, target, name) || canWrite(context, target, name)) {
typeDescriptor = this.typeDescriptorCache.get(cacheKey);
}
else if (canWrite(context, target, name)) {
typeDescriptor = this.typeDescriptorCache.get(cacheKey); typeDescriptor = this.typeDescriptorCache.get(cacheKey);
} }
} }

5
spring-web/src/main/java/org/springframework/web/util/UrlPathHelper.java

@ -268,10 +268,7 @@ public class UrlPathHelper {
} }
c1 = requestUri.charAt(index1); c1 = requestUri.charAt(index1);
} }
if (c1 == c2) { if (c1 == c2 || ignoreCase && (Character.toLowerCase(c1) == Character.toLowerCase(c2))) {
continue;
}
else if (ignoreCase && (Character.toLowerCase(c1) == Character.toLowerCase(c2))) {
continue; continue;
} }
return null; return null;

Loading…
Cancel
Save