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

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

@ -285,11 +285,7 @@ public class MutablePropertyValues implements PropertyValues, Serializable { @@ -285,11 +285,7 @@ public class MutablePropertyValues implements PropertyValues, Serializable {
for (PropertyValue newPv : this.propertyValueList) {
// if there wasn't an old one, add it
PropertyValue pvOld = old.getPropertyValue(newPv.getName());
if (pvOld == null) {
changes.addPropertyValue(newPv);
}
else if (!pvOld.equals(newPv)) {
// it's changed
if (pvOld == null || !pvOld.equals(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 @@ -409,12 +409,7 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp
}
private boolean addDeferredProperty(String property, Object newValue) {
if (newValue instanceof List) {
this.deferredProperties.put(this.currentBeanDefinition.getBeanName() + '.' + property,
new DeferredProperty(this.currentBeanDefinition, property, newValue));
return true;
}
else if (newValue instanceof Map) {
if (newValue instanceof List || newValue instanceof Map) {
this.deferredProperties.put(this.currentBeanDefinition.getBeanName() + '.' + property,
new DeferredProperty(this.currentBeanDefinition, property, newValue));
return true;

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

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

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

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

Loading…
Cancel
Save