Skip to content

Polish #32696

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Polish #32696

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public class SampleConfiguration {
@Bean
@NotNull
public SampleBean sampleBean$demo_kotlin_internal_test() {
return new SampleBean();
return new SampleBean();
}
}
----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public void setup() throws Exception {
}

@Test
void classGetConstructorShouldMatchInstrospectPublicConstructorsHint() {
void classGetConstructorShouldMatchIntrospectPublicConstructorsHint() {
hints.reflection().registerType(String.class, MemberCategory.INTROSPECT_PUBLIC_CONSTRUCTORS);
assertThatInvocationMatches(InstrumentedMethod.CLASS_GETCONSTRUCTOR, this.stringGetConstructor);
}
Expand All @@ -148,7 +148,7 @@ void classGetConstructorShouldMatchInvokeDeclaredConstructorsHint() {
}

@Test
void classGetConstructorShouldMatchInstrospectConstructorHint() {
void classGetConstructorShouldMatchIntrospectConstructorHint() {
hints.reflection().registerType(String.class,typeHint ->
typeHint.withConstructor(Collections.emptyList(), ExecutableMode.INTROSPECT));
assertThatInvocationMatches(InstrumentedMethod.CLASS_GETCONSTRUCTOR, this.stringGetConstructor);
Expand Down Expand Up @@ -210,7 +210,7 @@ void classGetDeclaredConstructorShouldNotMatchIntrospectPublicConstructorsHint()
}

@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);
Expand Down Expand Up @@ -354,13 +354,13 @@ void classGetDeclaredMethodsShouldNotMatchMethodReflectionHint() throws Exceptio
}

@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);
}
Expand Down Expand Up @@ -396,7 +396,7 @@ void classGetMethodsShouldNotMatchMethodReflectionHint() throws Exception {
}

@Test
void classGetMethodShouldMatchInstrospectPublicMethodsHint() {
void classGetMethodShouldMatchIntrospectPublicMethodsHint() {
hints.reflection().registerType(String.class, MemberCategory.INTROSPECT_PUBLIC_METHODS);
assertThatInvocationMatches(InstrumentedMethod.CLASS_GETMETHOD, this.stringGetToStringMethod);
}
Expand Down Expand Up @@ -434,13 +434,13 @@ void classGetMethodShouldMatchInvokeMethodHint() {
}

@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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,12 +432,12 @@ private static final class QuoteHandler {

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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* <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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ static class ObservationErrorHandler implements ResponseErrorHandler {
@Nullable
Observation currentObservation;

public ObservationErrorHandler(TestObservationRegistry observationRegistry) {
ObservationErrorHandler(TestObservationRegistry observationRegistry) {
this.observationRegistry = observationRegistry;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,23 @@ 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
fun accept() {
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
fun acceptAndPOST() {
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
Expand All @@ -63,57 +63,57 @@ 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
fun contentType() {
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
Expand All @@ -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
Expand Down