From eb9e0d14667c5cf77e09a0c7f7c951ce48846241 Mon Sep 17 00:00:00 2001 From: Drummond Dawson Date: Tue, 9 Oct 2018 19:47:49 -0400 Subject: [PATCH] Replace explicit type with diamond operator in infrastructure tests module --- .../springframework/batch/config/MessagingTests.java | 2 +- ...atchMessageListenerContainerIntegrationTests.java | 6 +++--- .../database/JdbcPagingItemReaderAsyncTests.java | 12 ++++++------ .../database/JdbcPagingQueryIntegrationTests.java | 12 ++++++------ .../database/JdbcPagingRestartIntegrationTests.java | 6 +++--- .../item/database/JpaPagingItemReaderAsyncTests.java | 10 +++++----- .../xml/AbstractStaxEventReaderItemReaderTests.java | 6 +++--- .../xml/AbstractStaxEventWriterItemWriterTests.java | 2 +- .../item/xml/Jaxb2NamespaceMarshallingTests.java | 2 +- .../item/xml/Jaxb2NamespaceUnmarshallingTests.java | 4 ++-- .../batch/item/xml/XStreamUnmarshallingTests.java | 2 +- .../batch/jms/ExternalRetryInBatchTests.java | 6 +++--- .../batch/repeat/jms/AsynchronousTests.java | 4 ++-- .../batch/repeat/jms/SynchronousTests.java | 6 +++--- ...kExecutorRepeatTemplateBulkAsynchronousTests.java | 2 +- .../batch/retry/jms/ExternalRetryTests.java | 6 +++--- .../batch/retry/jms/SynchronousTests.java | 6 +++--- 17 files changed, 47 insertions(+), 47 deletions(-) diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/config/MessagingTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/config/MessagingTests.java index 4d4d75b21..a1523a8ef 100644 --- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/config/MessagingTests.java +++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/config/MessagingTests.java @@ -55,7 +55,7 @@ public class MessagingTests { private List getMessages() { String next = ""; - List msgs = new ArrayList(); + List msgs = new ArrayList<>(); while (next != null) { next = (String) jmsTemplate.receiveAndConvert("queue"); if (next != null) diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainerIntegrationTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainerIntegrationTests.java index d9231a44f..ff5480719 100644 --- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainerIntegrationTests.java +++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainerIntegrationTests.java @@ -62,9 +62,9 @@ public class BatchMessageListenerContainerIntegrationTests { @Autowired private BatchMessageListenerContainer container; - private volatile BlockingQueue recovered = new LinkedBlockingQueue(); + private volatile BlockingQueue recovered = new LinkedBlockingQueue<>(); - private volatile BlockingQueue processed = new LinkedBlockingQueue(); + private volatile BlockingQueue processed = new LinkedBlockingQueue<>(); @After @Before @@ -103,7 +103,7 @@ public class BatchMessageListenerContainerIntegrationTests { container.start(); jmsTemplate.convertAndSend("queue", "foo"); jmsTemplate.convertAndSend("queue", "bar"); - SortedSet result = new TreeSet(); + SortedSet result = new TreeSet<>(); for (int i = 0; i < 2; i++) { result.add(processed.poll(5, TimeUnit.SECONDS)); } diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JdbcPagingItemReaderAsyncTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JdbcPagingItemReaderAsyncTests.java index 83ec3690b..62e717fc1 100644 --- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JdbcPagingItemReaderAsyncTests.java +++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JdbcPagingItemReaderAsyncTests.java @@ -101,7 +101,7 @@ public class JdbcPagingItemReaderAsyncTests { @Test public void testAsyncReader() throws Throwable { - List throwables = new ArrayList(); + List throwables = new ArrayList<>(); int max = 10; for (int i = 0; i < max; i++) { try { @@ -124,13 +124,13 @@ public class JdbcPagingItemReaderAsyncTests { */ private void doTest() throws Exception, InterruptedException, ExecutionException { final ItemReader reader = getItemReader(); - CompletionService> completionService = new ExecutorCompletionService>(Executors + CompletionService> completionService = new ExecutorCompletionService<>(Executors .newFixedThreadPool(THREAD_COUNT)); for (int i = 0; i < THREAD_COUNT; i++) { completionService.submit(new Callable>() { @Override public List call() throws Exception { - List list = new ArrayList(); + List list = new ArrayList<>(); Foo next = null; do { next = reader.read(); @@ -145,7 +145,7 @@ public class JdbcPagingItemReaderAsyncTests { }); } int count = 0; - Set results = new HashSet(); + Set results = new HashSet<>(); for (int i = 0; i < THREAD_COUNT; i++) { List items = completionService.take().get(); count += items.size(); @@ -160,13 +160,13 @@ public class JdbcPagingItemReaderAsyncTests { protected ItemReader getItemReader() throws Exception { - JdbcPagingItemReader reader = new JdbcPagingItemReader(); + JdbcPagingItemReader reader = new JdbcPagingItemReader<>(); reader.setDataSource(dataSource); SqlPagingQueryProviderFactoryBean factory = new SqlPagingQueryProviderFactoryBean(); factory.setDataSource(dataSource); factory.setSelectClause("select ID, NAME, VALUE"); factory.setFromClause("from T_FOOS"); - Map sortKeys = new LinkedHashMap(); + Map sortKeys = new LinkedHashMap<>(); sortKeys.put("VALUE", Order.ASCENDING); factory.setSortKeys(sortKeys); reader.setQueryProvider(factory.getObject()); diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JdbcPagingQueryIntegrationTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JdbcPagingQueryIntegrationTests.java index fc158cd36..2dfcd2109 100644 --- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JdbcPagingQueryIntegrationTests.java +++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JdbcPagingQueryIntegrationTests.java @@ -125,7 +125,7 @@ public class JdbcPagingQueryIntegrationTests { @Test public void testQueryFromStartWithGroupBy() throws Exception { AbstractSqlPagingQueryProvider queryProvider = (AbstractSqlPagingQueryProvider) getPagingQueryProvider(); - Map sortKeys = new LinkedHashMap(); + Map sortKeys = new LinkedHashMap<>(); sortKeys.put("NAME", Order.ASCENDING); sortKeys.put("CODE", Order.DESCENDING); queryProvider.setSortKeys(sortKeys); @@ -162,7 +162,7 @@ public class JdbcPagingQueryIntegrationTests { private Map getStartAfterValues( PagingQueryProvider queryProvider, List> list) { - Map startAfterValues = new LinkedHashMap(); + Map startAfterValues = new LinkedHashMap<>(); for (Map.Entry sortKey : queryProvider.getSortKeys().entrySet()) { startAfterValues.put(sortKey.getKey(), list.get(list.size() - 1).get(sortKey.getKey())); } @@ -196,7 +196,7 @@ public class JdbcPagingQueryIntegrationTests { factory.setDataSource(dataSource); factory.setSelectClause("select ID, NAME, VALUE"); factory.setFromClause("from T_FOOS"); - Map sortKeys = new LinkedHashMap(); + Map sortKeys = new LinkedHashMap<>(); sortKeys.put("VALUE", Order.ASCENDING); factory.setSortKeys(sortKeys); return factory.getObject(); @@ -204,14 +204,14 @@ public class JdbcPagingQueryIntegrationTests { } private List getParameterList(Map values, Map sortKeyValue) { - SortedMap sm = new TreeMap(); + SortedMap sm = new TreeMap<>(); if (values != null) { sm.putAll(values); } - List parameterList = new ArrayList(); + List parameterList = new ArrayList<>(); parameterList.addAll(sm.values()); if (sortKeyValue != null && sortKeyValue.size() > 0) { - List> keys = new ArrayList>(sortKeyValue.entrySet()); + List> keys = new ArrayList<>(sortKeyValue.entrySet()); for(int i = 0; i < keys.size(); i++) { for(int j = 0; j < i; j++) { diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JdbcPagingRestartIntegrationTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JdbcPagingRestartIntegrationTests.java index a594aa12d..61e6c25c0 100644 --- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JdbcPagingRestartIntegrationTests.java +++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JdbcPagingRestartIntegrationTests.java @@ -131,7 +131,7 @@ public class JdbcPagingRestartIntegrationTests { logger.debug("Ids: "+ids); int startAfterValue = (new Long(ids.get(count - 1).get("ID").toString())).intValue(); logger.debug("Start after: " + startAfterValue); - Map startAfterValues = new LinkedHashMap(); + Map startAfterValues = new LinkedHashMap<>(); startAfterValues.put("ID", startAfterValue); executionContext.put("JdbcPagingItemReader.start.after", startAfterValues); ((ItemStream) reader).open(executionContext); @@ -150,13 +150,13 @@ public class JdbcPagingRestartIntegrationTests { protected ItemReader getItemReader() throws Exception { - JdbcPagingItemReader reader = new JdbcPagingItemReader(); + JdbcPagingItemReader reader = new JdbcPagingItemReader<>(); reader.setDataSource(dataSource); SqlPagingQueryProviderFactoryBean factory = new SqlPagingQueryProviderFactoryBean(); factory.setDataSource(dataSource); factory.setSelectClause("select ID, NAME, VALUE"); factory.setFromClause("from T_FOOS"); - Map sortKeys = new LinkedHashMap(); + Map sortKeys = new LinkedHashMap<>(); sortKeys.put("VALUE", Order.ASCENDING); factory.setSortKeys(sortKeys); reader.setQueryProvider(factory.getObject()); diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderAsyncTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderAsyncTests.java index b700fcb52..31a3d38dd 100644 --- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderAsyncTests.java +++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/database/JpaPagingItemReaderAsyncTests.java @@ -89,7 +89,7 @@ public class JpaPagingItemReaderAsyncTests { @Test public void testAsyncReader() throws Throwable { - List throwables = new ArrayList(); + List throwables = new ArrayList<>(); int max = 10; for (int i = 0; i < max; i++) { try { @@ -112,13 +112,13 @@ public class JpaPagingItemReaderAsyncTests { */ private void doTest() throws Exception, InterruptedException, ExecutionException { final JpaPagingItemReader reader = getItemReader(); - CompletionService> completionService = new ExecutorCompletionService>(Executors + CompletionService> completionService = new ExecutorCompletionService<>(Executors .newFixedThreadPool(THREAD_COUNT)); for (int i = 0; i < THREAD_COUNT; i++) { completionService.submit(new Callable>() { @Override public List call() throws Exception { - List list = new ArrayList(); + List list = new ArrayList<>(); Foo next = null; do { next = reader.read(); @@ -133,7 +133,7 @@ public class JpaPagingItemReaderAsyncTests { }); } int count = 0; - Set results = new HashSet(); + Set results = new HashSet<>(); for (int i = 0; i < THREAD_COUNT; i++) { List items = completionService.take().get(); count += items.size(); @@ -151,7 +151,7 @@ public class JpaPagingItemReaderAsyncTests { String jpqlQuery = "select f from Foo f"; - JpaPagingItemReader reader = new JpaPagingItemReader(); + JpaPagingItemReader reader = new JpaPagingItemReader<>(); reader.setQueryString(jpqlQuery); reader.setEntityManagerFactory(entityManagerFactory); reader.setPageSize(PAGE_SIZE); diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/AbstractStaxEventReaderItemReaderTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/AbstractStaxEventReaderItemReaderTests.java index a2cc41c5a..95f5d4678 100644 --- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/AbstractStaxEventReaderItemReaderTests.java +++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/AbstractStaxEventReaderItemReaderTests.java @@ -32,7 +32,7 @@ import org.springframework.util.ClassUtils; public abstract class AbstractStaxEventReaderItemReaderTests { - protected StaxEventItemReader reader = new StaxEventItemReader(); + protected StaxEventItemReader reader = new StaxEventItemReader<>(); @Before public void setUp() throws Exception { @@ -46,7 +46,7 @@ public abstract class AbstractStaxEventReaderItemReaderTests { reader.setResource(new ClassPathResource(ClassUtils.addResourcePathToPackagePath(getClass(), "input.xml"))); reader.open(new ExecutionContext()); Trade result; - List results = new ArrayList(); + List results = new ArrayList<>(); while ((result = reader.read()) != null) { results.add(result); } @@ -59,7 +59,7 @@ public abstract class AbstractStaxEventReaderItemReaderTests { .addResourcePathToPackagePath(getClass(), "input-nested.xml"))); reader.open(new ExecutionContext()); Trade result; - List results = new ArrayList(); + List results = new ArrayList<>(); while ((result = reader.read()) != null) { results.add(result); } diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/AbstractStaxEventWriterItemWriterTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/AbstractStaxEventWriterItemWriterTests.java index 4013ba44a..fff267e4b 100644 --- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/AbstractStaxEventWriterItemWriterTests.java +++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/AbstractStaxEventWriterItemWriterTests.java @@ -49,7 +49,7 @@ public abstract class AbstractStaxEventWriterItemWriterTests { private static final int MAX_WRITE = 100; - protected StaxEventItemWriter writer = new StaxEventItemWriter(); + protected StaxEventItemWriter writer = new StaxEventItemWriter<>(); private Resource resource; diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/Jaxb2NamespaceMarshallingTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/Jaxb2NamespaceMarshallingTests.java index 271866e47..8b7d70fde 100644 --- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/Jaxb2NamespaceMarshallingTests.java +++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/Jaxb2NamespaceMarshallingTests.java @@ -53,7 +53,7 @@ public class Jaxb2NamespaceMarshallingTests { private static final int MAX_WRITE = 100; - private StaxEventItemWriter writer = new StaxEventItemWriter(); + private StaxEventItemWriter writer = new StaxEventItemWriter<>(); private Resource resource; diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/Jaxb2NamespaceUnmarshallingTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/Jaxb2NamespaceUnmarshallingTests.java index 4f7a68acb..3963a2e26 100644 --- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/Jaxb2NamespaceUnmarshallingTests.java +++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/Jaxb2NamespaceUnmarshallingTests.java @@ -39,7 +39,7 @@ import org.springframework.util.ClassUtils; public class Jaxb2NamespaceUnmarshallingTests { - private StaxEventItemReader reader = new StaxEventItemReader(); + private StaxEventItemReader reader = new StaxEventItemReader<>(); private Resource resource = new ClassPathResource(ClassUtils.addResourcePathToPackagePath(getClass(), "domain/trades.xml")); @@ -66,7 +66,7 @@ public class Jaxb2NamespaceUnmarshallingTests { @Test public void testRead() throws Exception { QualifiedTrade result; - List results = new ArrayList(); + List results = new ArrayList<>(); while ((result = reader.read()) != null) { results.add(result); } diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/XStreamUnmarshallingTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/XStreamUnmarshallingTests.java index 9e311d7a6..da28c865d 100644 --- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/XStreamUnmarshallingTests.java +++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/item/xml/XStreamUnmarshallingTests.java @@ -28,7 +28,7 @@ public class XStreamUnmarshallingTests extends AbstractStaxEventReaderItemReader @Override protected Unmarshaller getUnmarshaller() throws Exception { XStreamMarshaller unmarshaller = new XStreamMarshaller(); - Map> aliasesMap = new HashMap>(); + Map> aliasesMap = new HashMap<>(); aliasesMap.put("trade", Trade.class); aliasesMap.put("isin", String.class); aliasesMap.put("customer", String.class); diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/jms/ExternalRetryInBatchTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/jms/ExternalRetryInBatchTests.java index 9dcf21422..2c8017945 100644 --- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/jms/ExternalRetryInBatchTests.java +++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/jms/ExternalRetryInBatchTests.java @@ -102,9 +102,9 @@ public class ExternalRetryInBatchTests { assertEquals(0, count); } - private List list = new ArrayList(); + private List list = new ArrayList<>(); - private List recovered = new ArrayList(); + private List recovered = new ArrayList<>(); @Test public void testExternalRetryRecoveryInBatch() throws Exception { @@ -204,7 +204,7 @@ public class ExternalRetryInBatchTests { private List getMessages() { String next = ""; - List msgs = new ArrayList(); + List msgs = new ArrayList<>(); while (next != null) { next = (String) jmsTemplate.receiveAndConvert("queue"); if (next != null) diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/repeat/jms/AsynchronousTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/repeat/jms/AsynchronousTests.java index 0a192cd7d..44b07873e 100644 --- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/repeat/jms/AsynchronousTests.java +++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/repeat/jms/AsynchronousTests.java @@ -99,7 +99,7 @@ public class AsynchronousTests { } } - private volatile List list = new ArrayList(); + private volatile List list = new ArrayList<>(); private void assertInitialState() { int count = jdbcTemplate.queryForObject("select count(*) from T_BARS", Integer.class); @@ -175,7 +175,7 @@ public class AsynchronousTests { assertTrue(list.size() >= 1); String text = ""; - List msgs = new ArrayList(); + List msgs = new ArrayList<>(); while (text != null) { text = (String) jmsTemplate.receiveAndConvert("queue"); msgs.add(text); diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/repeat/jms/SynchronousTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/repeat/jms/SynchronousTests.java index e9d96540a..932efb841 100644 --- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/repeat/jms/SynchronousTests.java +++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/repeat/jms/SynchronousTests.java @@ -69,7 +69,7 @@ public class SynchronousTests implements ApplicationContextAware { private ApplicationContext applicationContext; - private List list = new ArrayList(); + private List list = new ArrayList<>(); @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { @@ -152,7 +152,7 @@ public class SynchronousTests implements ApplicationContextAware { }); String text = ""; - List msgs = new ArrayList(); + List msgs = new ArrayList<>(); while (text != null) { text = (String) jmsTemplate.receiveAndConvert("queue"); msgs.add(text); @@ -219,7 +219,7 @@ public class SynchronousTests implements ApplicationContextAware { }); String text = ""; - List msgs = new ArrayList(); + List msgs = new ArrayList<>(); while (text != null) { text = (String) txJmsTemplate.receiveAndConvert("queue"); msgs.add(text); diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplateBulkAsynchronousTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplateBulkAsynchronousTests.java index 7c243d455..0971b4bc9 100644 --- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplateBulkAsynchronousTests.java +++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/repeat/support/TaskExecutorRepeatTemplateBulkAsynchronousTests.java @@ -82,7 +82,7 @@ public class TaskExecutorRepeatTemplateBulkAsynchronousTests { template.setTaskExecutor(taskExecutor); template.setThrottleLimit(throttleLimit); - items = Collections.synchronizedList(new ArrayList()); + items = Collections.synchronizedList(new ArrayList<>()); callback = new RepeatCallback() { diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/ExternalRetryTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/ExternalRetryTests.java index ae98493d0..c22c8db70 100644 --- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/ExternalRetryTests.java +++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/ExternalRetryTests.java @@ -86,9 +86,9 @@ public class ExternalRetryTests { assertEquals(0, count); } - private List list = new ArrayList(); + private List list = new ArrayList<>(); - private List recovered = new ArrayList(); + private List recovered = new ArrayList<>(); /* * Message processing is successful on the second attempt but must receive @@ -248,7 +248,7 @@ public class ExternalRetryTests { private List getMessages() { String next = ""; - List msgs = new ArrayList(); + List msgs = new ArrayList<>(); while (next != null) { next = (String) jmsTemplate.receiveAndConvert("queue"); if (next != null) diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/SynchronousTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/SynchronousTests.java index da69b798e..bdb848d86 100644 --- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/SynchronousTests.java +++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/SynchronousTests.java @@ -101,7 +101,7 @@ public class SynchronousTests { assertEquals(0, count); } - List list = new ArrayList(); + List list = new ArrayList<>(); /* * Message processing is successful on the second attempt without having to @@ -168,7 +168,7 @@ public class SynchronousTests { assertInitialState(); - JmsItemReader provider = new JmsItemReader(); + JmsItemReader provider = new JmsItemReader<>(); // provider.setItemType(Message.class); jmsTemplate.setDefaultDestinationName("queue"); provider.setJmsTemplate(jmsTemplate); @@ -396,7 +396,7 @@ public class SynchronousTests { private List getMessages() { String next = ""; - List msgs = new ArrayList(); + List msgs = new ArrayList<>(); while (next != null) { next = (String) jmsTemplate.receiveAndConvert("queue"); if (next != null)