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-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.
@@ -88,7 +88,7 @@ public class JpaTransactionManagerTests {
public void testTransactionCommit() {
given(manager.getTransaction()).willReturn(tx);
final List<String> l = new ArrayList<String>();
final List<String> l = new ArrayList<>();
l.add("test");
assertTrue(!TransactionSynchronizationManager.hasResource(factory));
@@ -118,7 +118,7 @@ public class JpaTransactionManagerTests {
given(tx.getRollbackOnly()).willReturn(true);
willThrow(new RollbackException()).given(tx).commit();
final List<String> l = new ArrayList<String>();
final List<String> l = new ArrayList<>();
l.add("test");
assertTrue(!TransactionSynchronizationManager.hasResource(factory));
@@ -152,7 +152,7 @@ public class JpaTransactionManagerTests {
given(manager.getTransaction()).willReturn(tx);
given(tx.isActive()).willReturn(true);
final List<String> l = new ArrayList<String>();
final List<String> l = new ArrayList<>();
l.add("test");
assertTrue(!TransactionSynchronizationManager.hasResource(factory));
@@ -185,7 +185,7 @@ public class JpaTransactionManagerTests {
public void testTransactionRollbackWithAlreadyRolledBack() {
given(manager.getTransaction()).willReturn(tx);
final List<String> l = new ArrayList<String>();
final List<String> l = new ArrayList<>();
l.add("test");
assertTrue(!TransactionSynchronizationManager.hasResource(factory));
@@ -217,7 +217,7 @@ public class JpaTransactionManagerTests {
given(manager.getTransaction()).willReturn(tx);
given(tx.isActive()).willReturn(true);
final List<String> l = new ArrayList<String>();
final List<String> l = new ArrayList<>();
l.add("test");
assertTrue(!TransactionSynchronizationManager.hasResource(factory));
@@ -247,7 +247,7 @@ public class JpaTransactionManagerTests {
public void testParticipatingTransactionWithCommit() {
given(manager.getTransaction()).willReturn(tx);
final List<String> l = new ArrayList<String>();
final List<String> l = new ArrayList<>();
l.add("test");
assertTrue(!TransactionSynchronizationManager.hasResource(factory));
@@ -281,7 +281,7 @@ public class JpaTransactionManagerTests {
given(manager.getTransaction()).willReturn(tx);
given(tx.isActive()).willReturn(true);
final List<String> l = new ArrayList<String>();
final List<String> l = new ArrayList<>();
l.add("test");
assertTrue(!TransactionSynchronizationManager.hasResource(factory));
@@ -322,7 +322,7 @@ public class JpaTransactionManagerTests {
given(tx.getRollbackOnly()).willReturn(true);
willThrow(new RollbackException()).given(tx).commit();
final List<String> l = new ArrayList<String>();
final List<String> l = new ArrayList<>();
l.add("test");
assertTrue(!TransactionSynchronizationManager.hasResource(factory));
@@ -367,7 +367,7 @@ public class JpaTransactionManagerTests {
given(manager.getTransaction()).willReturn(tx);
given(manager.isOpen()).willReturn(true);
final List<String> l = new ArrayList<String>();
final List<String> l = new ArrayList<>();
l.add("test");
assertTrue(!TransactionSynchronizationManager.hasResource(factory));
@@ -402,7 +402,7 @@ public class JpaTransactionManagerTests {
given(manager.getTransaction()).willReturn(tx);
final List<String> l = new ArrayList<String>();
final List<String> l = new ArrayList<>();
l.add("test");
assertTrue(!TransactionSynchronizationManager.hasResource(factory));
@@ -447,7 +447,7 @@ public class JpaTransactionManagerTests {
given(manager.getTransaction()).willReturn(tx);
final List<String> l = new ArrayList<String>();
final List<String> l = new ArrayList<>();
l.add("test");
assertTrue(!TransactionSynchronizationManager.hasResource(factory));
@@ -486,7 +486,7 @@ public class JpaTransactionManagerTests {
given(manager.getTransaction()).willReturn(tx);
given(manager.isOpen()).willReturn(true);
final List<String> l = new ArrayList<String>();
final List<String> l = new ArrayList<>();
l.add("test");
assertTrue(!TransactionSynchronizationManager.hasResource(factory));
@@ -570,7 +570,7 @@ public class JpaTransactionManagerTests {
public void testTransactionCommitWithPropagationSupports() {
given(manager.isOpen()).willReturn(true);
final List<String> l = new ArrayList<String>();
final List<String> l = new ArrayList<>();
l.add("test");
tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_SUPPORTS);
@@ -629,7 +629,7 @@ public class JpaTransactionManagerTests {
public void testTransactionCommitWithPrebound() {
given(manager.getTransaction()).willReturn(tx);
final List<String> l = new ArrayList<String>();
final List<String> l = new ArrayList<>();
l.add("test");
assertTrue(!TransactionSynchronizationManager.hasResource(factory));
@@ -694,7 +694,7 @@ public class JpaTransactionManagerTests {
@Test
public void testTransactionCommitWithPreboundAndPropagationSupports() {
final List<String> l = new ArrayList<String>();
final List<String> l = new ArrayList<>();
l.add("test");
tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_SUPPORTS);
@@ -765,7 +765,7 @@ public class JpaTransactionManagerTests {
given(manager.getTransaction()).willReturn(tx);
final List<String> l = new ArrayList<String>();
final List<String> l = new ArrayList<>();
l.add("test");
assertTrue(!TransactionSynchronizationManager.hasResource(factory));

View File

@@ -182,7 +182,7 @@ public class PersistenceXmlParsingTests {
String resource = "/org/springframework/orm/jpa/persistence-complex.xml";
MapDataSourceLookup dataSourceLookup = new MapDataSourceLookup();
Map<String, DataSource> dataSources = new HashMap<String, DataSource>();
Map<String, DataSource> dataSources = new HashMap<>();
dataSources.put("jdbc/MyPartDB", ds);
dataSources.put("jdbc/MyDB", ds);
dataSourceLookup.setDataSources(dataSources);

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.
@@ -340,7 +340,7 @@ public class PersistenceInjectionTests extends AbstractEntityManagerFactoryBeanT
EntityManagerFactoryWithInfo mockEmf2 = mock(EntityManagerFactoryWithInfo.class);
Map<String, String> persistenceUnits = new HashMap<String, String>();
Map<String, String> persistenceUnits = new HashMap<>();
persistenceUnits.put("", "pu1");
persistenceUnits.put("Person", "pu2");
ExpectedLookupTemplate jt = new ExpectedLookupTemplate();
@@ -379,7 +379,7 @@ public class PersistenceInjectionTests extends AbstractEntityManagerFactoryBeanT
public void testPersistenceUnitsFromJndiWithDefaultUnit() {
EntityManagerFactoryWithInfo mockEmf2 = mock(EntityManagerFactoryWithInfo.class);
Map<String, String> persistenceUnits = new HashMap<String, String>();
Map<String, String> persistenceUnits = new HashMap<>();
persistenceUnits.put("System", "pu1");
persistenceUnits.put("Person", "pu2");
ExpectedLookupTemplate jt = new ExpectedLookupTemplate();
@@ -407,7 +407,7 @@ public class PersistenceInjectionTests extends AbstractEntityManagerFactoryBeanT
@Test
public void testSinglePersistenceUnitFromJndi() {
Map<String, String> persistenceUnits = new HashMap<String, String>();
Map<String, String> persistenceUnits = new HashMap<>();
persistenceUnits.put("Person", "pu1");
ExpectedLookupTemplate jt = new ExpectedLookupTemplate();
jt.addObject("java:comp/env/pu1", mockEmf);
@@ -436,10 +436,10 @@ public class PersistenceInjectionTests extends AbstractEntityManagerFactoryBeanT
EntityManager mockEm2 = mock(EntityManager.class);
EntityManager mockEm3 = mock(EntityManager.class);
Map<String, String> persistenceContexts = new HashMap<String, String>();
Map<String, String> persistenceContexts = new HashMap<>();
persistenceContexts.put("", "pc1");
persistenceContexts.put("Person", "pc2");
Map<String, String> extendedPersistenceContexts = new HashMap<String, String>();
Map<String, String> extendedPersistenceContexts = new HashMap<>();
extendedPersistenceContexts .put("", "pc3");
ExpectedLookupTemplate jt = new ExpectedLookupTemplate();
jt.addObject("java:comp/env/pc1", mockEm);
@@ -476,10 +476,10 @@ public class PersistenceInjectionTests extends AbstractEntityManagerFactoryBeanT
EntityManager mockEm2 = mock(EntityManager.class);
EntityManager mockEm3 = mock(EntityManager.class);
Map<String, String> persistenceContexts = new HashMap<String, String>();
Map<String, String> persistenceContexts = new HashMap<>();
persistenceContexts.put("System", "pc1");
persistenceContexts.put("Person", "pc2");
Map<String, String> extendedPersistenceContexts = new HashMap<String, String>();
Map<String, String> extendedPersistenceContexts = new HashMap<>();
extendedPersistenceContexts .put("System", "pc3");
ExpectedLookupTemplate jt = new ExpectedLookupTemplate();
jt.addObject("java:comp/env/pc1", mockEm);
@@ -516,9 +516,9 @@ public class PersistenceInjectionTests extends AbstractEntityManagerFactoryBeanT
EntityManager mockEm = mock(EntityManager.class);
EntityManager mockEm2 = mock(EntityManager.class);
Map<String, String> persistenceContexts = new HashMap<String, String>();
Map<String, String> persistenceContexts = new HashMap<>();
persistenceContexts.put("System", "pc1");
Map<String, String> extendedPersistenceContexts = new HashMap<String, String>();
Map<String, String> extendedPersistenceContexts = new HashMap<>();
extendedPersistenceContexts .put("System", "pc2");
ExpectedLookupTemplate jt = new ExpectedLookupTemplate();
jt.addObject("java:comp/env/pc1", mockEm);

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.
@@ -63,7 +63,7 @@ abstract class AbstractSpringContextTests extends TestCase {
protected final Log logger = LogFactory.getLog(getClass());
private static Map<String, ConfigurableApplicationContext> contextKeyToContextMap =
new HashMap<String, ConfigurableApplicationContext>();
new HashMap<>();
/**

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.
@@ -92,9 +92,9 @@ public abstract class AbstractJpaTests extends AbstractTransactionalSpringContex
* Values are intentionally not strongly typed, to avoid potential class cast exceptions
* through use between different class loaders.
*/
private static Map<String, Object> contextCache = new HashMap<String, Object>();
private static Map<String, Object> contextCache = new HashMap<>();
private static Map<String, ClassLoader> classLoaderCache = new HashMap<String, ClassLoader>();
private static Map<String, ClassLoader> classLoaderCache = new HashMap<>();
protected EntityManagerFactory entityManagerFactory;