dependency = new HashMap<>();
dependency.put("group", groupId);
dependency.put("module", artifactId);
dependency.put("version", version);
dependency.put("type", "pom");
try {
- return new UrlModelSource(Grape.getInstance().resolve(null, dependency)[0].toURL());
+ return new org.apache.maven.model.building.UrlModelSource(
+ Grape.getInstance().resolve(null, dependency)[0].toURL());
}
catch (MalformedURLException ex) {
throw new UnresolvableModelException(ex.getMessage(), groupId, artifactId, version);
diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/reactive/WebFluxTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/reactive/WebFluxTest.java
index ce45b2c8df..ece41ac642 100644
--- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/reactive/WebFluxTest.java
+++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/reactive/WebFluxTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2019 the original author or authors.
+ * Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,7 +32,6 @@ import org.springframework.boot.test.autoconfigure.core.AutoConfigureCache;
import org.springframework.boot.test.autoconfigure.filter.TypeExcludeFilters;
import org.springframework.boot.test.autoconfigure.json.AutoConfigureJson;
import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import org.springframework.core.annotation.AliasFor;
@@ -55,9 +54,10 @@ import org.springframework.test.web.reactive.server.WebTestClient;
* {@link WebTestClient}. For more fine-grained control of WebTestClient the
* {@link AutoConfigureWebTestClient @AutoConfigureWebTestClient} annotation can be used.
*
- * Typically {@code @WebFluxTest} is used in combination with {@link MockBean @MockBean}
- * or {@link Import @Import} to create any collaborators required by your
- * {@code @Controller} beans.
+ * Typically {@code @WebFluxTest} is used in combination with
+ * {@link org.springframework.boot.test.mock.mockito.MockBean @MockBean} or
+ * {@link Import @Import} to create any collaborators required by your {@code @Controller}
+ * beans.
*
* If you are looking to load your full application configuration and use WebTestClient,
* you should consider {@link SpringBootTest @SpringBootTest} combined with
diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizer.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizer.java
index 9d2e30223d..20d4e0e6d0 100644
--- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizer.java
+++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizer.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2019 the original author or authors.
+ * Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -109,7 +109,7 @@ public class SpringBootMockMvcBuilderCustomizer implements MockMvcBuilderCustomi
private void addFilters(ConfigurableMockMvcBuilder> builder) {
FilterRegistrationBeans registrations = new FilterRegistrationBeans(this.context);
registrations.stream().map(AbstractFilterRegistrationBean.class::cast)
- .filter(AbstractFilterRegistrationBean::isEnabled)
+ .filter(AbstractFilterRegistrationBean>::isEnabled)
.forEach((registration) -> addFilter(builder, registration));
}
diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java
index a65b2c56cc..57b53e2f2b 100644
--- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java
+++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2019 the original author or authors.
+ * Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,7 +31,6 @@ import org.springframework.boot.test.autoconfigure.OverrideAutoConfiguration;
import org.springframework.boot.test.autoconfigure.core.AutoConfigureCache;
import org.springframework.boot.test.autoconfigure.filter.TypeExcludeFilters;
import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.context.annotation.Import;
import org.springframework.core.annotation.AliasFor;
@@ -56,7 +55,8 @@ import org.springframework.test.web.servlet.MockMvc;
* WebDriver). For more fine-grained control of MockMVC the
* {@link AutoConfigureMockMvc @AutoConfigureMockMvc} annotation can be used.
*
- * Typically {@code @WebMvcTest} is used in combination with {@link MockBean @MockBean} or
+ * Typically {@code @WebMvcTest} is used in combination with
+ * {@link org.springframework.boot.test.mock.mockito.MockBean @MockBean} or
* {@link Import @Import} to create any collaborators required by your {@code @Controller}
* beans.
*
diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/webservices/client/WebServiceClientExcludeFilter.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/webservices/client/WebServiceClientExcludeFilter.java
index 684dfd34c8..91b31daf18 100644
--- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/webservices/client/WebServiceClientExcludeFilter.java
+++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/webservices/client/WebServiceClientExcludeFilter.java
@@ -36,7 +36,7 @@ public final class WebServiceClientExcludeFilter
protected WebServiceClientExcludeFilter(Class> testClass) {
super(testClass);
- this.components = getAnnotation().getValue("components", Class[].class).orElse(new Class[0]);
+ this.components = getAnnotation().getValue("components", Class[].class).orElse(new Class>[0]);
}
@Override
diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/FilteredClassLoader.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/FilteredClassLoader.java
index e8d577cf70..903da876d7 100644
--- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/FilteredClassLoader.java
+++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/FilteredClassLoader.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2019 the original author or authors.
+ * Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -77,6 +77,7 @@ public class FilteredClassLoader extends URLClassLoader {
* name of a class or a resource name.
*/
@SafeVarargs
+ @SuppressWarnings("varargs")
public FilteredClassLoader(Predicate... filters) {
this(Arrays.asList(filters), Arrays.asList(filters));
}
diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoPostProcessor.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoPostProcessor.java
index a3134c78b7..e153201247 100644
--- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoPostProcessor.java
+++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoPostProcessor.java
@@ -16,7 +16,6 @@
package org.springframework.boot.test.mock.mockito;
-import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.Collection;
@@ -333,8 +332,8 @@ public class MockitoPostProcessor extends InstantiationAwareBeanPostProcessorAda
}
@Override
- public PropertyValues postProcessPropertyValues(PropertyValues pvs, PropertyDescriptor[] pds, final Object bean,
- String beanName) throws BeansException {
+ public PropertyValues postProcessProperties(PropertyValues pvs, Object bean, String beanName)
+ throws BeansException {
ReflectionUtils.doWithFields(bean.getClass(), (field) -> postProcessField(bean, field));
return pvs;
}
diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/build.gradle
index 92bec3c1d6..0001148347 100644
--- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/build.gradle
+++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/build.gradle
@@ -15,6 +15,7 @@ sourceSets {
}
dependencies {
+ testCompileOnly("com.google.code.findbugs:jsr305:3.0.2")
testImplementation(enforcedPlatform(project(":spring-boot-project:spring-boot-dependencies")))
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testImplementation("javax.validation:validation-api")
diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/MavenPluginAction.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/MavenPluginAction.java
index 2cd8f1dedc..94132da2ce 100644
--- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/MavenPluginAction.java
+++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/MavenPluginAction.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2019 the original author or authors.
+ * Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,12 +19,11 @@ package org.springframework.boot.gradle.plugin;
import org.gradle.api.Action;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
-import org.gradle.api.artifacts.maven.MavenResolver;
-import org.gradle.api.plugins.MavenPlugin;
import org.gradle.api.tasks.Upload;
/**
- * {@link Action} that is executed in response to the {@link MavenPlugin} being applied.
+ * {@link Action} that is executed in response to the
+ * {@link org.gradle.api.plugins.MavenPlugin} being applied.
*
* @author Andy Wilkinson
*/
@@ -37,8 +36,9 @@ final class MavenPluginAction implements PluginApplicationAction {
}
@Override
+ @SuppressWarnings("deprecation")
public Class extends Plugin extends Project>> getPluginClass() {
- return MavenPlugin.class;
+ return org.gradle.api.plugins.MavenPlugin.class;
}
@Override
@@ -50,8 +50,9 @@ final class MavenPluginAction implements PluginApplicationAction {
});
}
+ @SuppressWarnings("deprecation")
private void clearConfigurationMappings(Upload upload) {
- upload.getRepositories().withType(MavenResolver.class,
+ upload.getRepositories().withType(org.gradle.api.artifacts.maven.MavenResolver.class,
(resolver) -> resolver.getPom().getScopeMappings().getMappings().clear());
}
diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootJar.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootJar.java
index 37971ba11b..90a146a225 100644
--- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootJar.java
+++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootJar.java
@@ -208,11 +208,13 @@ public class BootJar extends Jar implements BootArchive {
}
@Override
+ @Deprecated
public boolean isExcludeDevtools() {
return this.support.isExcludeDevtools();
}
@Override
+ @Deprecated
public void setExcludeDevtools(boolean excludeDevtools) {
this.support.setExcludeDevtools(excludeDevtools);
}
diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootWar.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootWar.java
index 63d20ee617..ffaed0440e 100644
--- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootWar.java
+++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootWar.java
@@ -165,11 +165,13 @@ public class BootWar extends War implements BootArchive {
}
@Override
+ @Deprecated
public boolean isExcludeDevtools() {
return this.support.isExcludeDevtools();
}
@Override
+ @Deprecated
public void setExcludeDevtools(boolean excludeDevtools) {
this.support.setExcludeDevtools(excludeDevtools);
}
diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootWarTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootWarTests.java
index 368d41cf59..b4fa84a653 100644
--- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootWarTests.java
+++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootWarTests.java
@@ -81,6 +81,7 @@ class BootWarTests extends AbstractBootArchiveTests {
}
@Test
+ @Deprecated
void devtoolsJarCanBeIncludedWhenItsOnTheProvidedClasspath() throws IOException {
getTask().setMainClassName("com.example.Main");
getTask().providedClasspath(jarFile("spring-boot-devtools-0.1.2.jar"));
diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/build.gradle
index b48676b56c..8ed6b82eea 100644
--- a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/build.gradle
+++ b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/build.gradle
@@ -65,3 +65,9 @@ processResources {
dependsOn reproducibleLoaderJar
dependsOn reproducibleJarModeLayerToolsJar
}
+
+compileJava {
+ if ((!project.hasProperty("buildJavaHome")) && JavaVersion.current() == JavaVersion.VERSION_1_8) {
+ options.compilerArgs += ['-Xlint:-sunapi', '-XDenableSunApiLintControl']
+ }
+}
diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive/ExplodedArchive.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive/ExplodedArchive.java
index f804268827..8a644be460 100644
--- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive/ExplodedArchive.java
+++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive/ExplodedArchive.java
@@ -103,6 +103,7 @@ public class ExplodedArchive implements Archive {
}
@Override
+ @Deprecated
public Iterator iterator() {
return new EntryIterator(this.root, this.recursive, null, null);
}
@@ -321,6 +322,7 @@ public class ExplodedArchive implements Archive {
}
@Override
+ @Deprecated
public Iterator iterator() {
return Collections.emptyIterator();
}
diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive/JarFileArchive.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive/JarFileArchive.java
index c43c179a20..5fd3e05251 100755
--- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive/JarFileArchive.java
+++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive/JarFileArchive.java
@@ -81,6 +81,7 @@ public class JarFileArchive implements Archive {
}
@Override
+ @Deprecated
public Iterator iterator() {
return new EntryIterator(this.jarFile.iterator(), null, null);
}
diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java
index e1c33db7e8..5901fa6f1c 100644
--- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java
+++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java
@@ -25,6 +25,7 @@ import java.net.URLClassLoader;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.jar.Attributes;
@@ -289,7 +290,7 @@ class PropertiesLauncherTests {
assertThat(loader.getClass().getName()).isEqualTo(TestLoader.class.getName());
}
- private List archives() throws Exception {
+ private Iterator archives() throws Exception {
List archives = new ArrayList<>();
String path = System.getProperty("java.class.path");
for (String url : path.split(File.pathSeparator)) {
@@ -298,7 +299,7 @@ class PropertiesLauncherTests {
archives.add(archive);
}
}
- return archives;
+ return archives.iterator();
}
private Archive archive(String url) throws IOException {
diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/archive/JarFileArchiveTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/archive/JarFileArchiveTests.java
index 8cec7bb0dd..1394af6015 100755
--- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/archive/JarFileArchiveTests.java
+++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/archive/JarFileArchiveTests.java
@@ -148,6 +148,7 @@ class JarFileArchiveTests {
File file = new File(this.tempDir, "test.jar");
FileCopyUtils.copy(writeZip64Jar(), file);
try (JarFileArchive zip64Archive = new JarFileArchive(file)) {
+ @SuppressWarnings("deprecation")
Iterator entries = zip64Archive.iterator();
for (int i = 0; i < 65537; i++) {
assertThat(entries.hasNext()).as(i + "nth file is present").isTrue();
diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/DependencyFilter.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/DependencyFilter.java
index d5b0c8ab2b..a0cb0a30cc 100644
--- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/DependencyFilter.java
+++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/DependencyFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2019 the original author or authors.
+ * Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -46,11 +46,10 @@ public abstract class DependencyFilter extends AbstractArtifactsFilter {
}
@Override
- @SuppressWarnings({ "rawtypes", "unchecked" })
- public Set filter(Set artifacts) throws ArtifactFilterException {
- Set result = new HashSet();
- for (Object artifact : artifacts) {
- if (!filter((Artifact) artifact)) {
+ public Set filter(Set artifacts) throws ArtifactFilterException {
+ Set result = new HashSet<>();
+ for (Artifact artifact : artifacts) {
+ if (!filter(artifact)) {
result.add(artifact);
}
}
diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java
index b35cccb6c4..4a2d698aff 100644
--- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java
+++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java
@@ -310,7 +310,7 @@ public class SpringApplication {
Banner printedBanner = printBanner(environment);
context = createApplicationContext();
exceptionReporters = getSpringFactoriesInstances(SpringBootExceptionReporter.class,
- new Class[] { ConfigurableApplicationContext.class }, context);
+ new Class>[] { ConfigurableApplicationContext.class }, context);
prepareContext(context, environment, listeners, applicationArguments, printedBanner);
refreshContext(context);
afterRefresh(context, applicationArguments);
diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactory.java
index dc54ce96e6..971773fef5 100644
--- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactory.java
+++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactory.java
@@ -24,8 +24,6 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.List;
-import io.rsocket.RSocketFactory;
-import io.rsocket.RSocketFactory.ServerRSocketFactory;
import io.rsocket.SocketAcceptor;
import io.rsocket.transport.ServerTransport;
import io.rsocket.transport.netty.server.CloseableChannel;
@@ -39,7 +37,6 @@ import org.springframework.boot.rsocket.server.ConfigurableRSocketServerFactory;
import org.springframework.boot.rsocket.server.RSocketServer;
import org.springframework.boot.rsocket.server.RSocketServerCustomizer;
import org.springframework.boot.rsocket.server.RSocketServerFactory;
-import org.springframework.boot.rsocket.server.ServerRSocketFactoryProcessor;
import org.springframework.http.client.reactive.ReactorResourceFactory;
import org.springframework.util.Assert;
@@ -62,7 +59,8 @@ public class NettyRSocketServerFactory implements RSocketServerFactory, Configur
private Duration lifecycleTimeout;
- private List socketFactoryProcessors = new ArrayList<>();
+ @SuppressWarnings("deprecation")
+ private List socketFactoryProcessors = new ArrayList<>();
private List rSocketServerCustomizers = new ArrayList<>();
@@ -90,29 +88,32 @@ public class NettyRSocketServerFactory implements RSocketServerFactory, Configur
}
/**
- * Set {@link ServerRSocketFactoryProcessor}s that should be called to process the
- * {@link ServerRSocketFactory} while building the server. Calling this method will
- * replace any existing processors.
+ * Set {@link org.springframework.boot.rsocket.server.ServerRSocketFactoryProcessor}s
+ * that should be called to process the
+ * {@link io.rsocket.RSocketFactory.ServerRSocketFactory} while building the server.
+ * Calling this method will replace any existing processors.
* @param socketFactoryProcessors processors to apply before the server starts
* @deprecated in favor of {@link #setRSocketServerCustomizers(Collection)} as of
* 2.2.7
*/
@Deprecated
public void setSocketFactoryProcessors(
- Collection extends ServerRSocketFactoryProcessor> socketFactoryProcessors) {
+ Collection extends org.springframework.boot.rsocket.server.ServerRSocketFactoryProcessor> socketFactoryProcessors) {
Assert.notNull(socketFactoryProcessors, "SocketFactoryProcessors must not be null");
this.socketFactoryProcessors = new ArrayList<>(socketFactoryProcessors);
}
/**
- * Add {@link ServerRSocketFactoryProcessor}s that should be called to process the
- * {@link ServerRSocketFactory} while building the server.
+ * Add {@link org.springframework.boot.rsocket.server.ServerRSocketFactoryProcessor}s
+ * that should be called to process the
+ * {@link io.rsocket.RSocketFactory.ServerRSocketFactory} while building the server.
* @param socketFactoryProcessors processors to apply before the server starts
* @deprecated in favor of
* {@link #addRSocketServerCustomizers(RSocketServerCustomizer...)} as of 2.2.7
*/
@Deprecated
- public void addSocketFactoryProcessors(ServerRSocketFactoryProcessor... socketFactoryProcessors) {
+ public void addSocketFactoryProcessors(
+ org.springframework.boot.rsocket.server.ServerRSocketFactoryProcessor... socketFactoryProcessors) {
Assert.notNull(socketFactoryProcessors, "SocketFactoryProcessors must not be null");
this.socketFactoryProcessors.addAll(Arrays.asList(socketFactoryProcessors));
}
@@ -154,7 +155,8 @@ public class NettyRSocketServerFactory implements RSocketServerFactory, Configur
public NettyRSocketServer create(SocketAcceptor socketAcceptor) {
ServerTransport transport = createTransport();
io.rsocket.core.RSocketServer server = io.rsocket.core.RSocketServer.create(socketAcceptor);
- RSocketFactory.ServerRSocketFactory factory = new ServerRSocketFactory(server);
+ io.rsocket.RSocketFactory.ServerRSocketFactory factory = new io.rsocket.RSocketFactory.ServerRSocketFactory(
+ server);
this.rSocketServerCustomizers.forEach((customizer) -> customizer.customize(server));
this.socketFactoryProcessors.forEach((processor) -> processor.process(factory));
Mono starter = server.bind(transport);
diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/rsocket/server/ServerRSocketFactoryProcessor.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/rsocket/server/ServerRSocketFactoryProcessor.java
index 0edc20d8e0..4990ebce9e 100644
--- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/rsocket/server/ServerRSocketFactoryProcessor.java
+++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/rsocket/server/ServerRSocketFactoryProcessor.java
@@ -16,10 +16,9 @@
package org.springframework.boot.rsocket.server;
-import io.rsocket.RSocketFactory.ServerRSocketFactory;
-
/**
- * Processor that allows for custom modification of a {@link ServerRSocketFactory
+ * Processor that allows for custom modification of a
+ * {@link io.rsocket.RSocketFactory.ServerRSocketFactory
* RSocketFactory.ServerRSocketFactory} before it is used.
*
* @author Brian Clozel
@@ -37,6 +36,6 @@ public interface ServerRSocketFactoryProcessor {
* @param factory the factory to process
* @return the processed factory instance
*/
- ServerRSocketFactory process(ServerRSocketFactory factory);
+ io.rsocket.RSocketFactory.ServerRSocketFactory process(io.rsocket.RSocketFactory.ServerRSocketFactory factory);
}
diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializerBeans.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializerBeans.java
index 488545a631..bd0cc2645e 100644
--- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializerBeans.java
+++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializerBeans.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2019 the original author or authors.
+ * Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -77,6 +77,7 @@ public class ServletContextInitializerBeans extends AbstractCollection sortedList;
@SafeVarargs
+ @SuppressWarnings("varargs")
public ServletContextInitializerBeans(ListableBeanFactory beanFactory,
Class extends ServletContextInitializer>... initializerTypes) {
this.initializers = new LinkedMultiValueMap<>();
diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java
index 54da50ac43..3ebdac2118 100644
--- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java
+++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java
@@ -257,7 +257,7 @@ class ConfigurationPropertiesTests {
AnnotationConfigApplicationContext parent = load(BasicConfiguration.class, "name=parent");
this.context = new AnnotationConfigApplicationContext();
this.context.setParent(parent);
- load(new Class[] { BasicConfiguration.class, BasicPropertiesConsumer.class }, "name=child");
+ load(new Class>[] { BasicConfiguration.class, BasicPropertiesConsumer.class }, "name=child");
assertThat(this.context.getBean(BasicProperties.class)).isNotNull();
assertThat(parent.getBean(BasicProperties.class)).isNotNull();
assertThat(this.context.getBean(BasicPropertiesConsumer.class).getName()).isEqualTo("parent");
diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/atomikos/AtomikosPropertiesTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/atomikos/AtomikosPropertiesTests.java
index 18af471585..830d25d570 100644
--- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/atomikos/AtomikosPropertiesTests.java
+++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/atomikos/AtomikosPropertiesTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2019 the original author or authors.
+ * Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -97,7 +97,7 @@ class AtomikosPropertiesTests {
}
private MapEntry, ?>[] defaultOf(Properties defaultSettings, String... keys) {
- MapEntry, ?>[] entries = new MapEntry[keys.length];
+ MapEntry, ?>[] entries = new MapEntry, ?>[keys.length];
for (int i = 0; i < keys.length; i++) {
String key = keys[i];
entries[i] = entry(key, defaultSettings.get(key));
diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactoryTests.java
index 1ec436f57d..d073e0f78a 100644
--- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactoryTests.java
+++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactoryTests.java
@@ -25,7 +25,6 @@ import io.netty.buffer.PooledByteBufAllocator;
import io.rsocket.ConnectionSetupPayload;
import io.rsocket.Payload;
import io.rsocket.RSocket;
-import io.rsocket.RSocketFactory;
import io.rsocket.SocketAcceptor;
import io.rsocket.transport.netty.client.WebsocketClientTransport;
import io.rsocket.util.DefaultPayload;
@@ -37,7 +36,6 @@ import reactor.core.publisher.Mono;
import org.springframework.boot.rsocket.server.RSocketServer;
import org.springframework.boot.rsocket.server.RSocketServerCustomizer;
-import org.springframework.boot.rsocket.server.ServerRSocketFactoryProcessor;
import org.springframework.core.codec.CharSequenceEncoder;
import org.springframework.core.codec.StringDecoder;
import org.springframework.core.io.buffer.NettyDataBufferFactory;
@@ -131,20 +129,20 @@ class NettyRSocketServerFactoryTests {
}
@Test
- @SuppressWarnings("deprecation")
+ @Deprecated
void serverProcessors() {
NettyRSocketServerFactory factory = getFactory();
- ServerRSocketFactoryProcessor[] processors = new ServerRSocketFactoryProcessor[2];
+ org.springframework.boot.rsocket.server.ServerRSocketFactoryProcessor[] processors = new org.springframework.boot.rsocket.server.ServerRSocketFactoryProcessor[2];
for (int i = 0; i < processors.length; i++) {
- processors[i] = mock(ServerRSocketFactoryProcessor.class);
- given(processors[i].process(any(RSocketFactory.ServerRSocketFactory.class)))
+ processors[i] = mock(org.springframework.boot.rsocket.server.ServerRSocketFactoryProcessor.class);
+ given(processors[i].process(any(io.rsocket.RSocketFactory.ServerRSocketFactory.class)))
.will((invocation) -> invocation.getArgument(0));
}
factory.setSocketFactoryProcessors(Arrays.asList(processors));
this.server = factory.create(new EchoRequestResponseAcceptor());
InOrder ordered = inOrder((Object[]) processors);
- for (ServerRSocketFactoryProcessor processor : processors) {
- ordered.verify(processor).process(any(RSocketFactory.ServerRSocketFactory.class));
+ for (org.springframework.boot.rsocket.server.ServerRSocketFactoryProcessor processor : processors) {
+ ordered.verify(processor).process(any(io.rsocket.RSocketFactory.ServerRSocketFactory.class));
}
}
@@ -200,6 +198,7 @@ class NettyRSocketServerFactoryTests {
static class EchoRequestResponseAcceptor implements SocketAcceptor {
@Override
+ @SuppressWarnings("deprecation")
public Mono accept(ConnectionSetupPayload setupPayload, RSocket rSocket) {
return Mono.just(new RSocket() {
@Override