Skip to content

Commit 93abe0e

Browse files
igor-suhorukovjhoeller
authored andcommitted
All branches in a conditional structure should not have exactly the same implementation
1 parent ab96bb5 commit 93abe0e

File tree

5 files changed

+6
-23
lines changed

5 files changed

+6
-23
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,8 @@ public final synchronized void calculateArgumentBindings() {
385385

386386
int numUnboundArgs = this.parameterTypes.length;
387387
Class<?>[] parameterTypes = this.aspectJAdviceMethod.getParameterTypes();
388-
if (maybeBindJoinPoint(parameterTypes[0]) || maybeBindProceedingJoinPoint(parameterTypes[0])) {
389-
numUnboundArgs--;
390-
}
391-
else if (maybeBindJoinPointStaticPart(parameterTypes[0])) {
388+
if (maybeBindJoinPoint(parameterTypes[0]) || maybeBindProceedingJoinPoint(parameterTypes[0]) ||
389+
maybeBindJoinPointStaticPart(parameterTypes[0])) {
392390
numUnboundArgs--;
393391
}
394392

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,7 @@ public PropertyValues changesSince(PropertyValues old) {
285285
for (PropertyValue newPv : this.propertyValueList) {
286286
// if there wasn't an old one, add it
287287
PropertyValue pvOld = old.getPropertyValue(newPv.getName());
288-
if (pvOld == null) {
289-
changes.addPropertyValue(newPv);
290-
}
291-
else if (!pvOld.equals(newPv)) {
292-
// it's changed
288+
if (pvOld == null || !pvOld.equals(newPv)) {
293289
changes.addPropertyValue(newPv);
294290
}
295291
}

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -409,12 +409,7 @@ else if (args.length > 1 && args[args.length -1] instanceof Closure) {
409409
}
410410

411411
private boolean addDeferredProperty(String property, Object newValue) {
412-
if (newValue instanceof List) {
413-
this.deferredProperties.put(this.currentBeanDefinition.getBeanName() + '.' + property,
414-
new DeferredProperty(this.currentBeanDefinition, property, newValue));
415-
return true;
416-
}
417-
else if (newValue instanceof Map) {
412+
if (newValue instanceof List || newValue instanceof Map) {
418413
this.deferredProperties.put(this.currentBeanDefinition.getBeanName() + '.' + property,
419414
new DeferredProperty(this.currentBeanDefinition, property, newValue));
420415
return true;

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,7 @@ private TypeDescriptor getTypeDescriptor(EvaluationContext context, Object targe
347347
if (typeDescriptor == null) {
348348
// Attempt to populate the cache entry
349349
try {
350-
if (canRead(context, target, name)) {
351-
typeDescriptor = this.typeDescriptorCache.get(cacheKey);
352-
}
353-
else if (canWrite(context, target, name)) {
350+
if (canRead(context, target, name) || canWrite(context, target, name)) {
354351
typeDescriptor = this.typeDescriptorCache.get(cacheKey);
355352
}
356353
}

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,7 @@ private String getRemainingPath(String requestUri, String mapping, boolean ignor
268268
}
269269
c1 = requestUri.charAt(index1);
270270
}
271-
if (c1 == c2) {
272-
continue;
273-
}
274-
else if (ignoreCase && (Character.toLowerCase(c1) == Character.toLowerCase(c2))) {
271+
if (c1 == c2 || ignoreCase && (Character.toLowerCase(c1) == Character.toLowerCase(c2))) {
275272
continue;
276273
}
277274
return null;

0 commit comments

Comments
 (0)