Merge branch '3.1.x' into 3.2.x

This commit is contained in:
Moritz Halbritter 2024-02-12 10:15:50 +01:00
commit 4387b79831
51 changed files with 69 additions and 8 deletions

View File

@ -81,6 +81,7 @@ public abstract class ManagementWebServerFactoryCustomizer<T extends Configurabl
customizers.add(BeanFactoryUtils.beanOfTypeIncludingAncestors(this.beanFactory, customizerClass)); customizers.add(BeanFactoryUtils.beanOfTypeIncludingAncestors(this.beanFactory, customizerClass));
} }
catch (NoSuchBeanDefinitionException ex) { catch (NoSuchBeanDefinitionException ex) {
// Ignore
} }
} }
invokeCustomizers(factory, customizers); invokeCustomizers(factory, customizers);

View File

@ -110,6 +110,7 @@ public class CachingOperationInvoker implements OperationInvoker {
this.cachedResponses.entrySet().removeIf((entry) -> entry.getValue().isStale(accessTime, this.timeToLive)); this.cachedResponses.entrySet().removeIf((entry) -> entry.getValue().isStale(accessTime, this.timeToLive));
} }
catch (Exception ex) { catch (Exception ex) {
// Ignore
} }
} }

View File

@ -79,6 +79,7 @@ class HealthEndpointTests extends
Thread.sleep(100); Thread.sleep(100);
} }
catch (InterruptedException ex) { catch (InterruptedException ex) {
// Ignore
} }
return this.up; return this.up;
}; };

View File

@ -124,6 +124,7 @@ class SharedMetadataReaderFactoryContextInitializer implements
registry.getBeanDefinition(AnnotationConfigUtils.CONFIGURATION_ANNOTATION_PROCESSOR_BEAN_NAME)); registry.getBeanDefinition(AnnotationConfigUtils.CONFIGURATION_ANNOTATION_PROCESSOR_BEAN_NAME));
} }
catch (NoSuchBeanDefinitionException ex) { catch (NoSuchBeanDefinitionException ex) {
// Ignore
} }
} }

View File

@ -56,6 +56,7 @@ class CacheCondition extends SpringBootCondition {
} }
} }
catch (BindException ex) { catch (BindException ex) {
// Ignore
} }
return ConditionOutcome.noMatch(message.because("unknown cache type")); return ConditionOutcome.noMatch(message.because("unknown cache type"));
} }

View File

@ -500,6 +500,7 @@ class OnBeanCondition extends FilteringSpringBootCondition implements Configurat
resolved.add(resolve(className, this.classLoader)); resolved.add(resolve(className, this.classLoader));
} }
catch (ClassNotFoundException | NoClassDefFoundError ex) { catch (ClassNotFoundException | NoClassDefFoundError ex) {
// Ignore
} }
} }
return resolved; return resolved;

View File

@ -164,6 +164,7 @@ public class UndertowWebServerFactoryCustomizer
lookup.put(getCanonicalName(field.getName()), option); lookup.put(getCanonicalName(field.getName()), option);
} }
catch (IllegalAccessException ex) { catch (IllegalAccessException ex) {
// Ignore
} }
} }
}); });

View File

@ -495,6 +495,7 @@ public class WebMvcAutoConfiguration {
} }
} }
catch (Exception ex) { catch (Exception ex) {
// Ignore
} }
return null; return null;
} }

View File

@ -126,6 +126,7 @@ public class DefaultErrorViewResolver implements ErrorViewResolver, Ordered {
} }
} }
catch (Exception ex) { catch (Exception ex) {
// Ignore
} }
} }
return null; return null;

View File

@ -578,6 +578,7 @@ class BatchAutoConfigurationTests {
jobRegistry.register(getJobFactory()); jobRegistry.register(getJobFactory());
} }
catch (DuplicateJobException ex) { catch (DuplicateJobException ex) {
// Ignore
} }
} }
return bean; return bean;

View File

@ -106,6 +106,7 @@ class SessionAutoConfigurationTests extends AbstractSessionAutoConfigurationTest
delegatingFilterProxy.doFilter(null, null, null); delegatingFilterProxy.doFilter(null, null, null);
} }
catch (Exception ex) { catch (Exception ex) {
// Ignore
} }
assertThat(delegatingFilterProxy).extracting("delegate") assertThat(delegatingFilterProxy).extracting("delegate")
.isSameAs(context.getBean(SessionRepositoryFilter.class)); .isSameAs(context.getBean(SessionRepositoryFilter.class));

View File

@ -72,6 +72,7 @@ class TcpConnectServiceReadinessCheck {
} }
} }
catch (SocketTimeoutException ex) { catch (SocketTimeoutException ex) {
// Ignore
} }
} }

View File

@ -43,6 +43,7 @@ public final class JsonTypeExcludeFilter extends StandardAnnotationCustomizableT
includes.add(ClassUtils.forName(JACKSON_MODULE, null)); includes.add(ClassUtils.forName(JACKSON_MODULE, null));
} }
catch (Exception ex) { catch (Exception ex) {
// Ignore
} }
includes.add(JsonComponent.class); includes.add(JsonComponent.class);
DEFAULT_INCLUDES = Collections.unmodifiableSet(includes); DEFAULT_INCLUDES = Collections.unmodifiableSet(includes);

View File

@ -204,6 +204,7 @@ class ImportsContextCustomizer implements ContextCustomizer {
registry.removeBeanDefinition(ImportsConfiguration.BEAN_NAME); registry.removeBeanDefinition(ImportsConfiguration.BEAN_NAME);
} }
catch (NoSuchBeanDefinitionException ex) { catch (NoSuchBeanDefinitionException ex) {
// Ignore
} }
} }

View File

@ -167,6 +167,7 @@ public class SpringBootContextLoader extends AbstractContextLoader implements Ao
mainMethod = ReflectionUtils.findMethod(kotlinClass, "main", String[].class); mainMethod = ReflectionUtils.findMethod(kotlinClass, "main", String[].class);
} }
catch (ClassNotFoundException ex) { catch (ClassNotFoundException ex) {
// Ignore
} }
} }
Assert.state(mainMethod != null || useMainMethod == UseMainMethod.WHEN_AVAILABLE, Assert.state(mainMethod != null || useMainMethod == UseMainMethod.WHEN_AVAILABLE,
@ -555,6 +556,7 @@ public class SpringBootContextLoader extends AbstractContextLoader implements Ao
} }
} }
catch (AbandonedRunException ex) { catch (AbandonedRunException ex) {
// Ignore
} }
catch (Exception ex) { catch (Exception ex) {
if (this.failedContexts.size() == 1) { if (this.failedContexts.size() == 1) {

View File

@ -203,6 +203,7 @@ public class ApplicationContextAssert<C extends ApplicationContext>
getApplicationContext(), name, bean)); getApplicationContext(), name, bean));
} }
catch (NoSuchBeanDefinitionException ex) { catch (NoSuchBeanDefinitionException ex) {
// Ignore
} }
return this; return this;
} }

View File

@ -316,6 +316,7 @@ public abstract class AbstractJsonMarshalTester<T> {
closeable.close(); closeable.close();
} }
catch (IOException ex) { catch (IOException ex) {
// Ignore
} }
} }

View File

@ -1095,6 +1095,7 @@ public class JsonContentAssert extends AbstractAssert<JsonContentAssert, CharSeq
failWithMessage("Expecting no JSON path \"%s\"", this.expression); failWithMessage("Expecting no JSON path \"%s\"", this.expression);
} }
catch (PathNotFoundException ex) { catch (PathNotFoundException ex) {
// Ignore
} }
} }

View File

@ -50,6 +50,7 @@ class TestcontainersLifecycleBeanFactoryPostProcessor implements BeanFactoryPost
} }
} }
catch (NoSuchBeanDefinitionException ex) { catch (NoSuchBeanDefinitionException ex) {
// Ignore
} }
} }
} }

View File

@ -93,6 +93,7 @@ public abstract class ContainerConnectionDetailsFactory<C extends Container<?>,
} }
} }
catch (NoClassDefFoundError ex) { catch (NoClassDefFoundError ex) {
// Ignore
} }
return null; return null;
} }

View File

@ -203,6 +203,7 @@ final class PrivateKeyParser {
return keyFactory.generatePrivate(keySpec); return keyFactory.generatePrivate(keySpec);
} }
catch (InvalidKeySpecException | NoSuchAlgorithmException ex) { catch (InvalidKeySpecException | NoSuchAlgorithmException ex) {
// Ignore
} }
} }
return null; return null;

View File

@ -78,6 +78,7 @@ class TotalProgressListenerTests extends AbstractJsonTests {
Thread.sleep(10); Thread.sleep(10);
} }
catch (InterruptedException ex) { catch (InterruptedException ex) {
// Ignore
} }
} }

View File

@ -51,7 +51,8 @@ class JSON {
try { try {
return Double.valueOf((String) value); return Double.valueOf((String) value);
} }
catch (NumberFormatException ignored) { catch (NumberFormatException ex) {
// Ignore
} }
} }
return null; return null;
@ -68,7 +69,8 @@ class JSON {
try { try {
return (int) Double.parseDouble((String) value); return (int) Double.parseDouble((String) value);
} }
catch (NumberFormatException ignored) { catch (NumberFormatException ex) {
// Ignore
} }
} }
return null; return null;
@ -85,7 +87,8 @@ class JSON {
try { try {
return (long) Double.parseDouble((String) value); return (long) Double.parseDouble((String) value);
} }
catch (NumberFormatException ignored) { catch (NumberFormatException ex) {
// Ignore
} }
} }
return null; return null;

View File

@ -827,7 +827,8 @@ public class JSONObject {
return o.toString(); return o.toString();
} }
} }
catch (Exception ignored) { catch (Exception ex) {
// Ignore
} }
return null; return null;
} }

View File

@ -320,7 +320,8 @@ public class JSONTokener {
try { try {
return Double.valueOf(literal); return Double.valueOf(literal);
} }
catch (NumberFormatException ignored) { catch (NumberFormatException ex) {
// Ignore
} }
/* ... finally give up. We have an unquoted string */ /* ... finally give up. We have an unquoted string */

View File

@ -204,6 +204,7 @@ class BootZipCopyAction implements CopyAction {
outputStream.close(); outputStream.close();
} }
catch (IOException ex) { catch (IOException ex) {
// Ignore
} }
} }

View File

@ -127,6 +127,7 @@ public class LaunchedURLClassLoader extends URLClassLoader {
return result; return result;
} }
catch (ClassNotFoundException ex) { catch (ClassNotFoundException ex) {
// Ignore
} }
} }
if (this.exploded) { if (this.exploded) {

View File

@ -151,6 +151,7 @@ public class JarFileArchive implements Archive {
return unpackDirectory; return unpackDirectory;
} }
catch (IOException ex) { catch (IOException ex) {
// Ignore
} }
} }
throw new IllegalStateException("Failed to create unpack directory in directory '" + parent + "'"); throw new IllegalStateException("Failed to create unpack directory in directory '" + parent + "'");

View File

@ -140,6 +140,7 @@ public class Handler extends URLStreamHandler {
return connection; return connection;
} }
catch (IOException ex) { catch (IOException ex) {
// Ignore
} }
} }
return null; return null;
@ -154,6 +155,7 @@ public class Handler extends URLStreamHandler {
} }
} }
catch (Exception ex) { catch (Exception ex) {
// Ignore
} }
} }
return false; return false;
@ -174,6 +176,7 @@ public class Handler extends URLStreamHandler {
} }
} }
catch (Exception ex) { catch (Exception ex) {
// Ignore
} }
return null; return null;
} }
@ -425,6 +428,7 @@ public class Handler extends URLStreamHandler {
} }
} }
catch (Exception ex) { catch (Exception ex) {
// Ignore
} }
} }
finally { finally {

View File

@ -144,6 +144,7 @@ public class JarFile extends AbstractJarFile implements Iterable<java.util.jar.J
super.close(); super.close();
} }
catch (IOException ioex) { catch (IOException ioex) {
// Ignore
} }
throw ex; throw ex;
} }

View File

@ -138,6 +138,7 @@ class NestedFileSystem extends FileSystem {
zipFileSystem.close(); zipFileSystem.close();
} }
catch (Exception ex) { catch (Exception ex) {
// Ignore
} }
} }

View File

@ -88,6 +88,7 @@ class ZipContentTests {
this.zipContent.close(); this.zipContent.close();
} }
catch (IllegalStateException ex) { catch (IllegalStateException ex) {
// Ignore
} }
} }
} }

View File

@ -349,6 +349,7 @@ class JarIntegrationTests extends AbstractArchiveIntegrationTests {
.anyMatch((dependency) -> dependency.startsWith("BOOT-INF/lib/log4j-api-2")); .anyMatch((dependency) -> dependency.startsWith("BOOT-INF/lib/log4j-api-2"));
} }
catch (IOException ex) { catch (IOException ex) {
// Ignore
} }
}); });
} }

View File

@ -167,6 +167,7 @@ class WarIntegrationTests extends AbstractArchiveIntegrationTests {
.anyMatch((dependency) -> dependency.startsWith("WEB-INF/lib-provided/")); .anyMatch((dependency) -> dependency.startsWith("WEB-INF/lib-provided/"));
} }
catch (IOException ex) { catch (IOException ex) {
// Ignore
} }
}); });
} }

View File

@ -186,6 +186,7 @@ final class ModifiedClassPathClassLoader extends URLClassLoader {
return createdBy != null && createdBy.contains("IntelliJ"); return createdBy != null && createdBy.contains("IntelliJ");
} }
catch (Exception ex) { catch (Exception ex) {
// Ignore
} }
} }
return false; return false;
@ -330,6 +331,7 @@ final class ModifiedClassPathClassLoader extends URLClassLoader {
} }
} }
catch (URISyntaxException ex) { catch (URISyntaxException ex) {
// Ignore
} }
} }
return false; return false;

View File

@ -150,7 +150,8 @@ public class AnsiPropertySource extends PropertySource<AnsiElement> {
try { try {
return this.factory.apply(Integer.parseInt(postfix)); return this.factory.apply(Integer.parseInt(postfix));
} }
catch (IllegalArgumentException ignored) { catch (IllegalArgumentException ex) {
// Ignore
} }
} }
return null; return null;

View File

@ -168,6 +168,7 @@ public final class ConfigurationPropertiesBean {
} }
} }
catch (Exception ex) { catch (Exception ex) {
// Ignore
} }
} }
} }

View File

@ -110,6 +110,7 @@ public class NoUnboundElementsBindHandler extends AbstractBindHandler {
source.filter((candidate) -> isUnbound(name, candidate)).getConfigurationProperty(unboundName)); source.filter((candidate) -> isUnbound(name, candidate)).getConfigurationProperty(unboundName));
} }
catch (Exception ex) { catch (Exception ex) {
// Ignore
} }
} }
} }

View File

@ -212,6 +212,7 @@ public class ValidationBindHandler extends AbstractBindHandler {
} }
} }
catch (Exception ex) { catch (Exception ex) {
// Ignore
} }
return null; return null;
} }

View File

@ -49,6 +49,7 @@ class ConfigurationPropertySourcesPropertyResolver extends AbstractPropertyResol
return attached.findConfigurationProperty(name) != null; return attached.findConfigurationProperty(name) != null;
} }
catch (Exception ex) { catch (Exception ex) {
// Ignore
} }
} }
} }
@ -91,6 +92,7 @@ class ConfigurationPropertySourcesPropertyResolver extends AbstractPropertyResol
return (configurationProperty != null) ? configurationProperty.getValue() : null; return (configurationProperty != null) ? configurationProperty.getValue() : null;
} }
catch (Exception ex) { catch (Exception ex) {
// Ignore
} }
} }
} }

View File

@ -75,6 +75,7 @@ final class DefaultPropertyMapper implements PropertyMapper {
} }
} }
catch (Exception ex) { catch (Exception ex) {
// Ignore
} }
return ConfigurationPropertyName.EMPTY; return ConfigurationPropertyName.EMPTY;
} }

View File

@ -89,6 +89,7 @@ class SpringConfigurationPropertySource implements ConfigurationPropertySource {
} }
} }
catch (Exception ex) { catch (Exception ex) {
// Ignore
} }
} }
return null; return null;

View File

@ -121,6 +121,7 @@ public class TextResourceOrigin implements Origin {
} }
} }
catch (IOException ex) { catch (IOException ex) {
// Ignore
} }
return resource.getDescription(); return resource.getDescription();
} }

View File

@ -82,6 +82,7 @@ public class ApplicationHome {
} }
} }
catch (Exception ex) { catch (Exception ex) {
// Ignore
} }
} }
return null; return null;
@ -98,6 +99,7 @@ public class ApplicationHome {
} }
} }
catch (Exception ex) { catch (Exception ex) {
// Ignore
} }
return null; return null;
} }
@ -112,6 +114,7 @@ public class ApplicationHome {
} }
} }
catch (Exception ex) { catch (Exception ex) {
// Ignore
} }
return false; return false;
} }

View File

@ -155,6 +155,7 @@ public class UndertowWebServer implements WebServer {
closeable.close(); closeable.close();
} }
catch (Exception ex) { catch (Exception ex) {
// Ignore
} }
} }

View File

@ -304,6 +304,7 @@ public class ErrorPageFilter implements Filter, ErrorPageRegistry, Ordered {
collection.add(ClassUtils.forName(className, null)); collection.add(ClassUtils.forName(className, null));
} }
catch (Throwable ex) { catch (Throwable ex) {
// Ignore
} }
} }

View File

@ -139,6 +139,7 @@ class BufferingApplicationStartupTests {
Thread.sleep(1); Thread.sleep(1);
} }
catch (InterruptedException ex) { catch (InterruptedException ex) {
// Ignore
} }
step.end(); step.end();
} }

View File

@ -208,6 +208,7 @@ class BindConverterTests {
thread.join(); thread.join();
} }
catch (InterruptedException ex) { catch (InterruptedException ex) {
// Ignore
} }
} }
assertThat(results).isNotEmpty().doesNotContainNull(); assertThat(results).isNotEmpty().doesNotContainNull();

View File

@ -133,6 +133,7 @@ class ApplicationContextRequestMatcherTests {
thread.join(1000); thread.join(1000);
} }
catch (InterruptedException ex) { catch (InterruptedException ex) {
// Ignore
} }
} }
@ -205,6 +206,7 @@ class ApplicationContextRequestMatcherTests {
Thread.sleep(200); Thread.sleep(200);
} }
catch (InterruptedException ex) { catch (InterruptedException ex) {
// Ignore
} }
this.initialized.set(true); this.initialized.set(true);
} }

View File

@ -1275,7 +1275,7 @@ public abstract class AbstractServletWebServerFactoryTests {
blockingServlet.admitOne(); blockingServlet.admitOne();
} }
catch (RuntimeException ex) { catch (RuntimeException ex) {
// Ignore
} }
} }
@ -1331,7 +1331,7 @@ public abstract class AbstractServletWebServerFactoryTests {
blockingServlet.admitOne(); blockingServlet.admitOne();
} }
catch (RuntimeException ex) { catch (RuntimeException ex) {
// Ignore
} }
} }

View File

@ -132,6 +132,7 @@ abstract class AbstractApplicationLauncher implements BeforeEachCallback {
StreamUtils.copy(this.input, this.output); StreamUtils.copy(this.input, this.output);
} }
catch (IOException ex) { catch (IOException ex) {
// Ignore
} }
} }