Replace explicit generics with diamond operator

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

See gh-9781
This commit is contained in:
Emanuel Campolo
2017-07-18 11:50:10 -03:00
committed by Phillip Webb
parent eb35fc9fa6
commit 04fdec6f8b
44 changed files with 64 additions and 68 deletions

View File

@@ -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)) {

View File

@@ -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");

View File

@@ -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);
}