Skip to content

Commit 348662b

Browse files
committed
Remove unused deduceFromApplicationContext and supporting code
Closes gh-31218
1 parent 0b6c147 commit 348662b

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/WebApplicationType.java

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -54,10 +54,6 @@ public enum WebApplicationType {
5454

5555
private static final String JERSEY_INDICATOR_CLASS = "org.glassfish.jersey.servlet.ServletContainer";
5656

57-
private static final String SERVLET_APPLICATION_CONTEXT_CLASS = "org.springframework.web.context.WebApplicationContext";
58-
59-
private static final String REACTIVE_APPLICATION_CONTEXT_CLASS = "org.springframework.boot.web.reactive.context.ReactiveWebApplicationContext";
60-
6157
static WebApplicationType deduceFromClasspath() {
6258
if (ClassUtils.isPresent(WEBFLUX_INDICATOR_CLASS, null) && !ClassUtils.isPresent(WEBMVC_INDICATOR_CLASS, null)
6359
&& !ClassUtils.isPresent(JERSEY_INDICATOR_CLASS, null)) {
@@ -71,23 +67,4 @@ static WebApplicationType deduceFromClasspath() {
7167
return WebApplicationType.SERVLET;
7268
}
7369

74-
static WebApplicationType deduceFromApplicationContext(Class<?> applicationContextClass) {
75-
if (isAssignable(SERVLET_APPLICATION_CONTEXT_CLASS, applicationContextClass)) {
76-
return WebApplicationType.SERVLET;
77-
}
78-
if (isAssignable(REACTIVE_APPLICATION_CONTEXT_CLASS, applicationContextClass)) {
79-
return WebApplicationType.REACTIVE;
80-
}
81-
return WebApplicationType.NONE;
82-
}
83-
84-
private static boolean isAssignable(String target, Class<?> type) {
85-
try {
86-
return ClassUtils.resolveClassName(target, null).isAssignableFrom(type);
87-
}
88-
catch (Throwable ex) {
89-
return false;
90-
}
91-
}
92-
9370
}

0 commit comments

Comments
 (0)