Skip to content

Commit 41c93c5

Browse files
committed
Merge branch '3.2.x'
Closes gh-41079
2 parents 255bcc2 + ef99ce0 commit 41c93c5

File tree

4 files changed

+27
-43
lines changed

4 files changed

+27
-43
lines changed

buildSrc/src/main/java/org/springframework/boot/build/classpath/CheckClasspathForProhibitedDependencies.java

Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.boot.build.classpath;
1818

19+
import java.util.Set;
1920
import java.util.TreeSet;
2021
import java.util.stream.Collectors;
2122

@@ -35,6 +36,11 @@
3536
*/
3637
public class CheckClasspathForProhibitedDependencies extends DefaultTask {
3738

39+
private static final Set<String> PROHIBITED_GROUPS = Set.of("org.codehaus.groovy", "org.eclipse.jetty.toolchain",
40+
"commons-logging", "org.apache.geronimo.specs", "com.sun.activation");
41+
42+
private static final Set<String> PERMITTED_JAVAX_GROUPS = Set.of("javax.batch", "javax.cache", "javax.money");
43+
3844
private Configuration classpath;
3945

4046
public CheckClasspathForProhibitedDependencies() {
@@ -69,38 +75,20 @@ public void checkForProhibitedDependencies() {
6975
}
7076

7177
private boolean prohibited(ModuleVersionIdentifier id) {
72-
String group = id.getGroup();
73-
if (group.equals("javax.batch")) {
74-
return false;
75-
}
76-
if (group.equals("javax.cache")) {
77-
return false;
78-
}
79-
if (group.equals("javax.money")) {
80-
return false;
81-
}
82-
if (group.equals("org.codehaus.groovy")) {
83-
return true;
84-
}
85-
if (group.equals("org.eclipse.jetty.toolchain")) {
86-
return true;
87-
}
88-
if (group.startsWith("javax")) {
89-
return true;
90-
}
91-
if (group.equals("commons-logging")) {
92-
return true;
93-
}
94-
if (group.equals("org.slf4j") && id.getName().equals("jcl-over-slf4j")) {
95-
return true;
96-
}
97-
if (group.startsWith("org.jboss.spec")) {
98-
return true;
99-
}
100-
if (group.equals("org.apache.geronimo.specs")) {
101-
return true;
102-
}
103-
return group.equals("com.sun.activation");
78+
return PROHIBITED_GROUPS.contains(id.getGroup()) || prohibitedJavax(id) || prohibitedSlf4j(id)
79+
|| prohibitedJbossSpec(id);
80+
}
81+
82+
private boolean prohibitedSlf4j(ModuleVersionIdentifier id) {
83+
return id.getGroup().equals("org.slf4j") && id.getName().equals("jcl-over-slf4j");
84+
}
85+
86+
private boolean prohibitedJbossSpec(ModuleVersionIdentifier id) {
87+
return id.getGroup().startsWith("org.jboss.spec");
88+
}
89+
90+
private boolean prohibitedJavax(ModuleVersionIdentifier id) {
91+
return id.getGroup().startsWith("javax.") && !PERMITTED_JAVAX_GROUPS.contains(id.getGroup());
10492
}
10593

10694
}

spring-boot-project/spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathExtensionForkParameterizedTests.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 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.
@@ -37,14 +37,10 @@ class ModifiedClassPathExtensionForkParameterizedTests {
3737
@ParameterizedTest
3838
@ValueSource(strings = { "one", "two", "three" })
3939
void testIsInvokedOnceForEachArgument(String argument) {
40-
if (argument.equals("one")) {
41-
assertThat(arguments).isEmpty();
42-
}
43-
else if (argument.equals("two")) {
44-
assertThat(arguments).doesNotContain("two", "three");
45-
}
46-
else if (argument.equals("three")) {
47-
assertThat(arguments).doesNotContain("three");
40+
switch (argument) {
41+
case "one" -> assertThat(arguments).isEmpty();
42+
case "two" -> assertThat(arguments).doesNotContain("two", "three");
43+
case "three" -> assertThat(arguments).doesNotContain("three");
4844
}
4945
arguments.add(argument);
5046
}

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/LoggingSystemProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ private PropertyResolver getPropertyResolver() {
219219
if (this.environment instanceof ConfigurableEnvironment configurableEnvironment) {
220220
PropertySourcesPropertyResolver resolver = new PropertySourcesPropertyResolver(
221221
configurableEnvironment.getPropertySources());
222-
resolver.setConversionService(((ConfigurableEnvironment) this.environment).getConversionService());
222+
resolver.setConversionService(configurableEnvironment.getConversionService());
223223
resolver.setIgnoreUnresolvableNestedPlaceholders(true);
224224
return resolver;
225225
}

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/NestedJarResourceSet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ protected boolean isMultiRelease() {
128128
}
129129
}
130130
}
131-
return this.multiRelease.booleanValue();
131+
return this.multiRelease;
132132
}
133133

134134
@Override

0 commit comments

Comments
 (0)