Skip to content

Polish #44034

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 #44034

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 @@ -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);
Expand All @@ -56,7 +56,7 @@ void shouldSupplyDefaultHttpClientSenderBeans() {
}

@Test
void shouldUseUrlSenderIfHttpSenderIsNotAvailable() {
void shouldUseUrlConnectionSenderIfHttpClientIsNotAvailable() {
this.contextRunner.withUserConfiguration(UrlConnectionSenderConfiguration.class)
.withClassLoader(new FilteredClassLoader(HttpClient.class))
.run((context) -> {
Expand Down Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
* <p>
* This attribute may <strong>not</strong> be used in conjunction with
* {@link #type()}, but it may be used instead of {@link #type()}.
Expand All @@ -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.
* <p>
* This attribute may <strong>not</strong> be used in conjunction with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
----
Expand Down Expand Up @@ -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].


Expand Down Expand Up @@ -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.

|===

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ public final class ItemIgnore implements Comparable<ItemIgnore> {
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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ void shouldCheckHintProviderFields() {
}

@Test
void shouldCheckIgnoreFields() {
void shouldCheckIgnoredFields() {
String json = """
{
"ignored": {
Expand All @@ -362,7 +362,7 @@ void shouldCheckIgnoreFields() {
}

@Test
void shouldCheckIgnorePropertiesFields() {
void shouldCheckIgnoredPropertiesFields() {
String json = """
{
"ignored": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void shouldRegisterRuntimeHints() throws Exception {
}

@Test
void structuredLoggingJsonPropertiesRuntimeHintsRuntimeHintsIsRegistered() {
void structuredLoggingJsonPropertiesRuntimeHintsIsRegistered() {
assertThat(AotServices.factories().load(RuntimeHintsRegistrar.class))
.anyMatch(StructuredLoggingJsonPropertiesRuntimeHints.class::isInstance);
}
Expand Down