Polishing

This commit is contained in:
Juergen Hoeller 2021-07-09 13:26:46 +02:00
parent 4fe3ca1b82
commit 8680fdb8bc
7 changed files with 16 additions and 12 deletions

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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) { if (introductionInfo != null) {
Class<?>[] introducedInterfaces = introductionInfo.getInterfaces(); Class<?>[] introducedInterfaces = introductionInfo.getInterfaces();
if (introducedInterfaces.length == 0) { 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) { for (Class<?> ifc : introducedInterfaces) {
addInterface(ifc); addInterface(ifc);

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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}) @Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Qualifier @Qualifier
private static @interface TestQualifier { private @interface TestQualifier {
} }
} }

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 { public class QualifierAnnotationTests {
private static final String CLASSNAME = QualifierAnnotationTests.class.getName(); private static final String CLASSNAME = QualifierAnnotationTests.class.getName();
private static final String CONFIG_LOCATION = private static final String CONFIG_LOCATION =
format("classpath:%s-context.xml", convertClassNameToResourcePath(CLASSNAME)); format("classpath:%s-context.xml", convertClassNameToResourcePath(CLASSNAME));
@Test @Test

View File

@ -43,7 +43,7 @@ dependencies {
} }
// JiBX compiler is currently not compatible with JDK 9+. // 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")) { if ((JavaVersion.current() == JavaVersion.VERSION_1_8) && !project.hasProperty("testToolchain")) {
compileTestJava { compileTestJava {
def bindingXml = "${projectDir}/src/test/resources/org/springframework/oxm/jibx/binding.xml" def bindingXml = "${projectDir}/src/test/resources/org/springframework/oxm/jibx/binding.xml"

View File

@ -50,7 +50,7 @@ class JettyClientHttpResponse implements ClientHttpResponse {
private static final Pattern SAMESITE_PATTERN = Pattern.compile("(?i).*SameSite=(Strict|Lax|None).*"); 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; private static final boolean jetty10Present;
@ -64,7 +64,7 @@ class JettyClientHttpResponse implements ClientHttpResponse {
static { static {
try { try {
Class<?> httpFieldsClass = loader.loadClass("org.eclipse.jetty.http.HttpFields"); Class<?> httpFieldsClass = classLoader.loadClass("org.eclipse.jetty.http.HttpFields");
jetty10Present = httpFieldsClass.isInterface(); jetty10Present = httpFieldsClass.isInterface();
} }
catch (ClassNotFoundException ex) { catch (ClassNotFoundException ex) {
@ -144,7 +144,7 @@ class JettyClientHttpResponse implements ClientHttpResponse {
static { static {
try { try {
getHeadersMethod = Response.class.getMethod("getHeaders"); 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"); getNameMethod = type.getMethod("getName");
getValueMethod = type.getMethod("getValue"); getValueMethod = type.getMethod("getValue");
} }

View File

@ -187,7 +187,7 @@ class JettyHeadersAdapter implements MultiValueMap<String, String> {
private class EntryIterator implements Iterator<Entry<String, List<String>>> { private class EntryIterator implements Iterator<Entry<String, List<String>>> {
private Enumeration<String> names = headers.getFieldNames(); private final Enumeration<String> names = headers.getFieldNames();
@Override @Override
public boolean hasNext() { public boolean hasNext() {
@ -241,6 +241,7 @@ class JettyHeadersAdapter implements MultiValueMap<String, String> {
} }
} }
private final class HeaderNamesIterator implements Iterator<String> { private final class HeaderNamesIterator implements Iterator<String> {
private final Iterator<String> iterator; private final Iterator<String> iterator;

View File

@ -187,7 +187,7 @@ class JettyHeadersAdapter implements MultiValueMap<String, String> {
private class EntryIterator implements Iterator<Entry<String, List<String>>> { private class EntryIterator implements Iterator<Entry<String, List<String>>> {
private Enumeration<String> names = headers.getFieldNames(); private final Enumeration<String> names = headers.getFieldNames();
@Override @Override
public boolean hasNext() { public boolean hasNext() {
@ -241,6 +241,7 @@ class JettyHeadersAdapter implements MultiValueMap<String, String> {
} }
} }
private final class HeaderNamesIterator implements Iterator<String> { private final class HeaderNamesIterator implements Iterator<String> {
private final Iterator<String> iterator; private final Iterator<String> iterator;