Explicit type can be replaced by <>

Issue: SPR-13188
This commit is contained in:
Stephane Nicoll
2016-07-05 17:00:26 +02:00
parent 3096888c7d
commit 00d2606b00
1044 changed files with 3972 additions and 3893 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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.
@@ -54,7 +54,7 @@ public abstract class AbstractJCacheTests {
protected static CacheManager createSimpleCacheManager(String... cacheNames) {
SimpleCacheManager result = new SimpleCacheManager();
List<Cache> caches = new ArrayList<Cache>();
List<Cache> caches = new ArrayList<>();
for (String cacheName : cacheNames) {
caches.add(new ConcurrentMapCache(cacheName));
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -87,7 +87,7 @@ public class JCacheCacheManagerTests extends AbstractTransactionSupportingCacheM
private final CacheManager cacheManager;
private CacheManagerMock() {
this.cacheNames = new ArrayList<String>();
this.cacheNames = new ArrayList<>();
this.cacheManager = mock(CacheManager.class);
given(cacheManager.getCacheNames()).willReturn(cacheNames);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -93,7 +93,7 @@ public class JCacheEhCacheAnnotationTests extends AbstractCacheAnnotationTests {
@Bean
public CacheManager jCacheManager() {
CacheManager cacheManager = this.cachingProvider.getCacheManager();
MutableConfiguration<Object, Object> mutableConfiguration = new MutableConfiguration<Object, Object>();
MutableConfiguration<Object, Object> mutableConfiguration = new MutableConfiguration<>();
mutableConfiguration.setStoreByValue(false); // otherwise value has to be Serializable
cacheManager.createCache("testCache", mutableConfiguration);
cacheManager.createCache("primary", mutableConfiguration);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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.
@@ -65,7 +65,7 @@ public abstract class AbstractCacheOperationTests<O extends JCacheOperation<?>>
Method method = ReflectionUtils.findMethod(targetType, methodName, parameterTypes);
Assert.notNull(method, "requested method '" + methodName + "'does not exist");
A cacheAnnotation = method.getAnnotation(annotationType);
return new DefaultCacheMethodDetails<A>(method, cacheAnnotation, getCacheName(cacheAnnotation));
return new DefaultCacheMethodDetails<>(method, cacheAnnotation, getCacheName(cacheAnnotation));
}
private static String getCacheName(Annotation annotation) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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.
@@ -86,7 +86,7 @@ public class CacheResolverAdapterTests extends AbstractJCacheTests {
new DefaultCacheMethodDetails<>(method, cacheAnnotation, "test");
CacheResultOperation operation = new CacheResultOperation(methodDetails,
defaultCacheResolver, defaultKeyGenerator, defaultExceptionCacheResolver);
return new DefaultCacheInvocationContext<CacheResult>(operation, new Sample(), new Object[] {"id"});
return new DefaultCacheInvocationContext<>(operation, new Sample(), new Object[] {"id"});
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -180,7 +180,7 @@ public class JavaMailSenderTests {
sender.setUsername("username");
sender.setPassword("password");
final List<Message> messages = new ArrayList<Message>();
final List<Message> messages = new ArrayList<>();
MimeMessagePreparator preparator = new MimeMessagePreparator() {
@Override
@@ -206,7 +206,7 @@ public class JavaMailSenderTests {
sender.setUsername("username");
sender.setPassword("password");
final List<Message> messages = new ArrayList<Message>();
final List<Message> messages = new ArrayList<>();
MimeMessagePreparator preparator1 = new MimeMessagePreparator() {
@Override
@@ -533,7 +533,7 @@ public class JavaMailSenderTests {
private String connectedUsername = null;
private String connectedPassword = null;
private boolean closeCalled = false;
private List<Message> sentMessages = new ArrayList<Message>();
private List<Message> sentMessages = new ArrayList<>();
private MockTransport(Session session, URLName urlName) {
super(session, urlName);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -71,7 +71,7 @@ public class QuartzSupportTests {
}
};
schedulerFactoryBean.setJobFactory(null);
Map<String, Object> schedulerContextMap = new HashMap<String, Object>();
Map<String, Object> schedulerContextMap = new HashMap<>();
schedulerContextMap.put("testBean", tb);
schedulerFactoryBean.setSchedulerContextAsMap(schedulerContextMap);
schedulerFactoryBean.setApplicationContext(ac);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -85,7 +85,7 @@ public class JasperReportsUtilsTests {
@Test
public void renderAsCsvWithExporterParameters() throws Exception {
StringWriter writer = new StringWriter();
Map<JRExporterParameter, Object> exporterParameters = new HashMap<JRExporterParameter, Object>();
Map<JRExporterParameter, Object> exporterParameters = new HashMap<>();
exporterParameters.put(JRCsvExporterParameter.FIELD_DELIMITER, "~");
JasperReportsUtils.renderAsCsv(getReport(), getParameters(), getData(), writer, exporterParameters);
String output = writer.getBuffer().toString();
@@ -112,7 +112,7 @@ public class JasperReportsUtilsTests {
@Test
public void renderAsHtmlWithExporterParameters() throws Exception {
StringWriter writer = new StringWriter();
Map<JRExporterParameter, Object> exporterParameters = new HashMap<JRExporterParameter, Object>();
Map<JRExporterParameter, Object> exporterParameters = new HashMap<>();
String uri = "/my/uri";
exporterParameters.put(JRHtmlExporterParameter.IMAGES_URI, uri);
JasperReportsUtils.renderAsHtml(getReport(), getParameters(), getData(), writer, exporterParameters);
@@ -140,7 +140,7 @@ public class JasperReportsUtilsTests {
@Test
public void renderAsPdfWithExporterParameters() throws Exception {
ByteArrayOutputStream os = new ByteArrayOutputStream();
Map<JRExporterParameter, Object> exporterParameters = new HashMap<JRExporterParameter, Object>();
Map<JRExporterParameter, Object> exporterParameters = new HashMap<>();
exporterParameters.put(JRPdfExporterParameter.PDF_VERSION, JRPdfExporterParameter.PDF_VERSION_1_6.toString());
JasperReportsUtils.renderAsPdf(getReport(), getParameters(), getData(), os, exporterParameters);
byte[] output = os.toByteArray();
@@ -167,7 +167,7 @@ public class JasperReportsUtilsTests {
@Test
public void renderAsXlsWithExporterParameters() throws Exception {
ByteArrayOutputStream os = new ByteArrayOutputStream();
Map<JRExporterParameter, Object> exporterParameters = new HashMap<JRExporterParameter, Object>();
Map<JRExporterParameter, Object> exporterParameters = new HashMap<>();
SimpleProgressMonitor monitor = new SimpleProgressMonitor();
exporterParameters.put(JRXlsExporterParameter.PROGRESS_MONITOR, monitor);
@@ -232,7 +232,7 @@ public class JasperReportsUtilsTests {
}
private Map<String, Object> getParameters() {
Map<String, Object> model = new HashMap<String, Object>();
Map<String, Object> model = new HashMap<>();
model.put("ReportTitle", "Dear Lord!");
model.put(JRParameter.REPORT_LOCALE, Locale.GERMAN);
model.put(JRParameter.REPORT_RESOURCE_BUNDLE,
@@ -245,7 +245,7 @@ public class JasperReportsUtilsTests {
}
private List<PersonBean> getData() {
List<PersonBean> list = new ArrayList<PersonBean>();
List<PersonBean> list = new ArrayList<>();
for (int x = 0; x < 10; x++) {
PersonBean bean = new PersonBean();
bean.setId(x);