Skip to content
Closed
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 @@ -16,9 +16,7 @@

package org.springframework.boot;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

Expand Down Expand Up @@ -53,7 +51,7 @@ public String[] getSourceArgs() {
@Override
public Set<String> getOptionNames() {
String[] names = this.source.getPropertyNames();
return Collections.unmodifiableSet(new HashSet<>(Arrays.asList(names)));
return Set.of(names);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package org.springframework.boot;

import java.lang.reflect.Constructor;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

Expand All @@ -44,11 +43,9 @@ final class EnvironmentConverter {
private static final Set<String> SERVLET_ENVIRONMENT_SOURCE_NAMES;

static {
Set<String> names = new HashSet<>();
names.add(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME);
names.add(StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME);
names.add(StandardServletEnvironment.JNDI_PROPERTY_SOURCE_NAME);
SERVLET_ENVIRONMENT_SOURCE_NAMES = Collections.unmodifiableSet(names);
SERVLET_ENVIRONMENT_SOURCE_NAMES = Set.of(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME,
StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME,
StandardServletEnvironment.JNDI_PROPERTY_SOURCE_NAME);
}

private final ClassLoader classLoader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@ class ExitCodeGenerators implements Iterable<ExitCodeGenerator> {

private final List<ExitCodeGenerator> generators = new ArrayList<>();

void addAll(Throwable exception, ExitCodeExceptionMapper... mappers) {
Assert.notNull(exception, "'exception' must not be null");
Assert.notNull(mappers, "'mappers' must not be null");
addAll(exception, Arrays.asList(mappers));
}

void addAll(Throwable exception, Iterable<? extends ExitCodeExceptionMapper> mappers) {
Assert.notNull(exception, "'exception' must not be null");
Assert.notNull(mappers, "'mappers' must not be null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.metrics.ApplicationStartup;
import org.springframework.core.metrics.StartupStep;
import org.springframework.util.ReflectionUtils;

/**
* A collection of {@link SpringApplicationRunListener}.
Expand Down Expand Up @@ -99,9 +98,6 @@ private void callFailedListener(SpringApplicationRunListener listener,
listener.failed(context, exception);
}
catch (Throwable ex) {
if (exception == null) {
ReflectionUtils.rethrowRuntimeException(ex);
}
if (this.log.isDebugEnabled()) {
this.log.error("Error handling failed", ex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import java.lang.Thread.UncaughtExceptionHandler;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

Expand All @@ -34,13 +32,7 @@
*/
class SpringBootExceptionHandler implements UncaughtExceptionHandler {

private static final Set<String> LOG_CONFIGURATION_MESSAGES;

static {
Set<String> messages = new HashSet<>();
messages.add("Logback configuration error detected");
LOG_CONFIGURATION_MESSAGES = Collections.unmodifiableSet(messages);
}
private static final Set<String> LOG_CONFIGURATION_MESSAGES = Set.of("Logback configuration error detected");

private static final LoggedExceptionHandlerThreadLocal handler = new LoggedExceptionHandlerThreadLocal();

Expand Down