diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/TypeUtils.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/TypeUtils.java index bf9d39afb87..d5096cb33dd 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/TypeUtils.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/TypeUtils.java @@ -181,7 +181,7 @@ class TypeUtils { return getJavaDoc((RecordComponentElement) element); } String javadoc = (element != null) ? this.env.getElementUtils().getDocComment(element) : null; - javadoc = (javadoc != null) ? cleanupJavaDoc(javadoc) : null; + javadoc = (javadoc != null) ? cleanUpJavaDoc(javadoc) : null; return (javadoc == null || javadoc.isEmpty()) ? null : javadoc; } @@ -255,7 +255,7 @@ class TypeUtils { Pattern paramJavadocPattern = paramJavadocPattern(recordComponent.getSimpleName().toString()); Matcher paramJavadocMatcher = paramJavadocPattern.matcher(recordJavadoc); if (paramJavadocMatcher.find()) { - String paramJavadoc = cleanupJavaDoc(paramJavadocMatcher.group()); + String paramJavadoc = cleanUpJavaDoc(paramJavadocMatcher.group()); return paramJavadoc.isEmpty() ? null : paramJavadoc; } } @@ -267,7 +267,7 @@ class TypeUtils { return Pattern.compile(pattern, Pattern.DOTALL); } - private String cleanupJavaDoc(String javadoc) { + private String cleanUpJavaDoc(String javadoc) { StringBuilder result = new StringBuilder(javadoc.length()); char lastChar = '.'; for (int i = 0; i < javadoc.length(); i++) { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/TempTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/TempTests.java deleted file mode 100644 index 9a85331cfea..00000000000 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/TempTests.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2012-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. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.context.properties; - -/** - * @author pwebb - */ - -import org.junit.jupiter.api.Test; - -import org.springframework.boot.context.properties.bind.DefaultValue; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; -import org.springframework.context.annotation.Configuration; -import org.springframework.test.context.support.TestPropertySourceUtils; - -public class TempTests { - - private AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(); - - @Test - void testName() { - load(MyConfig.class, "foo.bar.baz=hello"); - System.out.println(this.context.getBean(Foo.class)); - } - - @Test - void testName2() { - load(MyConfig.class); - System.out.println(this.context.getBean(Foo.class)); - } - - private AnnotationConfigApplicationContext load(Class configuration, String... inlinedProperties) { - return load(new Class[] { configuration }, inlinedProperties); - } - - private AnnotationConfigApplicationContext load(Class[] configuration, String... inlinedProperties) { - this.context.register(configuration); - TestPropertySourceUtils.addInlinedPropertiesToEnvironment(this.context, inlinedProperties); - this.context.refresh(); - return this.context; - } - - @Configuration - @EnableConfigurationProperties(Foo.class) - static class MyConfig { - - } - - @ConfigurationProperties("foo") - record Foo(@DefaultValue Bar bar) { - } - - record Bar(@DefaultValue("hello") String baz) { - } - -}