diff --git a/spring-aop/src/main/java/org/springframework/aop/support/MethodMatchers.java b/spring-aop/src/main/java/org/springframework/aop/support/MethodMatchers.java index 12ff34e66e..c0de6a2db6 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/MethodMatchers.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/MethodMatchers.java @@ -157,10 +157,7 @@ public abstract class MethodMatchers { @Override public int hashCode() { - int hashCode = 17; - hashCode = 37 * hashCode + this.mm1.hashCode(); - hashCode = 37 * hashCode + this.mm2.hashCode(); - return hashCode; + return 37 * this.mm1.hashCode() + this.mm2.hashCode(); } } @@ -192,14 +189,6 @@ public abstract class MethodMatchers { return (targetClass != null && this.cf2.matches(targetClass)); } - @Override - public int hashCode() { - int hashCode = 17; - hashCode = 37 * hashCode + this.cf1.hashCode(); - hashCode = 37 * hashCode + this.cf2.hashCode(); - return hashCode; - } - @Override public boolean equals(Object other) { if (this == other) { @@ -217,6 +206,14 @@ public abstract class MethodMatchers { } return (this.cf1.equals(otherCf1) && this.cf2.equals(otherCf2)); } + + @Override + public int hashCode() { + int hashCode = super.hashCode(); + hashCode = 37 * hashCode + this.cf1.hashCode(); + hashCode = 37 * hashCode + this.cf2.hashCode(); + return hashCode; + } } @@ -279,10 +276,7 @@ public abstract class MethodMatchers { @Override public int hashCode() { - int hashCode = 17; - hashCode = 37 * hashCode + this.mm1.hashCode(); - hashCode = 37 * hashCode + this.mm2.hashCode(); - return hashCode; + return 37 * this.mm1.hashCode() + this.mm2.hashCode(); } } diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/DependencyDescriptor.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/DependencyDescriptor.java index 2496877802..2a712f6403 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/config/DependencyDescriptor.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/DependencyDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -390,12 +390,7 @@ public class DependencyDescriptor extends InjectionPoint implements Serializable @Override public int hashCode() { - final int prime = 31; - int result = ObjectUtils.nullSafeHashCode(this.containingClass); - result = prime * result + Boolean.hashCode(this.eager); - result = prime * result + this.nestingLevel; - result = prime * result + Boolean.hashCode(this.required); - return result; + return 31 * super.hashCode() + ObjectUtils.nullSafeHashCode(this.containingClass); } diff --git a/spring-context/src/main/java/org/springframework/context/annotation/AnnotationConfigUtils.java b/spring-context/src/main/java/org/springframework/context/annotation/AnnotationConfigUtils.java index 583c9ff308..baba3f0205 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/AnnotationConfigUtils.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/AnnotationConfigUtils.java @@ -58,7 +58,7 @@ import org.springframework.util.ClassUtils; * @see org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor * @see org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor */ -public final class AnnotationConfigUtils { +public abstract class AnnotationConfigUtils { /** * The bean name of the internally managed Configuration annotation processor. @@ -126,10 +126,6 @@ public final class AnnotationConfigUtils { ClassUtils.isPresent(PERSISTENCE_ANNOTATION_PROCESSOR_CLASS_NAME, AnnotationConfigUtils.class.getClassLoader()); - private AnnotationConfigUtils() { - } - - /** * Register all relevant annotation post processors in the given registry. * @param registry the registry to operate on diff --git a/spring-expression/src/main/java/org/springframework/expression/spel/CodeFlow.java b/spring-expression/src/main/java/org/springframework/expression/spel/CodeFlow.java index 41fa2935c5..8a4abc9559 100644 --- a/spring-expression/src/main/java/org/springframework/expression/spel/CodeFlow.java +++ b/spring-expression/src/main/java/org/springframework/expression/spel/CodeFlow.java @@ -962,7 +962,7 @@ public class CodeFlow implements Opcodes { } /** - * Returns if the supplied array type has a core component reference type. + * Return if the supplied array type has a core component reference type. */ public static boolean isReferenceTypeArray(String arraytype) { int length = arraytype.length(); @@ -1061,5 +1061,4 @@ public class CodeFlow implements Opcodes { void generateCode(MethodVisitor mv, CodeFlow codeflow); } - } diff --git a/spring-jms/src/main/java/org/springframework/jms/connection/CachingConnectionFactory.java b/spring-jms/src/main/java/org/springframework/jms/connection/CachingConnectionFactory.java index e289706aac..d58a44bf84 100644 --- a/spring-jms/src/main/java/org/springframework/jms/connection/CachingConnectionFactory.java +++ b/spring-jms/src/main/java/org/springframework/jms/connection/CachingConnectionFactory.java @@ -582,12 +582,7 @@ public class CachingConnectionFactory extends SingleConnectionFactory { @Override public int hashCode() { - int prime = 31; - int result = ObjectUtils.nullSafeHashCode(this.selector); - result = prime * result + ObjectUtils.nullSafeHashCode(this.noLocal); - result = prime * result + ObjectUtils.nullSafeHashCode(this.subscription); - result = prime * result + Boolean.hashCode(this.durable); - return result; + return 31 * super.hashCode() + ObjectUtils.nullSafeHashCode(this.selector); } @Override diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/resource/ResourceUrlProvider.java b/spring-webflux/src/main/java/org/springframework/web/reactive/resource/ResourceUrlProvider.java index 5404a570b5..32fabca088 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/resource/ResourceUrlProvider.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/resource/ResourceUrlProvider.java @@ -123,6 +123,7 @@ public class ResourceUrlProvider implements ApplicationListener request.getPath().contextPath().value() + resolvedPath + query); } @@ -154,8 +155,7 @@ public class ResourceUrlProvider implements ApplicationListener resolvers = handler.getResourceResolvers(); ResourceResolverChain chain = new DefaultResourceResolverChain(resolvers); return chain.resolveUrlPath(path.value(), handler.getLocations()) - .map(resolvedPath -> mapping.value() + resolvedPath); - + .map(resolvedPath -> mapping.value() + resolvedPath); }) .orElseGet(() ->{ if (logger.isTraceEnabled()) { diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/RequestPartMethodArgumentResolver.java b/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/RequestPartMethodArgumentResolver.java index 96ecdda762..f7fbbd7813 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/RequestPartMethodArgumentResolver.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/RequestPartMethodArgumentResolver.java @@ -51,23 +51,20 @@ import org.springframework.web.server.ServerWebInputException; */ public class RequestPartMethodArgumentResolver extends AbstractMessageReaderArgumentResolver { - public RequestPartMethodArgumentResolver(List> readers, - ReactiveAdapterRegistry registry) { - + public RequestPartMethodArgumentResolver(List> readers, ReactiveAdapterRegistry registry) { super(readers, registry); } @Override public boolean supportsParameter(MethodParameter parameter) { - return parameter.hasParameterAnnotation(RequestPart.class) || - checkParameterType(parameter, Part.class::isAssignableFrom); + return (parameter.hasParameterAnnotation(RequestPart.class) || + checkParameterType(parameter, Part.class::isAssignableFrom)); } - @Override - public Mono resolveArgument(MethodParameter parameter, BindingContext bindingContext, - ServerWebExchange exchange) { + public Mono resolveArgument( + MethodParameter parameter, BindingContext bindingContext, ServerWebExchange exchange) { RequestPart requestPart = parameter.getParameterAnnotation(RequestPart.class); boolean isRequired = (requestPart == null || requestPart.required());