diff --git a/spring-aop/src/main/java/org/springframework/aop/support/DefaultIntroductionAdvisor.java b/spring-aop/src/main/java/org/springframework/aop/support/DefaultIntroductionAdvisor.java index d76cdd72537..ff2370a3223 100644 --- a/spring-aop/src/main/java/org/springframework/aop/support/DefaultIntroductionAdvisor.java +++ b/spring-aop/src/main/java/org/springframework/aop/support/DefaultIntroductionAdvisor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2021 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. @@ -71,7 +71,8 @@ public class DefaultIntroductionAdvisor implements IntroductionAdvisor, ClassFil if (introductionInfo != null) { Class[] introducedInterfaces = introductionInfo.getInterfaces(); if (introducedInterfaces.length == 0) { - throw new IllegalArgumentException("IntroductionAdviceSupport implements no interfaces"); + throw new IllegalArgumentException( + "IntroductionInfo defines no interfaces to introduce: " + introductionInfo); } for (Class ifc : introducedInterfaces) { addInterface(ifc); diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/support/QualifierAnnotationAutowireBeanFactoryTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/support/QualifierAnnotationAutowireBeanFactoryTests.java index 17fd92dd5ff..f660a8af020 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/support/QualifierAnnotationAutowireBeanFactoryTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/support/QualifierAnnotationAutowireBeanFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2021 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. @@ -244,7 +244,7 @@ public class QualifierAnnotationAutowireBeanFactoryTests { @Target({ElementType.FIELD, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) @Qualifier - private static @interface TestQualifier { + private @interface TestQualifier { } } diff --git a/spring-context/src/test/java/org/springframework/beans/factory/xml/QualifierAnnotationTests.java b/spring-context/src/test/java/org/springframework/beans/factory/xml/QualifierAnnotationTests.java index 6003d25f9ad..49236e0422a 100644 --- a/spring-context/src/test/java/org/springframework/beans/factory/xml/QualifierAnnotationTests.java +++ b/spring-context/src/test/java/org/springframework/beans/factory/xml/QualifierAnnotationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2021 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. @@ -47,8 +47,9 @@ import static org.springframework.util.ClassUtils.convertClassNameToResourcePath public class QualifierAnnotationTests { private static final String CLASSNAME = QualifierAnnotationTests.class.getName(); + private static final String CONFIG_LOCATION = - format("classpath:%s-context.xml", convertClassNameToResourcePath(CLASSNAME)); + format("classpath:%s-context.xml", convertClassNameToResourcePath(CLASSNAME)); @Test diff --git a/spring-oxm/spring-oxm.gradle b/spring-oxm/spring-oxm.gradle index ff0c8abbc88..901c4ba072b 100644 --- a/spring-oxm/spring-oxm.gradle +++ b/spring-oxm/spring-oxm.gradle @@ -43,7 +43,7 @@ dependencies { } // JiBX compiler is currently not compatible with JDK 9+. -// If customJavaHome has been set, we assume the custom JDK version is 9+. +// If testToolchain has been set, we assume the custom JDK version is 9+. if ((JavaVersion.current() == JavaVersion.VERSION_1_8) && !project.hasProperty("testToolchain")) { compileTestJava { def bindingXml = "${projectDir}/src/test/resources/org/springframework/oxm/jibx/binding.xml" diff --git a/spring-web/src/main/java/org/springframework/http/client/reactive/JettyClientHttpResponse.java b/spring-web/src/main/java/org/springframework/http/client/reactive/JettyClientHttpResponse.java index a41d18984f7..5d88c83ddf6 100644 --- a/spring-web/src/main/java/org/springframework/http/client/reactive/JettyClientHttpResponse.java +++ b/spring-web/src/main/java/org/springframework/http/client/reactive/JettyClientHttpResponse.java @@ -50,7 +50,7 @@ class JettyClientHttpResponse implements ClientHttpResponse { private static final Pattern SAMESITE_PATTERN = Pattern.compile("(?i).*SameSite=(Strict|Lax|None).*"); - private static final ClassLoader loader = JettyClientHttpResponse.class.getClassLoader(); + private static final ClassLoader classLoader = JettyClientHttpResponse.class.getClassLoader(); private static final boolean jetty10Present; @@ -64,7 +64,7 @@ class JettyClientHttpResponse implements ClientHttpResponse { static { try { - Class httpFieldsClass = loader.loadClass("org.eclipse.jetty.http.HttpFields"); + Class httpFieldsClass = classLoader.loadClass("org.eclipse.jetty.http.HttpFields"); jetty10Present = httpFieldsClass.isInterface(); } catch (ClassNotFoundException ex) { @@ -144,7 +144,7 @@ class JettyClientHttpResponse implements ClientHttpResponse { static { try { getHeadersMethod = Response.class.getMethod("getHeaders"); - Class type = loader.loadClass("org.eclipse.jetty.http.HttpField"); + Class type = classLoader.loadClass("org.eclipse.jetty.http.HttpField"); getNameMethod = type.getMethod("getName"); getValueMethod = type.getMethod("getValue"); } diff --git a/spring-web/src/main/java/org/springframework/http/client/reactive/JettyHeadersAdapter.java b/spring-web/src/main/java/org/springframework/http/client/reactive/JettyHeadersAdapter.java index ae3c428be28..f44362c9c3a 100644 --- a/spring-web/src/main/java/org/springframework/http/client/reactive/JettyHeadersAdapter.java +++ b/spring-web/src/main/java/org/springframework/http/client/reactive/JettyHeadersAdapter.java @@ -187,7 +187,7 @@ class JettyHeadersAdapter implements MultiValueMap { private class EntryIterator implements Iterator>> { - private Enumeration names = headers.getFieldNames(); + private final Enumeration names = headers.getFieldNames(); @Override public boolean hasNext() { @@ -241,6 +241,7 @@ class JettyHeadersAdapter implements MultiValueMap { } } + private final class HeaderNamesIterator implements Iterator { private final Iterator iterator; diff --git a/spring-web/src/main/java/org/springframework/http/server/reactive/JettyHeadersAdapter.java b/spring-web/src/main/java/org/springframework/http/server/reactive/JettyHeadersAdapter.java index 390fb5b6ee4..35766287286 100644 --- a/spring-web/src/main/java/org/springframework/http/server/reactive/JettyHeadersAdapter.java +++ b/spring-web/src/main/java/org/springframework/http/server/reactive/JettyHeadersAdapter.java @@ -187,7 +187,7 @@ class JettyHeadersAdapter implements MultiValueMap { private class EntryIterator implements Iterator>> { - private Enumeration names = headers.getFieldNames(); + private final Enumeration names = headers.getFieldNames(); @Override public boolean hasNext() { @@ -241,6 +241,7 @@ class JettyHeadersAdapter implements MultiValueMap { } } + private final class HeaderNamesIterator implements Iterator { private final Iterator iterator;