Consistent Class array vs vararg declarations (and related polishing)

(cherry picked from commit 3b810f3)
This commit is contained in:
Juergen Hoeller
2018-02-14 14:44:00 +01:00
parent 5ba37762fe
commit 722cb36e01
40 changed files with 486 additions and 489 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2018 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.
@@ -165,7 +165,7 @@ public class PersistenceInjectionTests extends AbstractEntityManagerFactoryBeanT
@Test
public void testPublicExtendedPersistenceContextSetterWithSerialization() throws Exception {
DummyInvocationHandler ih = new DummyInvocationHandler();
Object mockEm = Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] {EntityManager.class}, ih);
Object mockEm = Proxy.newProxyInstance(getClass().getClassLoader(), new Class<?>[] {EntityManager.class}, ih);
given(mockEmf.createEntityManager()).willReturn((EntityManager) mockEm);
GenericApplicationContext gac = new GenericApplicationContext();
@@ -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);
@@ -896,4 +896,5 @@ public class PersistenceInjectionTests extends AbstractEntityManagerFactoryBeanT
throw new IllegalStateException();
}
}
}