Commit 04fdec6f authored by Emanuel Campolo's avatar Emanuel Campolo Committed by Phillip Webb

Replace explicit generics with diamond operator

Where possible, explicit generic declarations to use the Java 8 diamond
operator.

See gh-9781
parent eb35fc9f
......@@ -169,7 +169,7 @@ public class ManagementServerProperties implements SecurityPrerequisite {
/**
* Comma-separated list of roles that can access the management endpoint.
*/
private List<String> roles = new ArrayList<String>(
private List<String> roles = new ArrayList<>(
Collections.singletonList("ACTUATOR"));
/**
......
......@@ -89,7 +89,7 @@ public class EnvironmentEndpoint extends AbstractEndpoint<Map<String, Object>> {
}
private Map<String, PropertySource<?>> getPropertySourcesAsMap() {
Map<String, PropertySource<?>> map = new LinkedHashMap<String, PropertySource<?>>();
Map<String, PropertySource<?>> map = new LinkedHashMap<>();
for (PropertySource<?> source : getPropertySources()) {
extract("", map, source);
}
......
......@@ -40,7 +40,7 @@ public class CompositeHealthIndicator implements HealthIndicator {
* @param healthAggregator the health aggregator
*/
public CompositeHealthIndicator(HealthAggregator healthAggregator) {
this(healthAggregator, new LinkedHashMap<String, HealthIndicator>());
this(healthAggregator, new LinkedHashMap<>());
}
/**
......
......@@ -191,7 +191,7 @@ public class WebRequestTraceFilter extends OncePerRequestFilter implements Order
}
private Map<String, String[]> getParameterMapCopy(HttpServletRequest request) {
return new LinkedHashMap<String, String[]>(request.getParameterMap());
return new LinkedHashMap<>(request.getParameterMap());
}
/**
......
......@@ -45,7 +45,7 @@ import static org.assertj.core.api.Assertions.entry;
*/
public class CachePublicMetricsTests {
private Map<String, CacheManager> cacheManagers = new HashMap<String, CacheManager>();
private Map<String, CacheManager> cacheManagers = new HashMap<>();
@Before
public void setup() {
......@@ -98,7 +98,7 @@ public class CachePublicMetricsTests {
private Map<String, Number> metrics(CachePublicMetrics cpm) {
Collection<Metric<?>> metrics = cpm.metrics();
assertThat(metrics).isNotNull();
Map<String, Number> result = new HashMap<String, Number>();
Map<String, Number> result = new HashMap<>();
for (Metric<?> metric : metrics) {
result.put(metric.getName(), metric.getValue());
}
......
......@@ -435,9 +435,9 @@ public class ConfigurationPropertiesReportEndpointSerializationTests {
public static class InitializedMapAndListProperties extends Foo {
private Map<String, Boolean> map = new HashMap<String, Boolean>();
private Map<String, Boolean> map = new HashMap<>();
private List<String> list = new ArrayList<String>();
private List<String> list = new ArrayList<>();
public Map<String, Boolean> getMap() {
return this.map;
......
......@@ -268,7 +268,7 @@ public class EnvironmentEndpointTests extends AbstractEndpointTests<EnvironmentE
this.context = new AnnotationConfigApplicationContext();
MutablePropertySources propertySources = this.context.getEnvironment()
.getPropertySources();
Map<String, Object> source = new HashMap<String, Object>();
Map<String, Object> source = new HashMap<>();
source.put("foo", Collections.singletonMap("bar", "baz"));
propertySources.addFirst(new MapPropertySource("test", source));
this.context.register(Config.class);
......
......@@ -142,7 +142,7 @@ public class EnvironmentMvcEndpointTests {
@Test
public void nestedPathWhenPlaceholderCannotBeResolvedShouldReturnUnresolvedProperty()
throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
Map<String, Object> map = new HashMap<>();
map.put("my.foo", "${my.bar}");
((ConfigurableEnvironment) this.context.getEnvironment()).getPropertySources()
.addFirst(new MapPropertySource("unresolved-placeholder", map));
......@@ -152,7 +152,7 @@ public class EnvironmentMvcEndpointTests {
@Test
public void nestedPathWithSensitivePlaceholderShouldSanitize() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
Map<String, Object> map = new HashMap<>();
map.put("my.foo", "${my.password}");
map.put("my.password", "hello");
((ConfigurableEnvironment) this.context.getEnvironment()).getPropertySources()
......@@ -165,7 +165,7 @@ public class EnvironmentMvcEndpointTests {
public void propertyWithTypeOtherThanStringShouldNotFail() throws Exception {
MutablePropertySources propertySources = ((ConfigurableEnvironment) this.context
.getEnvironment()).getPropertySources();
Map<String, Object> source = new HashMap<String, Object>();
Map<String, Object> source = new HashMap<>();
source.put("foo", Collections.singletonMap("bar", "baz"));
propertySources.addFirst(new MapPropertySource("test", source));
this.mvc.perform(get("/application/env/foo.*")).andExpect(status().isOk())
......
......@@ -97,7 +97,7 @@ public class StatsdMetricWriterTests {
@Test
public void incrementMetricWithInvalidCharsInName() throws Exception {
this.writer.increment(new Delta<Long>("counter.fo:o", 3L));
this.writer.increment(new Delta<>("counter.fo:o", 3L));
this.server.waitForMessage();
assertThat(this.server.messagesReceived().get(0))
.isEqualTo("me.counter.fo-o:3|c");
......@@ -105,7 +105,7 @@ public class StatsdMetricWriterTests {
@Test
public void setMetricWithInvalidCharsInName() throws Exception {
this.writer.set(new Metric<Long>("gauge.f:o:o", 3L));
this.writer.set(new Metric<>("gauge.f:o:o", 3L));
this.server.waitForMessage();
assertThat(this.server.messagesReceived().get(0)).isEqualTo("me.gauge.f-o-o:3|g");
}
......
......@@ -134,7 +134,7 @@ class ImportAutoConfigurationImportSelector extends AutoConfigurationImportSelec
AnnotationMetadata metadata) {
MultiValueMap<Class<?>, Annotation> annotations = new LinkedMultiValueMap<>();
Class<?> source = ClassUtils.resolveClassName(metadata.getClassName(), null);
collectAnnotations(source, annotations, new HashSet<Class<?>>());
collectAnnotations(source, annotations, new HashSet<>());
return Collections.unmodifiableMap(annotations);
}
......
......@@ -34,7 +34,7 @@ public class JestProperties {
/**
* Comma-separated list of the Elasticsearch instances to use.
*/
private List<String> uris = new ArrayList<String>(
private List<String> uris = new ArrayList<>(
Collections.singletonList("http://localhost:9200"));
/**
......
......@@ -73,7 +73,7 @@ public class FlywayProperties {
* SQL statements to execute to initialize a connection immediately after obtaining
* it.
*/
private List<String> initSqls = new ArrayList<String>();
private List<String> initSqls = new ArrayList<>();
public void setLocations(List<String> locations) {
this.locations = locations;
......
......@@ -41,7 +41,7 @@ public class FreeMarkerTemplateAvailabilityProvider
static final class FreeMarkerTemplateAvailabilityProperties
extends TemplateAvailabilityProperties {
private List<String> templateLoaderPath = new ArrayList<String>(
private List<String> templateLoaderPath = new ArrayList<>(
Arrays.asList(FreeMarkerProperties.DEFAULT_TEMPLATE_LOADER_PATH));
FreeMarkerTemplateAvailabilityProperties() {
......
......@@ -41,7 +41,7 @@ public class GroovyTemplateAvailabilityProvider
static final class GroovyTemplateAvailabilityProperties
extends TemplateAvailabilityProperties {
private List<String> resourceLoaderPath = new ArrayList<String>(
private List<String> resourceLoaderPath = new ArrayList<>(
Arrays.asList(GroovyTemplateProperties.DEFAULT_RESOURCE_LOADER_PATH));
GroovyTemplateAvailabilityProperties() {
......
......@@ -181,8 +181,7 @@ public class EmbeddedLdapAutoConfiguration {
private Map<String, Object> getLdapPorts(MutablePropertySources sources) {
PropertySource<?> propertySource = sources.get(PROPERTY_SOURCE_NAME);
if (propertySource == null) {
propertySource = new MapPropertySource(PROPERTY_SOURCE_NAME,
new HashMap<String, Object>());
propertySource = new MapPropertySource(PROPERTY_SOURCE_NAME, new HashMap<>());
sources.addFirst(propertySource);
}
return (Map<String, Object>) propertySource.getSource();
......
......@@ -179,8 +179,7 @@ public class EmbeddedMongoAutoConfiguration {
private Map<String, Object> getMongoPorts(MutablePropertySources sources) {
PropertySource<?> propertySource = sources.get("mongo.ports");
if (propertySource == null) {
propertySource = new MapPropertySource("mongo.ports",
new HashMap<String, Object>());
propertySource = new MapPropertySource("mongo.ports", new HashMap<>());
sources.addFirst(propertySource);
}
return (Map<String, Object>) propertySource.getSource();
......
......@@ -64,7 +64,7 @@ public class UserInfoTokenServicesTests {
public void init() {
this.resource.setClientId("foo");
given(this.template.getForEntity(any(String.class), eq(Map.class)))
.willReturn(new ResponseEntity<Map>(this.map, HttpStatus.OK));
.willReturn(new ResponseEntity<>(this.map, HttpStatus.OK));
given(this.template.getAccessToken())
.willReturn(new DefaultOAuth2AccessToken("FOO"));
given(this.template.getResource()).willReturn(this.resource);
......
......@@ -120,7 +120,7 @@ public class ServerPropertiesTests {
@Test
public void redirectContextRootIsNotConfiguredByDefault() throws Exception {
bind(new HashMap<String, String>());
bind(new HashMap<>());
ServerProperties.Tomcat tomcat = this.properties.getTomcat();
assertThat(tomcat.getRedirectContextRoot()).isNull();
}
......@@ -164,7 +164,7 @@ public class ServerPropertiesTests {
@Test
public void testCustomizeJettyAccessLog() throws Exception {
Map<String, String> map = new HashMap<String, String>();
Map<String, String> map = new HashMap<>();
map.put("server.jetty.accesslog.enabled", "true");
map.put("server.jetty.accesslog.filename", "foo.txt");
map.put("server.jetty.accesslog.file-date-format", "yyyymmdd");
......
......@@ -107,7 +107,7 @@ public class DefaultServletWebServerFactoryCustomizerTests {
@Test
public void tomcatAccessLogFileDateFormatByDefault() {
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
Map<String, String> map = new HashMap<String, String>();
Map<String, String> map = new HashMap<>();
map.put("server.tomcat.accesslog.enabled", "true");
bindProperties(map);
this.customizer.customize(factory);
......@@ -118,7 +118,7 @@ public class DefaultServletWebServerFactoryCustomizerTests {
@Test
public void tomcatAccessLogFileDateFormatCanBeRedefined() {
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
Map<String, String> map = new HashMap<String, String>();
Map<String, String> map = new HashMap<>();
map.put("server.tomcat.accesslog.enabled", "true");
map.put("server.tomcat.accesslog.file-date-format", "yyyy-MM-dd.HH");
bindProperties(map);
......@@ -397,7 +397,7 @@ public class DefaultServletWebServerFactoryCustomizerTests {
@Test
public void customTomcatDisableMaxHttpPostSize() {
Map<String, String> map = new HashMap<String, String>();
Map<String, String> map = new HashMap<>();
map.put("server.tomcat.max-http-post-size", "-1");
bindProperties(map);
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory(0);
......
......@@ -126,8 +126,7 @@ public class DevToolsDataSourceAutoConfiguration {
InMemoryDatabase(String urlPrefix, String... driverClassNames) {
this.urlPrefix = urlPrefix;
this.driverClassNames = new HashSet<String>(
Arrays.asList(driverClassNames));
this.driverClassNames = new HashSet<>(Arrays.asList(driverClassNames));
}
boolean matches(DataSourceProperties properties) {
......
......@@ -58,7 +58,7 @@ public abstract class AbstractEmbeddedServletContainerIntegrationTests {
private static List<Object> createParameters(String packaging, String container,
List<Class<? extends AbstractApplicationLauncher>> applicationLaunchers) {
List<Object> parameters = new ArrayList<Object>();
List<Object> parameters = new ArrayList<>();
ApplicationBuilder applicationBuilder = new ApplicationBuilder(temporaryFolder,
packaging, container);
for (Class<? extends AbstractApplicationLauncher> launcherClass : applicationLaunchers) {
......
......@@ -56,7 +56,7 @@ class BootRunApplicationLauncher extends AbstractApplicationLauncher {
if (archive.getName().endsWith(".war")) {
populateSrcMainWebapp();
}
List<String> classpath = new ArrayList<String>();
List<String> classpath = new ArrayList<>();
classpath.add(targetClasses.getAbsolutePath());
for (File dependency : dependencies.listFiles()) {
classpath.add(dependency.getAbsolutePath());
......
......@@ -67,7 +67,7 @@ class IdeApplicationLauncher extends AbstractApplicationLauncher {
if (archive.getName().endsWith(".war")) {
populateSrcMainWebapp();
}
List<String> classpath = new ArrayList<String>();
List<String> classpath = new ArrayList<>();
classpath.add(targetClasses.getAbsolutePath());
for (File dependency : dependencies.listFiles()) {
classpath.add(dependency.getAbsolutePath());
......
......@@ -60,7 +60,7 @@ public class AnnotationsPropertySource extends EnumerablePropertySource<Class<?>
private Map<String, Object> getProperties(Class<?> source) {
Map<String, Object> properties = new LinkedHashMap<>();
collectProperties(source, source, properties, new HashSet<Class<?>>());
collectProperties(source, source, properties, new HashSet<>());
return Collections.unmodifiableMap(properties);
}
......
......@@ -219,7 +219,7 @@ public class SpringBootTestContextBootstrapper extends DefaultTestContextBootstr
ContextConfiguration configuration) {
ContextConfigurationAttributes attributes = new ContextConfigurationAttributes(
candidateConfig.getTestClass(), configuration);
Set<Class<?>> configurationClasses = new HashSet<Class<?>>(
Set<Class<?>> configurationClasses = new HashSet<>(
Arrays.asList(attributes.getClasses()));
for (Class<?> candidate : candidateConfig.getClasses()) {
if (configurationClasses.contains(candidate)) {
......
......@@ -60,7 +60,7 @@ class DuplicateJsonObjectContextCustomizerFactory implements ContextCustomizerFa
}
private List<URL> findJsonObjects() {
List<URL> jsonObjects = new ArrayList<URL>();
List<URL> jsonObjects = new ArrayList<>();
try {
Enumeration<URL> resources = getClass().getClassLoader()
.getResources("org/json/JSONObject.class");
......
......@@ -158,7 +158,7 @@ public class JacksonTester<T> extends AbstractJsonMarshalTester<T> {
* @return the new instance
*/
public JacksonTester<T> forView(Class<?> view) {
return new JacksonTester<T>(this.getResourceLoadClass(), this.getType(),
return new JacksonTester<>(this.getResourceLoadClass(), this.getType(),
this.objectMapper, view);
}
......
......@@ -46,7 +46,7 @@ class BootArchiveSupport {
private static final Set<String> DEFAULT_LAUNCHER_CLASSES;
static {
Set<String> defaultLauncherClasses = new HashSet<String>();
Set<String> defaultLauncherClasses = new HashSet<>();
defaultLauncherClasses.add("org.springframework.boot.loader.JarLauncher");
defaultLauncherClasses.add("org.springframework.boot.loader.PropertiesLauncher");
defaultLauncherClasses.add("org.springframework.boot.loader.WarLauncher");
......@@ -121,7 +121,7 @@ class BootArchiveSupport {
}
private void configureExclusions() {
Set<String> excludes = new HashSet<String>();
Set<String> excludes = new HashSet<>();
if (this.excludeDevtools) {
excludes.add("**/spring-boot-devtools-*.jar");
}
......
......@@ -132,7 +132,7 @@ class BootZipCopyAction implements CopyAction {
private Spec<FileTreeElement> writeLoaderClasses(ZipArchiveOutputStream out) {
try (ZipInputStream in = new ZipInputStream(getClass()
.getResourceAsStream("/META-INF/loader/spring-boot-loader.jar"))) {
Set<String> entries = new HashSet<String>();
Set<String> entries = new HashSet<>();
java.util.zip.ZipEntry entry;
while ((entry = in.getNextEntry()) != null) {
if (entry.isDirectory() && !entry.getName().startsWith("META-INF/")) {
......
......@@ -34,7 +34,7 @@ public class LaunchScriptConfiguration implements Serializable {
private boolean included = false;
private final Map<String, String> properties = new HashMap<String, String>();
private final Map<String, String> properties = new HashMap<>();
private File script;
......
......@@ -40,7 +40,7 @@ class PomCondition extends Condition<File> {
private Set<String> notExpectedContents;
PomCondition() {
this(new HashSet<String>(), new HashSet<String>());
this(new HashSet<>(), new HashSet<>());
}
private PomCondition(Set<String> expectedContents, Set<String> notExpectedContents) {
......
......@@ -160,7 +160,7 @@ public class GradleBuild implements TestRule {
if (this.gradleVersion != null) {
gradleRunner.withGradleVersion(this.gradleVersion);
}
List<String> allArguments = new ArrayList<String>();
List<String> allArguments = new ArrayList<>();
allArguments.add("-PpluginClasspath=" + pluginClasspath());
allArguments.add("-PbootVersion=" + getBootVersion());
allArguments.add("--stacktrace");
......
......@@ -330,7 +330,7 @@ public class PropertiesLauncher extends Launcher {
@Override
protected ClassLoader createClassLoader(List<Archive> archives) throws Exception {
Set<URL> urls = new LinkedHashSet<URL>(archives.size());
Set<URL> urls = new LinkedHashSet<>(archives.size());
for (Archive archive : archives) {
urls.add(archive.getUrl());
}
......@@ -522,7 +522,7 @@ public class PropertiesLauncher extends Launcher {
root = "";
}
EntryFilter filter = new PrefixMatchingArchiveFilter(root);
List<Archive> archives = new ArrayList<Archive>(parent.getNestedArchives(filter));
List<Archive> archives = new ArrayList<>(parent.getNestedArchives(filter));
if (("".equals(root) || ".".equals(root)) && !path.endsWith(".jar")
&& parent != this.parent) {
// You can't find the root with an entry filter so it has to be added
......
......@@ -66,7 +66,7 @@ public abstract class SystemPropertyUtils {
if (text == null) {
return text;
}
return parseStringValue(null, text, text, new HashSet<String>());
return parseStringValue(null, text, text, new HashSet<>());
}
/**
......@@ -83,7 +83,7 @@ public abstract class SystemPropertyUtils {
if (text == null) {
return text;
}
return parseStringValue(properties, text, text, new HashSet<String>());
return parseStringValue(properties, text, text, new HashSet<>());
}
private static String parseStringValue(Properties properties, String value,
......
......@@ -266,7 +266,7 @@ public class PropertiesLauncherTests {
}
private List<Archive> archives() throws Exception {
List<Archive> archives = new ArrayList<Archive>();
List<Archive> archives = new ArrayList<>();
String path = System.getProperty("java.class.path");
for (String url : path.split(File.pathSeparator)) {
archives.add(archive(url));
......
......@@ -100,7 +100,7 @@ public class ModifiedClassPathRunner extends BlockJUnit4ClassRunner {
}
private URL[] extractUrls(URLClassLoader classLoader) throws Exception {
List<URL> extractedUrls = new ArrayList<URL>();
List<URL> extractedUrls = new ArrayList<>();
for (URL url : classLoader.getURLs()) {
if (isSurefireBooterJar(url)) {
extractedUrls.addAll(extractUrlsFromManifestClassPath(url));
......@@ -117,7 +117,7 @@ public class ModifiedClassPathRunner extends BlockJUnit4ClassRunner {
}
private List<URL> extractUrlsFromManifestClassPath(URL booterJar) throws Exception {
List<URL> urls = new ArrayList<URL>();
List<URL> urls = new ArrayList<>();
for (String entry : getClassPath(booterJar)) {
urls.add(new URL(entry));
}
......@@ -133,7 +133,7 @@ public class ModifiedClassPathRunner extends BlockJUnit4ClassRunner {
private URL[] processUrls(URL[] urls, Class<?> testClass) throws Exception {
ClassPathEntryFilter filter = new ClassPathEntryFilter(testClass);
List<URL> processedUrls = new ArrayList<URL>();
List<URL> processedUrls = new ArrayList<>();
processedUrls.addAll(getAdditionalUrls(testClass));
for (URL url : urls) {
if (!filter.isExcluded(url)) {
......@@ -173,7 +173,7 @@ public class ModifiedClassPathRunner extends BlockJUnit4ClassRunner {
DependencyRequest dependencyRequest = new DependencyRequest(collectRequest, null);
DependencyResult result = repositorySystem.resolveDependencies(session,
dependencyRequest);
List<URL> resolvedArtifacts = new ArrayList<URL>();
List<URL> resolvedArtifacts = new ArrayList<>();
for (ArtifactResult artifact : result.getArtifactResults()) {
resolvedArtifacts.add(artifact.getArtifact().getFile().toURI().toURL());
}
......@@ -181,7 +181,7 @@ public class ModifiedClassPathRunner extends BlockJUnit4ClassRunner {
}
private List<Dependency> createDependencies(String[] allCoordinates) {
List<Dependency> dependencies = new ArrayList<Dependency>();
List<Dependency> dependencies = new ArrayList<>();
for (String coordinate : allCoordinates) {
dependencies.add(new Dependency(new DefaultArtifact(coordinate), null));
}
......@@ -254,8 +254,7 @@ public class ModifiedClassPathRunner extends BlockJUnit4ClassRunner {
private List<FrameworkMethod> wrapFrameworkMethods(
List<FrameworkMethod> methods) {
List<FrameworkMethod> wrapped = new ArrayList<FrameworkMethod>(
methods.size());
List<FrameworkMethod> wrapped = new ArrayList<>(methods.size());
for (FrameworkMethod frameworkMethod : methods) {
wrapped.add(new ModifiedClassPathFrameworkMethod(
frameworkMethod.getMethod()));
......
......@@ -42,7 +42,7 @@ final class EnvironmentConverter {
private static final Set<String> SERVLET_ENVIRONMENT_SOURCE_NAMES;
static {
final Set<String> names = new HashSet<String>();
final 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);
......@@ -109,7 +109,7 @@ final class EnvironmentConverter {
}
private void removeAllPropertySources(MutablePropertySources propertySources) {
Set<String> names = new HashSet<String>();
Set<String> names = new HashSet<>();
for (PropertySource<?> propertySource : propertySources) {
names.add(propertySource.getName());
}
......
......@@ -451,7 +451,7 @@ public final class ConfigurationPropertyName
if (name.length() == 0) {
return EMPTY;
}
List<CharSequence> elements = new ArrayList<CharSequence>(10);
List<CharSequence> elements = new ArrayList<>(10);
process(name, '.', (elementValue, start, end, indexed) -> {
if (elementValue.length() > 0) {
if (!indexed) {
......@@ -496,7 +496,7 @@ public final class ConfigurationPropertyName
if (name.length() == 0) {
return EMPTY;
}
List<CharSequence> elements = new ArrayList<CharSequence>(10);
List<CharSequence> elements = new ArrayList<>(10);
process(name, separator, (elementValue, start, end, indexed) -> {
elementValue = elementValueProcessor.apply(elementValue);
if (!isIndexed(elementValue)) {
......
......@@ -78,7 +78,7 @@ class OriginTrackedYamlLoader extends YamlProcessor {
}
public Map<String, Object> load() {
final Map<String, Object> result = new LinkedHashMap<String, Object>();
final Map<String, Object> result = new LinkedHashMap<>();
process((properties, map) -> {
result.putAll(getFlattenedMap(map));
});
......
......@@ -91,21 +91,21 @@ public class NarayanaProperties {
/**
* Comma-separated list of orphan filters.
*/
private List<String> xaResourceOrphanFilters = new ArrayList<String>(Arrays.asList(
private List<String> xaResourceOrphanFilters = new ArrayList<>(Arrays.asList(
"com.arjuna.ats.internal.jta.recovery.arjunacore.JTATransactionLogXAResourceOrphanFilter",
"com.arjuna.ats.internal.jta.recovery.arjunacore.JTANodeNameXAResourceOrphanFilter"));
/**
* Comma-separated list of recovery modules.
*/
private List<String> recoveryModules = new ArrayList<String>(Arrays.asList(
private List<String> recoveryModules = new ArrayList<>(Arrays.asList(
"com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule",
"com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule"));
/**
* Comma-separated list of expiry scanners.
*/
private List<String> expiryScanners = new ArrayList<String>(Collections.singletonList(
private List<String> expiryScanners = new ArrayList<>(Collections.singletonList(
"com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionStatusManagerScanner"));
public String getLogDir() {
......
......@@ -88,7 +88,7 @@ public class ServerPortInfoApplicationContextInitializer
MutablePropertySources sources = environment.getPropertySources();
PropertySource<?> source = sources.get("server.ports");
if (source == null) {
source = new MapPropertySource("server.ports", new HashMap<String, Object>());
source = new MapPropertySource("server.ports", new HashMap<>());
sources.addFirst(source);
}
((Map<String, Object>) source.getSource()).put(propertyName, port);
......
......@@ -489,7 +489,7 @@ public class UndertowServletWebServerFactory extends AbstractServletWebServerFac
File root = getValidDocumentRoot();
File docBase = getCanonicalDocumentRoot(root);
List<URL> metaInfResourceUrls = getUrlsOfJarsWithMetaInfResources();
List<URL> resourceJarUrls = new ArrayList<URL>();
List<URL> resourceJarUrls = new ArrayList<>();
List<ResourceManager> resourceManagers = new ArrayList<ResourceManager>();
ResourceManager rootResourceManager = docBase.isDirectory()
? new FileResourceManager(docBase, 0) : new JarResourceManager(docBase);
......
......@@ -444,7 +444,7 @@ public class ConfigurationPropertiesBindingPostProcessorTests {
this.context = new AnnotationConfigApplicationContext();
MutablePropertySources sources = this.context.getEnvironment()
.getPropertySources();
Map<String, Object> source = new LinkedHashMap<String, Object>();
Map<String, Object> source = new LinkedHashMap<>();
source.put("example.one", "foo");
sources.addFirst(new MapPropertySource("test-source", source));
this.context.register(PrototypePropertiesConfig.class);
......
......@@ -154,7 +154,7 @@ public class WebServerFactoryCustomizerBeanPostProcessorTests {
WebServerFactoryCustomizer<WebServerFactoryOne> one = (f) -> called.add("one");
WebServerFactoryCustomizer<WebServerFactoryTwo> two = (f) -> called.add("two");
WebServerFactoryCustomizer<WebServerFactory> all = (f) -> called.add("all");
Map<String, Object> beans = new LinkedHashMap<String, Object>();
Map<String, Object> beans = new LinkedHashMap<>();
beans.put("one", one);
beans.put("two", two);
beans.put("all", all);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment