diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsSenderConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsSenderConfigurationTests.java index 9acd540a73fd..a5ef79a853f1 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsSenderConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsSenderConfigurationTests.java @@ -47,7 +47,7 @@ class ZipkinConfigurationsSenderConfigurationTests { .withConfiguration(AutoConfigurations.of(DefaultEncodingConfiguration.class, SenderConfiguration.class)); @Test - void shouldSupplyDefaultHttpClientSenderBeans() { + void shouldSupplyDefaultHttpClientSenderBean() { this.contextRunner.run((context) -> { assertThat(context).hasSingleBean(BytesMessageSender.class); assertThat(context).hasSingleBean(ZipkinHttpClientSender.class); @@ -56,7 +56,7 @@ void shouldSupplyDefaultHttpClientSenderBeans() { } @Test - void shouldUseUrlSenderIfHttpSenderIsNotAvailable() { + void shouldUseUrlConnectionSenderIfHttpClientIsNotAvailable() { this.contextRunner.withUserConfiguration(UrlConnectionSenderConfiguration.class) .withClassLoader(new FilteredClassLoader(HttpClient.class)) .run((context) -> { @@ -85,16 +85,6 @@ void shouldUseCustomHttpEndpointSupplierFactory() { }); } - @Configuration(proxyBeanMethods = false) - private static final class HttpClientConfiguration { - - @Bean - ZipkinHttpClientBuilderCustomizer httpClientBuilderCustomizer() { - return mock(ZipkinHttpClientBuilderCustomizer.class); - } - - } - @Configuration(proxyBeanMethods = false) private static final class CustomConfiguration { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnSingleCandidate.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnSingleCandidate.java index 5a69f78f006a..615202f996aa 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnSingleCandidate.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnSingleCandidate.java @@ -54,8 +54,8 @@ /** * The class type of bean that should be checked. The condition matches if a bean of * the class specified is contained in the {@link BeanFactory} and a primary candidate - * exists in case of multiple instances. Beans that are not autowire candidates or - * that are not default candidates or that are fallback candidates are ignored. + * exists in case of multiple instances. Beans that are not autowire candidates, that + * are not default candidates, or that are fallback candidates are ignored. *

* This attribute may not be used in conjunction with * {@link #type()}, but it may be used instead of {@link #type()}. @@ -71,7 +71,7 @@ * The class type name of bean that should be checked. The condition matches if a bean * of the class specified is contained in the {@link BeanFactory} and a primary * candidate exists in case of multiple instances. Beans that are not autowire - * candidates or that are not default candidates or that are fallback candidates are + * candidates, that are not default candidates, or that are fallback candidates are * ignored. *

* This attribute may not be used in conjunction with diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/DefaultGraphQlSchemaCondition.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/DefaultGraphQlSchemaCondition.java index a8f23e64415d..d9a4aa84a259 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/DefaultGraphQlSchemaCondition.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/DefaultGraphQlSchemaCondition.java @@ -84,10 +84,10 @@ public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeM else { messages.add((message.didNotFind("GraphQlSourceBuilderCustomizer").atAll())); } - String[] graphqlSourceBeans = beanFactory.getBeanNamesForType(GraphQlSource.class, false, false); - if (graphqlSourceBeans.length != 0) { + String[] graphQlSourceBeanNames = beanFactory.getBeanNamesForType(GraphQlSource.class, false, false); + if (graphQlSourceBeanNames.length != 0) { match = true; - messages.add(message.found("graphqlSource").items(Arrays.asList(graphqlSourceBeans))); + messages.add(message.found("GraphQlSource").items(Arrays.asList(graphQlSourceBeanNames))); } else { messages.add((message.didNotFind("GraphQlSource").atAll())); diff --git a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/specification/pages/configuration-metadata/format.adoc b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/specification/pages/configuration-metadata/format.adoc index baf80ff5aee3..ae560f89901b 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/specification/pages/configuration-metadata/format.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/specification/pages/configuration-metadata/format.adoc @@ -2,7 +2,7 @@ = Metadata Format Configuration metadata files are located inside jars under `META-INF/spring-configuration-metadata.json`. -They use a JSON format with items categorized under either "`groups`" or "`properties`", additional values hints categorized under "hints", and ignored items under "`ignored`" as shown in the following example: +They use a JSON format with items categorized under either "`groups`" or "`properties`", additional values hints categorized under "`hints`", and ignored items under "`ignored`" as shown in the following example: [source,json] ---- @@ -93,7 +93,7 @@ Some properties might exist in their own right. The "`hints`" are additional information used to assist the user in configuring a given property. For example, when a developer is configuring the configprop:spring.jpa.hibernate.ddl-auto[] property, a tool can use the hints to offer some auto-completion help for the `none`, `validate`, `update`, `create`, and `create-drop` values. -Finally, "`ignored`" are items which have been deliberately ignored. +Finally, "`ignored`" is for items which have been deliberately ignored. The content of this section usually comes from the xref:specification:configuration-metadata/annotation-processor.adoc#appendix.configuration-metadata.annotation-processor.adding-additional-metadata[additional metadata]. @@ -313,8 +313,8 @@ The `ignored` object can contain the attributes shown in the following table: | Name | Type | Purpose | `properties` -| IgnoredProperty[] -| A list of ignored properties as defined by the IgnoredProperty object (described in the next table). Each entry defines the name of the ignored property. +| ItemIgnore[] +| A list of ignored properties as defined by the ItemIgnore object (described in the next table). Each entry defines the name of the ignored property. |=== diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ItemIgnore.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ItemIgnore.java index f29d22c132b2..ec5e7971f326 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ItemIgnore.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ItemIgnore.java @@ -33,12 +33,12 @@ public final class ItemIgnore implements Comparable { private final String name; private ItemIgnore(ItemType type, String name) { - if (name == null) { - throw new IllegalArgumentException("'name' must not be null"); - } if (type == null) { throw new IllegalArgumentException("'type' must not be null"); } + if (name == null) { + throw new IllegalArgumentException("'name' must not be null"); + } this.type = type; this.name = name; } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/JsonMarshaller.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/JsonMarshaller.java index 06344157aeb2..e6981d73b6e3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/JsonMarshaller.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/JsonMarshaller.java @@ -92,8 +92,9 @@ public ConfigurationMetadata read(InputStream inputStream) throws Exception { } JSONObject ignored = object.optJSONObject("ignored"); if (ignored != null) { - checkAllowedKeys(ignored, path.resolve("ignored"), "properties"); - addIgnoredProperties(metadata, ignored, path.resolve("ignored")); + JsonPath ignoredPath = path.resolve("ignored"); + checkAllowedKeys(ignored, ignoredPath, "properties"); + addIgnoredProperties(metadata, ignored, ignoredPath); } return metadata; } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/JsonMarshallerTests.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/JsonMarshallerTests.java index df7792cf0736..e8e0684aea3e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/JsonMarshallerTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/JsonMarshallerTests.java @@ -348,7 +348,7 @@ void shouldCheckHintProviderFields() { } @Test - void shouldCheckIgnoreFields() { + void shouldCheckIgnoredFields() { String json = """ { "ignored": { @@ -362,7 +362,7 @@ void shouldCheckIgnoreFields() { } @Test - void shouldCheckIgnorePropertiesFields() { + void shouldCheckIgnoredPropertiesFields() { String json = """ { "ignored": { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/StandardConfigDataLocationResolver.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/StandardConfigDataLocationResolver.java index 3a1561b549e5..2de64f335299 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/StandardConfigDataLocationResolver.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/StandardConfigDataLocationResolver.java @@ -182,7 +182,7 @@ private void validateProfile(String profile) { return; } throw new IllegalStateException( - String.format("Invalid profile '%s': must contain only letters or digits or '-' or '_'", profile)); + String.format("Invalid profile '%s': must contain only letters, digits, '-', or '_'", profile)); }); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/info/ProcessInfo.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/info/ProcessInfo.java index cc9888a350aa..8961643699f8 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/info/ProcessInfo.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/info/ProcessInfo.java @@ -88,7 +88,7 @@ public MemoryInfo getMemory() { * threads, the parallelism level, and the thread pool size. * @return an instance of {@link VirtualThreadsInfo} containing information about * virtual threads, or {@code null} if the VirtualThreadSchedulerMXBean is not - * available. + * available * @since 3.5.0 */ @SuppressWarnings("unchecked") diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/StandardConfigDataLocationResolverTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/StandardConfigDataLocationResolverTests.java index 17868216d7e5..eec8716dbaa0 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/StandardConfigDataLocationResolverTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/StandardConfigDataLocationResolverTests.java @@ -322,7 +322,7 @@ void resolveProfileSpecificWithAdditionalValidProfilesShouldNotThrowException() } @Test - void resolveProfileSpecificWhenProfileStartsWithSymbolThrowsException() { + void resolveProfileSpecificWhenProfileStartsWithDashThrowsException() { ConfigDataLocation location = ConfigDataLocation.of("classpath:/configdata/properties/"); this.environment.setActiveProfiles("-dev"); Profiles profiles = new Profiles(this.environment, this.environmentBinder, Collections.emptyList()); @@ -342,7 +342,7 @@ void resolveProfileSpecificWhenProfileStartsWithUnderscoreThrowsException() { } @Test - void resolveProfileSpecificWhenProfileEndsWithSymbolThrowsException() { + void resolveProfileSpecificWhenProfileEndsWithDashThrowsException() { ConfigDataLocation location = ConfigDataLocation.of("classpath:/configdata/properties/"); this.environment.setActiveProfiles("dev-"); Profiles profiles = new Profiles(this.environment, this.environmentBinder, Collections.emptyList()); @@ -368,7 +368,7 @@ void resolveProfileSpecificWhenProfileContainsInvalidCharactersThrowsException() Profiles profiles = new Profiles(this.environment, this.environmentBinder, Collections.emptyList()); assertThatIllegalStateException() .isThrownBy(() -> this.resolver.resolveProfileSpecific(this.context, location, profiles)) - .withMessageStartingWith("Invalid profile 'dev*test': must contain only letters or digits or '-' or '_'"); + .withMessageStartingWith("Invalid profile 'dev*test': must contain only letters, digits, '-', or '_'"); } private String filePath(String... components) { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/structured/StructuredLoggingJsonPropertiesTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/structured/StructuredLoggingJsonPropertiesTests.java index ceeaf63edf6f..9f242ec191fa 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/structured/StructuredLoggingJsonPropertiesTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/structured/StructuredLoggingJsonPropertiesTests.java @@ -69,7 +69,7 @@ void shouldRegisterRuntimeHints() throws Exception { } @Test - void structuredLoggingJsonPropertiesRuntimeHintsRuntimeHintsIsRegistered() { + void structuredLoggingJsonPropertiesRuntimeHintsIsRegistered() { assertThat(AotServices.factories().load(RuntimeHintsRegistrar.class)) .anyMatch(StructuredLoggingJsonPropertiesRuntimeHints.class::isInstance); }