Merge branch '6.1.x'

This commit is contained in:
Stéphane Nicoll 2024-04-23 15:34:49 +02:00
commit a77895bd90
7 changed files with 29 additions and 29 deletions

View File

@ -166,7 +166,7 @@ public class SampleConfiguration {
@Bean
@NotNull
public SampleBean sampleBean$demo_kotlin_internal_test() {
return new SampleBean();
return new SampleBean();
}
}
----

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 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.
@ -64,9 +64,9 @@ class KotlinApplicationListenerMethodAdapterTests {
private class StaticApplicationListenerMethodAdapter(method: Method, private val targetBean: Any) :
ApplicationListenerMethodAdapter("unused", targetBean.javaClass, method) {
public override fun getTargetBean(): Any {
return targetBean
return targetBean
}
}
}
@Suppress("RedundantSuspendModifier", "UNUSED_PARAMETER")
private class SampleEvents {

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 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.
@ -124,7 +124,7 @@ class InstrumentedMethodTests {
}
@Test
void classGetConstructorShouldMatchInstrospectPublicConstructorsHint() {
void classGetConstructorShouldMatchIntrospectPublicConstructorsHint() {
hints.reflection().registerType(String.class, MemberCategory.INTROSPECT_PUBLIC_CONSTRUCTORS);
assertThatInvocationMatches(InstrumentedMethod.CLASS_GETCONSTRUCTOR, this.stringGetConstructor);
}
@ -148,7 +148,7 @@ class InstrumentedMethodTests {
}
@Test
void classGetConstructorShouldMatchInstrospectConstructorHint() {
void classGetConstructorShouldMatchIntrospectConstructorHint() {
hints.reflection().registerType(String.class,typeHint ->
typeHint.withConstructor(Collections.emptyList(), ExecutableMode.INTROSPECT));
assertThatInvocationMatches(InstrumentedMethod.CLASS_GETCONSTRUCTOR, this.stringGetConstructor);
@ -210,7 +210,7 @@ class InstrumentedMethodTests {
}
@Test
void classGetDeclaredConstructorShouldMatchInstrospectConstructorHint() {
void classGetDeclaredConstructorShouldMatchIntrospectConstructorHint() {
hints.reflection().registerType(String.class, typeHint ->
typeHint.withConstructor(TypeReference.listOf(byte[].class, byte.class), ExecutableMode.INTROSPECT));
assertThatInvocationMatches(InstrumentedMethod.CLASS_GETDECLAREDCONSTRUCTOR, this.stringGetDeclaredConstructor);
@ -354,13 +354,13 @@ class InstrumentedMethodTests {
}
@Test
void classGetMethodsShouldMatchInstrospectDeclaredMethodsHint() {
void classGetMethodsShouldMatchIntrospectDeclaredMethodsHint() {
hints.reflection().registerType(String.class, MemberCategory.INTROSPECT_DECLARED_METHODS);
assertThatInvocationMatches(InstrumentedMethod.CLASS_GETMETHODS, this.stringGetMethods);
}
@Test
void classGetMethodsShouldMatchInstrospectPublicMethodsHint() {
void classGetMethodsShouldMatchIntrospectPublicMethodsHint() {
hints.reflection().registerType(String.class, MemberCategory.INTROSPECT_PUBLIC_METHODS);
assertThatInvocationMatches(InstrumentedMethod.CLASS_GETMETHODS, this.stringGetMethods);
}
@ -396,7 +396,7 @@ class InstrumentedMethodTests {
}
@Test
void classGetMethodShouldMatchInstrospectPublicMethodsHint() {
void classGetMethodShouldMatchIntrospectPublicMethodsHint() {
hints.reflection().registerType(String.class, MemberCategory.INTROSPECT_PUBLIC_METHODS);
assertThatInvocationMatches(InstrumentedMethod.CLASS_GETMETHOD, this.stringGetToStringMethod);
}
@ -434,13 +434,13 @@ class InstrumentedMethodTests {
}
@Test
void classGetMethodShouldNotMatchInstrospectPublicMethodsHintWhenPrivate() {
void classGetMethodShouldNotMatchIntrospectPublicMethodsHintWhenPrivate() {
hints.reflection().registerType(String.class, MemberCategory.INTROSPECT_PUBLIC_METHODS);
assertThatInvocationDoesNotMatch(InstrumentedMethod.CLASS_GETMETHOD, this.stringGetScaleMethod);
}
@Test
void classGetMethodShouldMatchInstrospectDeclaredMethodsHintWhenPrivate() {
void classGetMethodShouldMatchIntrospectDeclaredMethodsHintWhenPrivate() {
hints.reflection().registerType(String.class, MemberCategory.INTROSPECT_DECLARED_METHODS);
assertThatInvocationMatches(InstrumentedMethod.CLASS_GETMETHOD, this.stringGetScaleMethod);
}

View File

@ -432,12 +432,12 @@ public class TableMetaDataContext {
private final boolean quoting;
public QuoteHandler(@Nullable String identifierQuoteString) {
QuoteHandler(@Nullable String identifierQuoteString) {
this.identifierQuoteString = identifierQuoteString;
this.quoting = StringUtils.hasText(identifierQuoteString);
}
public void appendTo(StringBuilder stringBuilder, @Nullable String item) {
void appendTo(StringBuilder stringBuilder, @Nullable String item) {
if (this.quoting) {
stringBuilder.append(this.identifierQuoteString)
.append(item).append(this.identifierQuoteString);

View File

@ -44,7 +44,7 @@ import org.springframework.util.StringUtils;
* <li>{@code **} matches zero or more <em>path segments</em> until the end of the path</li>
* <li><code>{spring}</code> matches a <em>path segment</em> and captures it as a variable named "spring"</li>
* <li><code>{spring:[a-z]+}</code> matches the regexp {@code [a-z]+} against a path segment
* and captures it a path variable named "spring"</li>
* and captures it as a path variable named "spring"</li>
* <li><code>{*spring}</code> matches zero or more <em>path segments</em> until the end of the path
* and captures it as a variable named "spring"</li>
* </ul>

View File

@ -238,7 +238,7 @@ class RestTemplateObservationTests {
@Nullable
Observation currentObservation;
public ObservationErrorHandler(TestObservationRegistry observationRegistry) {
ObservationErrorHandler(TestObservationRegistry observationRegistry) {
this.observationRegistry = observationRegistry;
}

View File

@ -38,7 +38,7 @@ class RouterFunctionDslTests {
val servletRequest = PathPatternsTestUtils.initRequest("GET", "", true)
servletRequest.addHeader("bar", "bar")
val request = DefaultServerRequest(servletRequest, emptyList())
assertThat(sampleRouter().route(request).isPresent).isTrue()
assertThat(sampleRouter().route(request)).isPresent()
}
@Test
@ -46,7 +46,7 @@ class RouterFunctionDslTests {
val servletRequest = PathPatternsTestUtils.initRequest("GET", "/content", true)
servletRequest.addHeader(ACCEPT, APPLICATION_ATOM_XML_VALUE)
val request = DefaultServerRequest(servletRequest, emptyList())
assertThat(sampleRouter().route(request).isPresent).isTrue()
assertThat(sampleRouter().route(request)).isPresent()
}
@Test
@ -54,7 +54,7 @@ class RouterFunctionDslTests {
val servletRequest = PathPatternsTestUtils.initRequest("POST", "/api/foo/", true)
servletRequest.addHeader(ACCEPT, APPLICATION_JSON_VALUE)
val request = DefaultServerRequest(servletRequest, emptyList())
assertThat(sampleRouter().route(request).isPresent).isTrue()
assertThat(sampleRouter().route(request)).isPresent()
}
@Test
@ -63,7 +63,7 @@ class RouterFunctionDslTests {
servletRequest.addHeader(ACCEPT, APPLICATION_JSON_VALUE)
servletRequest.addHeader(CONTENT_TYPE, APPLICATION_JSON_VALUE)
val request = DefaultServerRequest(servletRequest, emptyList())
assertThat(sampleRouter().route(request).isPresent).isTrue()
assertThat(sampleRouter().route(request)).isPresent()
}
@Test
@ -71,49 +71,49 @@ class RouterFunctionDslTests {
val servletRequest = PathPatternsTestUtils.initRequest("GET", "/content", true)
servletRequest.addHeader(CONTENT_TYPE, APPLICATION_OCTET_STREAM_VALUE)
val request = DefaultServerRequest(servletRequest, emptyList())
assertThat(sampleRouter().route(request).isPresent).isTrue()
assertThat(sampleRouter().route(request)).isPresent()
}
@Test
fun method() {
val servletRequest = PathPatternsTestUtils.initRequest("PATCH", "/", true)
val request = DefaultServerRequest(servletRequest, emptyList())
assertThat(sampleRouter().route(request).isPresent).isTrue()
assertThat(sampleRouter().route(request)).isPresent()
}
@Test
fun path() {
val servletRequest = PathPatternsTestUtils.initRequest("GET", "/baz", true)
val request = DefaultServerRequest(servletRequest, emptyList())
assertThat(sampleRouter().route(request).isPresent).isTrue()
assertThat(sampleRouter().route(request)).isPresent()
}
@Test
fun pathExtension() {
val servletRequest = PathPatternsTestUtils.initRequest("GET", "/test.properties", true)
val request = DefaultServerRequest(servletRequest, emptyList())
assertThat(sampleRouter().route(request).isPresent).isTrue()
assertThat(sampleRouter().route(request)).isPresent()
}
@Test
fun resource() {
val servletRequest = PathPatternsTestUtils.initRequest("GET","/response2.txt", true)
val request = DefaultServerRequest(servletRequest, emptyList())
assertThat(sampleRouter().route(request).isPresent).isTrue()
assertThat(sampleRouter().route(request)).isPresent()
}
@Test
fun resources() {
val servletRequest = PathPatternsTestUtils.initRequest("GET", "/resources/response.txt", true)
val request = DefaultServerRequest(servletRequest, emptyList())
assertThat(sampleRouter().route(request).isPresent).isTrue()
assertThat(sampleRouter().route(request)).isPresent()
}
@Test
fun resourcesLookupFunction() {
val servletRequest = PathPatternsTestUtils.initRequest("GET", "/response.txt", true)
val request = DefaultServerRequest(servletRequest, emptyList())
assertThat(sampleRouter().route(request).isPresent).isTrue()
assertThat(sampleRouter().route(request)).isPresent()
}
@Test
@ -123,7 +123,7 @@ class RouterFunctionDslTests {
servletRequest.addHeader(ACCEPT, APPLICATION_PDF_VALUE)
servletRequest.addHeader(CONTENT_TYPE, APPLICATION_PDF_VALUE)
val request = DefaultServerRequest(servletRequest, emptyList())
assertThat(sampleRouter().route(request).isPresent).isFalse()
assertThat(sampleRouter().route(request)).isNotPresent()
}
@Test