From 2fa8d38aa75be200d51668fcee5f65b29f189f9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Tue, 13 May 2025 13:42:17 +0200 Subject: [PATCH] Move web-specific FailureAnalyzer to a more focused package This commit moves PortInUseFailureAnalyzer to o.s.b.web.server as its current location means the whole general failure analyzer package has to know about web servers. Closes gh-45524 --- .../analyzer => web/server}/PortInUseFailureAnalyzer.java | 5 ++--- .../spring-boot/src/main/resources/META-INF/spring.factories | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) rename spring-boot-project/spring-boot/src/main/java/org/springframework/boot/{diagnostics/analyzer => web/server}/PortInUseFailureAnalyzer.java (88%) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/PortInUseFailureAnalyzer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/PortInUseFailureAnalyzer.java similarity index 88% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/PortInUseFailureAnalyzer.java rename to spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/PortInUseFailureAnalyzer.java index 1d68e98fb16..23c87c87302 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/PortInUseFailureAnalyzer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/PortInUseFailureAnalyzer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 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. @@ -14,11 +14,10 @@ * limitations under the License. */ -package org.springframework.boot.diagnostics.analyzer; +package org.springframework.boot.web.server; import org.springframework.boot.diagnostics.AbstractFailureAnalyzer; import org.springframework.boot.diagnostics.FailureAnalysis; -import org.springframework.boot.web.server.PortInUseException; /** * A {@code FailureAnalyzer} that performs analysis of failures caused by a diff --git a/spring-boot-project/spring-boot/src/main/resources/META-INF/spring.factories b/spring-boot-project/spring-boot/src/main/resources/META-INF/spring.factories index 6f0446dc528..0852534a5ce 100644 --- a/spring-boot-project/spring-boot/src/main/resources/META-INF/spring.factories +++ b/spring-boot-project/spring-boot/src/main/resources/META-INF/spring.factories @@ -78,12 +78,12 @@ org.springframework.boot.diagnostics.analyzer.MutuallyExclusiveConfigurationProp org.springframework.boot.diagnostics.analyzer.NoSuchMethodFailureAnalyzer,\ org.springframework.boot.diagnostics.analyzer.NoUniqueBeanDefinitionFailureAnalyzer,\ org.springframework.boot.diagnostics.analyzer.PatternParseFailureAnalyzer,\ -org.springframework.boot.diagnostics.analyzer.PortInUseFailureAnalyzer,\ org.springframework.boot.diagnostics.analyzer.UnboundConfigurationPropertyFailureAnalyzer,\ org.springframework.boot.diagnostics.analyzer.ValidationExceptionFailureAnalyzer,\ org.springframework.boot.liquibase.LiquibaseChangelogMissingFailureAnalyzer,\ org.springframework.boot.web.context.MissingWebServerFactoryBeanFailureAnalyzer,\ -org.springframework.boot.web.embedded.tomcat.ConnectorStartFailureAnalyzer +org.springframework.boot.web.embedded.tomcat.ConnectorStartFailureAnalyzer,\ +org.springframework.boot.web.server.PortInUseFailureAnalyzer # Failure Analysis Reporters org.springframework.boot.diagnostics.FailureAnalysisReporter=\