Merge pull request #854 from 0xbaadf00d/feature/explicit-type-to-diamond

Replace explicit type with <>
This commit is contained in:
Rob Bygrave
2016-11-06 22:54:24 +13:00
committed by GitHub
291 changed files with 743 additions and 743 deletions
@@ -18,7 +18,7 @@ public class EbeanServer_deleteAllByIdTest {
List<EBasicVer> someBeans = beans(3);
Ebean.saveAll(someBeans);
List<Integer> ids = new ArrayList<Integer>();
List<Integer> ids = new ArrayList<>();
for (EBasicVer someBean : someBeans) {
ids.add(someBean.getId());
}
@@ -38,7 +38,7 @@ public class EbeanServer_deleteAllByIdTest {
List<EBasicVer> someBeans = beans(3);
Ebean.saveAll(someBeans);
List<Integer> ids = new ArrayList<Integer>();
List<Integer> ids = new ArrayList<>();
for (EBasicVer someBean : someBeans) {
ids.add(someBean.getId());
}
@@ -64,7 +64,7 @@ public class EbeanServer_deleteAllByIdTest {
List<EBasicVer> someBeans = beans(3);
Ebean.saveAll(someBeans);
List<Integer> ids = new ArrayList<Integer>();
List<Integer> ids = new ArrayList<>();
for (EBasicVer someBean : someBeans) {
ids.add(someBean.getId());
}
@@ -85,7 +85,7 @@ public class EbeanServer_deleteAllByIdTest {
List<EBasicVer> someBeans = beans(3);
Ebean.saveAll(someBeans);
List<Integer> ids = new ArrayList<Integer>();
List<Integer> ids = new ArrayList<>();
for (EBasicVer someBean : someBeans) {
ids.add(someBean.getId());
}
@@ -106,7 +106,7 @@ public class EbeanServer_deleteAllByIdTest {
}
private List<EBasicVer> beans(int count) {
List<EBasicVer> beans = new ArrayList<EBasicVer>();
List<EBasicVer> beans = new ArrayList<>();
for (int i = 0; i < count; i++) {
beans.add(bean("foo" + i));
}
@@ -52,7 +52,7 @@ public class EbeanServer_refresh {
Order order = Ebean.find(Order.class, 1);
order.getCustomer().getName();
order.setDetails(new ArrayList<OrderDetail>());
order.setDetails(new ArrayList<>());
Ebean.refresh(order);
}
@@ -115,7 +115,7 @@ public class EbeanServer_saveAllTest extends BaseTestCase {
private List<EBasicVer> beans(int count) {
List<EBasicVer> beans = new ArrayList<EBasicVer>();
List<EBasicVer> beans = new ArrayList<>();
for (int i = 0; i <count; i++) {
beans.add(bean("foo"+i));
}
@@ -38,7 +38,7 @@ public class TestPropertyChangeListener extends BaseTestCase {
class Listener implements PropertyChangeListener {
List<PropertyChangeEvent> events = new ArrayList<PropertyChangeEvent>();
List<PropertyChangeEvent> events = new ArrayList<>();
@Override
public void propertyChange(PropertyChangeEvent evt) {
@@ -26,7 +26,7 @@ public class EntityBeanInterceptTest extends BaseTestCase {
List<Customer> list = Ebean.find(Customer.class).findList();
Set<String> propertyNames = new HashSet<String>();
Set<String> propertyNames = new HashSet<>();
propertyNames.add("name");
propertyNames.add("status");
@@ -18,7 +18,7 @@ public class BeanListTest {
@NotNull
private List<Object> all() {
List<Object> all = new ArrayList<Object>();
List<Object> all = new ArrayList<>();
all.add(object1);
all.add(object2);
all.add(object3);
@@ -27,7 +27,7 @@ public class BeanListTest {
@NotNull
private List<Object> some() {
List<Object> some = new ArrayList<Object>();
List<Object> some = new ArrayList<>();
some.add(object2);
some.add(object3);
return some;
@@ -36,7 +36,7 @@ public class BeanListTest {
@Test
public void testAdd() throws Exception {
BeanList<Object> list = new BeanList<Object>();
BeanList<Object> list = new BeanList<>();
list.setModifyListening(BeanCollection.ModifyListenMode.ALL);
list.add(object1);
@@ -57,7 +57,7 @@ public class BeanListTest {
@Test
public void testAddAll_given_emptyStart() throws Exception {
BeanList<Object> list = new BeanList<Object>();
BeanList<Object> list = new BeanList<>();
list.setModifyListening(BeanCollection.ModifyListenMode.ALL);
// act
@@ -70,7 +70,7 @@ public class BeanListTest {
@Test
public void testAdd_given_someAlreadyIn() throws Exception {
BeanList<Object> list = new BeanList<Object>(some());
BeanList<Object> list = new BeanList<>(some());
list.setModifyListening(BeanCollection.ModifyListenMode.ALL);
// act
@@ -86,7 +86,7 @@ public class BeanListTest {
@Test
public void testAddSome_given_someAlreadyIn() throws Exception {
BeanList<Object> list = new BeanList<Object>(some());
BeanList<Object> list = new BeanList<>(some());
list.setModifyListening(BeanCollection.ModifyListenMode.ALL);
// act
@@ -99,7 +99,7 @@ public class BeanListTest {
@Test
public void testRemove_given_beansInAdditions() throws Exception {
BeanList<Object> list = new BeanList<Object>();
BeanList<Object> list = new BeanList<>();
list.setModifyListening(BeanCollection.ModifyListenMode.ALL);
list.addAll(all());
assertThat(list.getModifyAdditions()).containsExactly(object1, object2, object3);
@@ -115,7 +115,7 @@ public class BeanListTest {
@Test
public void testRemoveAll_given_beansInAdditions() throws Exception {
BeanList<Object> list = new BeanList<Object>();
BeanList<Object> list = new BeanList<>();
list.setModifyListening(BeanCollection.ModifyListenMode.ALL);
list.addAll(all());
assertThat(list.getModifyAdditions()).containsExactly(object1, object2, object3);
@@ -130,7 +130,7 @@ public class BeanListTest {
@Test
public void testRemove_given_beansNotInAdditions() throws Exception {
BeanList<Object> list = new BeanList<Object>(all());
BeanList<Object> list = new BeanList<>(all());
list.setModifyListening(BeanCollection.ModifyListenMode.ALL);
// act
@@ -145,7 +145,7 @@ public class BeanListTest {
@Test
public void testRemoveAll_given_beansNotInAdditions() throws Exception {
BeanList<Object> list = new BeanList<Object>(all());
BeanList<Object> list = new BeanList<>(all());
list.setModifyListening(BeanCollection.ModifyListenMode.ALL);
// act
@@ -159,7 +159,7 @@ public class BeanListTest {
@Test
public void testClear() throws Exception {
BeanList<Object> list = new BeanList<Object>(all());
BeanList<Object> list = new BeanList<>(all());
list.setModifyListening(BeanCollection.ModifyListenMode.ALL);
// act
@@ -173,7 +173,7 @@ public class BeanListTest {
@Test
public void testClear_given_someBeansInAdditions() throws Exception {
BeanList<Object> list = new BeanList<Object>();
BeanList<Object> list = new BeanList<>();
list.add(object1);
list.setModifyListening(BeanCollection.ModifyListenMode.ALL);
list.add(object2);
@@ -190,7 +190,7 @@ public class BeanListTest {
@Test
public void testRetainAll_given_beansInAdditions() throws Exception {
BeanList<Object> list = new BeanList<Object>();
BeanList<Object> list = new BeanList<>();
list.setModifyListening(BeanCollection.ModifyListenMode.ALL);
list.addAll(all());
assertThat(list.getModifyAdditions()).containsExactly(object1, object2, object3);
@@ -205,7 +205,7 @@ public class BeanListTest {
@Test
public void testRetainAll_given_someBeansInAdditions() throws Exception {
BeanList<Object> list = new BeanList<Object>();
BeanList<Object> list = new BeanList<>();
list.add(object1);
list.add(object2);
list.setModifyListening(BeanCollection.ModifyListenMode.ALL);
@@ -221,7 +221,7 @@ public class BeanListTest {
@Test
public void testRetainAll_given_noBeansInAdditions() throws Exception {
BeanList<Object> list = new BeanList<Object>(all());
BeanList<Object> list = new BeanList<>(all());
list.setModifyListening(BeanCollection.ModifyListenMode.ALL);
// act
@@ -18,7 +18,7 @@ public class BeanMapTest {
@NotNull
private Map<String, Object> all() {
Map<String, Object> all = new LinkedHashMap<String, Object>();
Map<String, Object> all = new LinkedHashMap<>();
all.put("1", object1);
all.put("2", object2);
all.put("3", object3);
@@ -27,7 +27,7 @@ public class BeanMapTest {
@NotNull
private Map<String, Object> some() {
Map<String, Object> all = new LinkedHashMap<String, Object>();
Map<String, Object> all = new LinkedHashMap<>();
all.put("2", object2);
all.put("3", object3);
return all;
@@ -36,7 +36,7 @@ public class BeanMapTest {
@Test
public void testAdd() throws Exception {
BeanMap<String,Object> map = new BeanMap<String,Object>();
BeanMap<String,Object> map = new BeanMap<>();
map.setModifyListening(BeanCollection.ModifyListenMode.ALL);
map.put("1", object1);
map.put("4", null);
@@ -59,7 +59,7 @@ public class BeanMapTest {
@Test
public void testAddAll_given_emptyStart() throws Exception {
BeanMap<String,Object> set = new BeanMap<String,Object>();
BeanMap<String,Object> set = new BeanMap<>();
set.setModifyListening(BeanCollection.ModifyListenMode.ALL);
// act
@@ -72,7 +72,7 @@ public class BeanMapTest {
@Test
public void testAdd_given_someAlreadyIn() throws Exception {
BeanMap<String,Object> map = new BeanMap<String,Object>(some());
BeanMap<String,Object> map = new BeanMap<>(some());
map.setModifyListening(BeanCollection.ModifyListenMode.ALL);
// act
@@ -88,7 +88,7 @@ public class BeanMapTest {
@Test
public void testAddSome_given_someAlreadyIn() throws Exception {
BeanMap<String,Object> map = new BeanMap<String,Object>(some());
BeanMap<String,Object> map = new BeanMap<>(some());
map.setModifyListening(BeanCollection.ModifyListenMode.ALL);
// act
@@ -101,7 +101,7 @@ public class BeanMapTest {
@Test
public void testRemove_given_beansInAdditions() throws Exception {
BeanMap<String,Object> map = new BeanMap<String,Object>();
BeanMap<String,Object> map = new BeanMap<>();
map.setModifyListening(BeanCollection.ModifyListenMode.ALL);
map.putAll(all());
assertThat(map.getModifyAdditions()).containsExactly(object1, object2, object3);
@@ -117,7 +117,7 @@ public class BeanMapTest {
@Test
public void testRemoveAll_given_beansInAdditions() throws Exception {
BeanMap<String,Object> map = new BeanMap<String,Object>();
BeanMap<String,Object> map = new BeanMap<>();
map.setModifyListening(BeanCollection.ModifyListenMode.ALL);
map.putAll(all());
assertThat(map.getModifyAdditions()).containsExactly(object1, object2, object3);
@@ -133,7 +133,7 @@ public class BeanMapTest {
@Test
public void testRemove_given_beansNotInAdditions() throws Exception {
BeanMap<String,Object> map = new BeanMap<String,Object>(all());
BeanMap<String,Object> map = new BeanMap<>(all());
map.setModifyListening(BeanCollection.ModifyListenMode.ALL);
// act
@@ -148,7 +148,7 @@ public class BeanMapTest {
@Test
public void testRemoveAll_given_beansNotInAdditions() throws Exception {
BeanMap<String,Object> map = new BeanMap<String,Object>(all());
BeanMap<String,Object> map = new BeanMap<>(all());
map.setModifyListening(BeanCollection.ModifyListenMode.ALL);
// act
@@ -163,7 +163,7 @@ public class BeanMapTest {
@Test
public void testClear() throws Exception {
BeanMap<String,Object> map = new BeanMap<String,Object>(all());
BeanMap<String,Object> map = new BeanMap<>(all());
map.setModifyListening(BeanCollection.ModifyListenMode.ALL);
// act
@@ -177,7 +177,7 @@ public class BeanMapTest {
@Test
public void testClear_given_someBeansInAdditions() throws Exception {
BeanMap<String,Object> map = new BeanMap<String,Object>();
BeanMap<String,Object> map = new BeanMap<>();
map.put("1",object1);
map.setModifyListening(BeanCollection.ModifyListenMode.ALL);
map.put("2", object2);
@@ -18,7 +18,7 @@ public class BeanSetTest {
@NotNull
private Set<Object> all() {
Set<Object> all = new LinkedHashSet<Object>();
Set<Object> all = new LinkedHashSet<>();
all.add(object1);
all.add(object2);
all.add(object3);
@@ -27,7 +27,7 @@ public class BeanSetTest {
@NotNull
private Set<Object> some() {
Set<Object> some = new LinkedHashSet<Object>();
Set<Object> some = new LinkedHashSet<>();
some.add(object2);
some.add(object3);
return some;
@@ -36,7 +36,7 @@ public class BeanSetTest {
@Test
public void testAdd() throws Exception {
BeanSet<Object> set = new BeanSet<Object>();
BeanSet<Object> set = new BeanSet<>();
set.setModifyListening(BeanCollection.ModifyListenMode.ALL);
set.add(object1);
@@ -57,7 +57,7 @@ public class BeanSetTest {
@Test
public void testAddAll_given_emptyStart() throws Exception {
BeanSet<Object> set = new BeanSet<Object>();
BeanSet<Object> set = new BeanSet<>();
set.setModifyListening(BeanCollection.ModifyListenMode.ALL);
// act
@@ -70,7 +70,7 @@ public class BeanSetTest {
@Test
public void testAdd_given_someAlreadyIn() throws Exception {
BeanSet<Object> set = new BeanSet<Object>(some());
BeanSet<Object> set = new BeanSet<>(some());
set.setModifyListening(BeanCollection.ModifyListenMode.ALL);
// act
@@ -86,7 +86,7 @@ public class BeanSetTest {
@Test
public void testAddSome_given_someAlreadyIn() throws Exception {
BeanSet<Object> set = new BeanSet<Object>(some());
BeanSet<Object> set = new BeanSet<>(some());
set.setModifyListening(BeanCollection.ModifyListenMode.ALL);
// act
@@ -99,7 +99,7 @@ public class BeanSetTest {
@Test
public void testRemove_given_beansInAdditions() throws Exception {
BeanSet<Object> set = new BeanSet<Object>();
BeanSet<Object> set = new BeanSet<>();
set.setModifyListening(BeanCollection.ModifyListenMode.ALL);
set.addAll(all());
assertThat(set.getModifyAdditions()).containsExactly(object1, object2, object3);
@@ -115,7 +115,7 @@ public class BeanSetTest {
@Test
public void testRemoveAll_given_beansInAdditions() throws Exception {
BeanSet<Object> set = new BeanSet<Object>();
BeanSet<Object> set = new BeanSet<>();
set.setModifyListening(BeanCollection.ModifyListenMode.ALL);
set.addAll(all());
assertThat(set.getModifyAdditions()).containsExactly(object1, object2, object3);
@@ -130,7 +130,7 @@ public class BeanSetTest {
@Test
public void testRemove_given_beansNotInAdditions() throws Exception {
BeanSet<Object> set = new BeanSet<Object>(all());
BeanSet<Object> set = new BeanSet<>(all());
set.setModifyListening(BeanCollection.ModifyListenMode.ALL);
// act
@@ -145,7 +145,7 @@ public class BeanSetTest {
@Test
public void testRemoveAll_given_beansNotInAdditions() throws Exception {
BeanSet<Object> set = new BeanSet<Object>(all());
BeanSet<Object> set = new BeanSet<>(all());
set.setModifyListening(BeanCollection.ModifyListenMode.ALL);
// act
@@ -159,7 +159,7 @@ public class BeanSetTest {
@Test
public void testClear() throws Exception {
BeanSet<Object> set = new BeanSet<Object>(all());
BeanSet<Object> set = new BeanSet<>(all());
set.setModifyListening(BeanCollection.ModifyListenMode.ALL);
// act
@@ -173,7 +173,7 @@ public class BeanSetTest {
@Test
public void testClear_given_someBeansInAdditions() throws Exception {
BeanSet<Object> set = new BeanSet<Object>();
BeanSet<Object> set = new BeanSet<>();
set.add(object1);
set.setModifyListening(BeanCollection.ModifyListenMode.ALL);
set.add(object2);
@@ -190,7 +190,7 @@ public class BeanSetTest {
@Test
public void testRetainAll_given_beansInAdditions() throws Exception {
BeanSet<Object> set = new BeanSet<Object>();
BeanSet<Object> set = new BeanSet<>();
set.setModifyListening(BeanCollection.ModifyListenMode.ALL);
set.addAll(all());
assertThat(set.getModifyAdditions()).containsExactly(object1, object2, object3);
@@ -205,7 +205,7 @@ public class BeanSetTest {
@Test
public void testRetainAll_given_someBeansInAdditions() throws Exception {
BeanSet<Object> set = new BeanSet<Object>();
BeanSet<Object> set = new BeanSet<>();
set.add(object1);
set.add(object2);
set.setModifyListening(BeanCollection.ModifyListenMode.ALL);
@@ -221,7 +221,7 @@ public class BeanSetTest {
@Test
public void testRetainAll_given_noBeansInAdditions() throws Exception {
BeanSet<Object> set = new BeanSet<Object>(all());
BeanSet<Object> set = new BeanSet<>(all());
set.setModifyListening(BeanCollection.ModifyListenMode.ALL);
// act
@@ -14,7 +14,7 @@ public class MigrationVersionTest {
@Test
public void sort() {
List<MigrationVersion> list= new ArrayList<MigrationVersion>();
List<MigrationVersion> list= new ArrayList<>();
list.add(MigrationVersion.parse("1.1__point"));
list.add(MigrationVersion.parse("3.0__three"));
list.add(MigrationVersion.parse("1.0__init"));
@@ -211,7 +211,7 @@ public class PendingDropsTest {
class TDModelContainer extends ModelContainer {
List<ChangeSet> drops = new ArrayList<ChangeSet>();
List<ChangeSet> drops = new ArrayList<>();
@Override
public void registerPendingHistoryDropColumns(ChangeSet changeSet) {
@@ -106,7 +106,7 @@ public class BeanFindControllerTest extends BaseTestCase {
@Override
public <T> BeanCollection<T> findMany(BeanQueryRequest<T> request) {
BeanList<T> list = new BeanList<T>();
BeanList<T> list = new BeanList<>();
list.add((T)createBean());
return list;
}
@@ -90,7 +90,7 @@ public class BeanPersistControllerTest {
boolean continueDefaultPersisting;
List<String> methodsCalled = new ArrayList<String>();
List<String> methodsCalled = new ArrayList<>();
/**
* No default constructor so only registered manually.
@@ -69,7 +69,7 @@ public class BeanPostLoadTest extends BaseTestCase {
boolean dummy;
List<String> methodsCalled = new ArrayList<String>();
List<String> methodsCalled = new ArrayList<>();
Object bean;
@@ -29,7 +29,7 @@ public class CachedBeanDataSerializeTest extends BaseTestCase {
@Test
public void write() throws IOException, ClassNotFoundException {
Map<String, Object> map = new LinkedHashMap<String,Object>();
Map<String, Object> map = new LinkedHashMap<>();
map.put("name", "rob");
map.put("some", "thing");
map.put("whenCreated", ""+System.currentTimeMillis());
@@ -37,7 +37,7 @@ public class Helper {
@NotNull
private BeanChange createInsert(long startId) {
Map<String, ValuePair> values = new LinkedHashMap<String, ValuePair>();
Map<String, ValuePair> values = new LinkedHashMap<>();
values.put("name", new ValuePair("rob", null));
values.put("modified", new ValuePair(new Timestamp(System.currentTimeMillis()), null));
@@ -48,7 +48,7 @@ public class Helper {
@NotNull
private BeanChange createUpdate(long startId) {
Map<String, ValuePair> values = new LinkedHashMap<String, ValuePair>();
Map<String, ValuePair> values = new LinkedHashMap<>();
values.put("name", new ValuePair("jim", "steve"));
values.put("nowHasVal", new ValuePair("wasNull", null));
values.put("nowNull", new ValuePair(null, "hadVal"));
@@ -62,7 +62,7 @@ public class Helper {
@NotNull
private BeanChange createDelete(long startId) {
return new BeanChange("mytable", startId+3, ChangeType.DELETE, new HashMap<String, ValuePair>());
return new BeanChange("mytable", startId+3, ChangeType.DELETE, new HashMap<>());
}
}
@@ -29,7 +29,7 @@ public class BeanPropertyAssocManyTest extends BaseTestCase {
public void createReferenceIfNull_when_notBeanCollection_expect_null() {
Customer customer = new Customer();
customer.setContacts(new ArrayList<Contact>());
customer.setContacts(new ArrayList<>());
BeanCollection<?> ref = contacts().createReferenceIfNull((EntityBean) customer);
assertNull(ref);
@@ -52,7 +52,7 @@ public class BeanPropertyAssocManyTest extends BaseTestCase {
ResetBasicData.reset();
List<Object> customerIds = new ArrayList<Object>();
List<Object> customerIds = new ArrayList<>();
customerIds.add(1L);
customerIds.add(2L);
@@ -12,7 +12,7 @@ public class DeployPropertyParserMapTests {
public void test_like_escape() {
Map<String, String> map = new HashMap<String, String>();
Map<String, String> map = new HashMap<>();
map.put("customer.name", "t1.name");
map.put("id", "t0.id");
@@ -95,21 +95,21 @@ public class AllEqualsExpressionTest {
}
AllEqualsExpression exp(String key0, Object val1) {
LinkedHashMap<String,Object> map = new LinkedHashMap<String,Object>();
LinkedHashMap<String,Object> map = new LinkedHashMap<>();
map.put(key0, val1);
return exp(map);
}
AllEqualsExpression exp(String key0, Object val1, String key2, Object val2) {
LinkedHashMap<String,Object> map = new LinkedHashMap<String,Object>();
LinkedHashMap<String,Object> map = new LinkedHashMap<>();
map.put(key0, val1);
map.put(key2, val2);
return exp(map);
}
AllEqualsExpression exp(String key0, Object val1, String key2, Object val2, String key3, Object val3) {
LinkedHashMap<String,Object> map = new LinkedHashMap<String,Object>();
LinkedHashMap<String,Object> map = new LinkedHashMap<>();
map.put(key0, val1);
map.put(key2, val2);
map.put(key3, val3);
@@ -94,7 +94,7 @@ public class DefaultExampleExpressionTest extends BaseTestCase {
}
private <T> OrmQueryRequest<T> create(SpiQuery<T> query) {
return new OrmQueryRequest<T>(null, null, query, null);
return new OrmQueryRequest<>(null, null, query, null);
}
@Test
@@ -10,7 +10,7 @@ public class DefaultExpressionListTest {
DefaultExpressionList exp() {
return new DefaultExpressionList<Object>(null, new DefaultExpressionFactory(true, true), null);
return new DefaultExpressionList<>(null, new DefaultExpressionFactory(true, true), null);
}
DefaultExpressionList spi(ExpressionList list) {
@@ -16,7 +16,7 @@ public class JunctionExpressionTest {
DefaultExpressionList<?> exp(Expression... expressions) {
DefaultExpressionList<Object> list = new DefaultExpressionList<Object>(null, new DefaultExpressionFactory(true, false), null);
DefaultExpressionList<Object> list = new DefaultExpressionList<>(null, new DefaultExpressionFactory(true, false), null);
for (Expression ex : expressions) {
list.add(ex);
}
@@ -24,11 +24,11 @@ public class JunctionExpressionTest {
}
<T> JunctionExpression and(DefaultExpressionList<T> list) {
return new JunctionExpression<T>(Junction.Type.AND, list);
return new JunctionExpression<>(Junction.Type.AND, list);
}
<T> JunctionExpression or(DefaultExpressionList<T> list) {
return new JunctionExpression<T>(Junction.Type.OR, list);
return new JunctionExpression<>(Junction.Type.OR, list);
}
@Test
@@ -13,7 +13,7 @@ import java.util.List;
*/
public class TDSpiExpressionRequest implements SpiExpressionRequest {
List<Object> bindValues = new ArrayList<Object>();
List<Object> bindValues = new ArrayList<>();
final BeanDescriptor<?> descriptor;
@@ -88,7 +88,7 @@ public class LimitOffsetPagedListTest {
}
private LimitOffsetPagedList<Order> limitQuery(SpiQuery<Order> query) {
return new LimitOffsetPagedList<Order>(server, query);
return new LimitOffsetPagedList<>(server, query);
}
private SpiQuery<Order> queryWith(int first, int max) {
@@ -23,7 +23,7 @@ public class OrderVersionDescTest {
Version<?> at200 = at(200);
Version<?> at300 = at(300);
List<Version<?>> versions = new ArrayList<Version<?>>();
List<Version<?>> versions = new ArrayList<>();
versions.add(at200);
versions.add(atNull);
versions.add(at300);
@@ -118,7 +118,7 @@ public class OrmQueryPlanKeyTest extends BaseExpressionTest {
@Test
public void equals_when_diffOrderByNull() {
OrderBy<Object> o1 = new OrderBy<Object>("id");
OrderBy<Object> o1 = new OrderBy<>("id");
OrmQueryPlanKey key1 = new OrmQueryPlanKey(null, SpiQuery.Type.BEAN, null, 0, 0, false, o1, false, false, null, null, null, null, null, SpiQuery.TemporalMode.CURRENT, false, null, null, null);
OrmQueryPlanKey key2 = new OrmQueryPlanKey(null, SpiQuery.Type.BEAN, null, 0, 0, false, null, false, false, null, null, null, null, null, SpiQuery.TemporalMode.CURRENT, false, null, null, null);
@@ -128,8 +128,8 @@ public class OrmQueryPlanKeyTest extends BaseExpressionTest {
@Test
public void equals_when_orderBySame() {
OrderBy<Object> o1 = new OrderBy<Object>("id, name");
OrderBy<Object> o2 = new OrderBy<Object>("id, name");
OrderBy<Object> o1 = new OrderBy<>("id, name");
OrderBy<Object> o2 = new OrderBy<>("id, name");
OrmQueryPlanKey key1 = new OrmQueryPlanKey(null, SpiQuery.Type.BEAN, null, 0, 0, false, o1, false, false, null, null, null, null, null, SpiQuery.TemporalMode.CURRENT, false, null, null, null);
OrmQueryPlanKey key2 = new OrmQueryPlanKey(null, SpiQuery.Type.BEAN, null, 0, 0, false, o2, false, false, null, null, null, null, null, SpiQuery.TemporalMode.CURRENT, false, null, null, null);
@@ -22,7 +22,7 @@ public class OrmQueryPropertiesTest {
@Test
public void construct_with_propertySet_when_empty() {
OrmQueryProperties p1 = new OrmQueryProperties(null, new LinkedHashSet<String>());
OrmQueryProperties p1 = new OrmQueryProperties(null, new LinkedHashSet<>());
assertThat(p1.getProperties()).isEqualTo("");
assertThat(p1.allProperties()).isFalse();
}
@@ -30,7 +30,7 @@ public class OrmQueryPropertiesTest {
@Test
public void construct_with_propertySet_when_one() {
LinkedHashSet<String> set = new LinkedHashSet<String>();
LinkedHashSet<String> set = new LinkedHashSet<>();
set.add("name");
OrmQueryProperties p1 = new OrmQueryProperties(null, set);
@@ -41,7 +41,7 @@ public class OrmQueryPropertiesTest {
@Test
public void construct_with_propertySet_when_some() {
LinkedHashSet<String> set = new LinkedHashSet<String>();
LinkedHashSet<String> set = new LinkedHashSet<>();
set.add("id");
set.add("name");
set.add("startDate");
@@ -12,10 +12,10 @@ public class ModifyAwareListTest {
private ModifyAwareList<String> createList() {
ArrayList list = new ArrayList();
list.addAll(Arrays.asList("A","B","C","D","E"));
return new ModifyAwareList<String>(list);
return new ModifyAwareList<>(list);
}
private ModifyAwareList<String> createEmptyList() {
return new ModifyAwareList<String>(new ArrayList<String>());
return new ModifyAwareList<>(new ArrayList<>());
}
@Test
@@ -9,18 +9,18 @@ import static org.junit.Assert.*;
public class ModifyAwareMapTest {
private ModifyAwareMap<String, String> createMap() {
LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
LinkedHashMap<String, String> map = new LinkedHashMap<>();
map.put("A", "one");
map.put("B", "two");
map.put("C", "three");
map.put("D", "four");
map.put("E", "five");
return new ModifyAwareMap<String, String>(map);
return new ModifyAwareMap<>(map);
}
private ModifyAwareMap<String, String> createEmptyMap() {
LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
return new ModifyAwareMap<String, String>(map);
LinkedHashMap<String, String> map = new LinkedHashMap<>();
return new ModifyAwareMap<>(map);
}
@Test
@@ -115,7 +115,7 @@ public class ModifyAwareMapTest {
ModifyAwareMap<String, String> map = createMap();
assertFalse(map.isMarkedDirty());
Map<String, String> other = new HashMap<String, String>();
Map<String, String> other = new HashMap<>();
map.putAll(other);
assertTrue(map.isMarkedDirty());
}
@@ -126,7 +126,7 @@ public class ModifyAwareMapTest {
ModifyAwareMap<String, String> map = createMap();
assertFalse(map.isMarkedDirty());
Map<String, String> other = new HashMap<String, String>();
Map<String, String> other = new HashMap<>();
other.put("A", "one");
map.putAll(other);
assertTrue(map.isMarkedDirty());
@@ -64,7 +64,7 @@ public class ScalarTypeMonthDayTest {
public void testJson() throws Exception {
MonthDay value = MonthDay.of(4, 29);
JsonTester<MonthDay> jsonTester = new JsonTester<MonthDay>(type);
JsonTester<MonthDay> jsonTester = new JsonTester<>(type);
jsonTester.test(value);
}
@@ -34,10 +34,10 @@ public class ScalarTypePostgresHstoreTest {
@Test
public void testIsDirty() throws Exception {
Map<String,Object> emptyMap = new HashMap<String, Object>();
Map<String,Object> emptyMap = new HashMap<>();
assertTrue(hstore.isDirty(emptyMap));
ModifyAwareMap<String,Object> modAware = new ModifyAwareMap<String,Object>(emptyMap);
ModifyAwareMap<String,Object> modAware = new ModifyAwareMap<>(emptyMap);
assertFalse(hstore.isDirty(modAware));
modAware.put("foo", "Rob");
assertTrue(hstore.isDirty(emptyMap));
@@ -62,7 +62,7 @@ public class ScalarTypePostgresHstoreTest {
@Test
public void testJsonWrite() throws Exception {
Map<String,Object> map = new LinkedHashMap<String, Object>();
Map<String,Object> map = new LinkedHashMap<>();
assertEquals("{\"key\":{}}", generateJson(map));
@@ -12,7 +12,7 @@ public class ArrayStackTest {
@Test
public void testPushPop() throws Exception {
ArrayStack<String> stack = new ArrayStack<String>();
ArrayStack<String> stack = new ArrayStack<>();
stack.push("1");
stack.push("2");
stack.push("3");
@@ -25,7 +25,7 @@ public class ArrayStackTest {
@Test
public void testPushPop_given_stackInitialSizeExceeded() throws Exception {
ArrayStack<String> stack = new ArrayStack<String>(2);
ArrayStack<String> stack = new ArrayStack<>(2);
stack.push("1");
stack.push("2");
stack.push("3");
@@ -38,14 +38,14 @@ public class ArrayStackTest {
@Test(expected = EmptyStackException.class)
public void testPop_given_emptyStack_throws() throws Exception {
ArrayStack<String> stack = new ArrayStack<String>();
ArrayStack<String> stack = new ArrayStack<>();
stack.pop();
}
@Test(expected = EmptyStackException.class)
public void testPeek_given_empty_throws() throws Exception {
ArrayStack<String> stack = new ArrayStack<String>();
ArrayStack<String> stack = new ArrayStack<>();
assertThat(stack.peek());
}
@@ -53,7 +53,7 @@ public class ArrayStackTest {
@Test
public void testPeek_given_notEmpty() throws Exception {
ArrayStack<String> stack = new ArrayStack<String>();
ArrayStack<String> stack = new ArrayStack<>();
stack.push("1");
assertThat(stack.peek()).isEqualTo("1");
}
@@ -61,7 +61,7 @@ public class ArrayStackTest {
@Test
public void testPeekWithNull() throws Exception {
ArrayStack<String> stack = new ArrayStack<String>();
ArrayStack<String> stack = new ArrayStack<>();
assertThat(stack.peekWithNull()).isNull();
@@ -72,7 +72,7 @@ public class ArrayStackTest {
@Test
public void testIsEmpty() throws Exception {
ArrayStack<String> stack = new ArrayStack<String>();
ArrayStack<String> stack = new ArrayStack<>();
assertThat(stack.isEmpty()).isTrue();
stack.push("1");
@@ -82,7 +82,7 @@ public class ArrayStackTest {
@Test
public void testSize() throws Exception {
ArrayStack<String> stack = new ArrayStack<String>();
ArrayStack<String> stack = new ArrayStack<>();
assertThat(stack.size()).isEqualTo(0);
stack.push("1");
@@ -94,7 +94,7 @@ public class ArrayStackTest {
@Test
public void testContains() throws Exception {
ArrayStack<String> stack = new ArrayStack<String>();
ArrayStack<String> stack = new ArrayStack<>();
stack.push("1");
assertThat(stack.contains("1")).isTrue();
@@ -28,7 +28,7 @@ public class DocStoreBeanBaseAdapterTest extends BaseTestCase {
DeployBeanDescriptor<Order> deployDesc = (DeployBeanDescriptor<Order>)mock(DeployBeanDescriptor.class);
TDAdapter<Order> adapter = new TDAdapter<Order>(orderDesc, deployDesc);
TDAdapter<Order> adapter = new TDAdapter<>(orderDesc, deployDesc);
assertThat(adapter.getIndexName()).isEqualTo("order");
assertThat(adapter.getIndexType()).isEqualTo("order");
@@ -38,7 +38,7 @@ public class DocStoreIndexEventTest {
when(mock.docStore()).thenReturn(mockDocType);
Order bean = new Order();
DocStoreIndexEvent<Order> event = new DocStoreIndexEvent<Order>(mock, 42, bean);
DocStoreIndexEvent<Order> event = new DocStoreIndexEvent<>(mock, 42, bean);
event.docStoreUpdate(null);
@@ -51,7 +51,7 @@ public class DocStoreIndexEventTest {
Order bean = new Order();
DocStoreIndexEvent<Order> event = new DocStoreIndexEvent<Order>(orderType(), 42, bean);
DocStoreIndexEvent<Order> event = new DocStoreIndexEvent<>(orderType(), 42, bean);
DocStoreUpdates updates = new DocStoreUpdates();
event.addToQueue(updates);
@@ -31,7 +31,7 @@ public class TestDeleteByIdCollection extends BaseTestCase {
Assert.assertNotNull(c0Back);
Assert.assertNotNull(c1Back);
List<String> ids = new ArrayList<String>();
List<String> ids = new ArrayList<>();
// also test id type conversion
ids.add("" + c0.getId());
ids.add("" + c1.getId());
@@ -62,7 +62,7 @@ public class TestDeleteByIdCollection extends BaseTestCase {
Assert.assertNotNull(o1Back);
List<Object> ids = new ArrayList<Object>();
List<Object> ids = new ArrayList<>();
// also test id type conversion
ids.add(order0.getId());
ids.add(order1.getId());
@@ -45,7 +45,7 @@ public class TestM2MVanilla extends BaseTestCase {
MUser user = Ebean.find(MUser.class, u0.getUserid());
List<MRole> roleList = new ArrayList<MRole>();
List<MRole> roleList = new ArrayList<>();
roleList.add(r1);
roleList.add(r2);
@@ -17,7 +17,7 @@ public class TestUuidInsertMasterDetail extends BaseTestCase {
UUTwo two = new UUTwo();
two.setName("something");
ArrayList<UUTwo> list = new ArrayList<UUTwo>();
ArrayList<UUTwo> list = new ArrayList<>();
list.add(two);
UUOne one = new UUOne();
@@ -128,7 +128,7 @@ public class TestBatchInsertSimple extends BaseTestCase {
int numOfMasters = 3;
List<UTMaster> masters = new ArrayList<UTMaster>();
List<UTMaster> masters = new ArrayList<>();
for (int i = 0; i < numOfMasters; i++) {
masters.add(createMasterAndDetails(i, 7));
}
@@ -154,7 +154,7 @@ public class TestBatchInsertSimple extends BaseTestCase {
int numOfMasters = 3;
List<UTMaster> masters = new ArrayList<UTMaster>();
List<UTMaster> masters = new ArrayList<>();
for (int i = 0; i < numOfMasters; i++) {
masters.add(createMasterAndDetails(i, 5));
}
@@ -177,7 +177,7 @@ public class TestBatchInsertSimple extends BaseTestCase {
private UTMaster createMasterAndDetails(int masterPos, int size) {
UTMaster master = createMaster(masterPos);
List<UTDetail> details = new ArrayList<UTDetail>();
List<UTDetail> details = new ArrayList<>();
int count = 2 + random.nextInt(size);
@@ -28,7 +28,7 @@ public class TestBatchLazyWithCacheHits extends BaseTestCase {
@Test
public void testOnCacheHit() {
ArrayList<UUOne> inserted = new ArrayList<UUOne>();
ArrayList<UUOne> inserted = new ArrayList<>();
String[] names = "A,B,C,D,E,F,G,H,I,J".split(",");
for (int i = 0; i < names.length; i++) {
inserted.add(insert(names[i]));
@@ -257,7 +257,7 @@ public class TestCacheCollectionIds extends BaseTestCase {
cachedBean = Ebean.find(OCachedBean.class, cachedBean.getId());
cachedBean.setName("mod");
ArrayList<Country> list = new ArrayList<Country>();
ArrayList<Country> list = new ArrayList<>();
list.add(Ebean.find(Country.class, "NZ"));
cachedBean.setCountries(list);
Ebean.save(cachedBean);
@@ -51,7 +51,7 @@ public class TestCKeyIdInExpression extends BaseTestCase {
ROrderPK k2 = new ROrderPK("b", 105);
ROrderPK k3 = new ROrderPK("c", 106);
List<ROrderPK> keys = new ArrayList<ROrderPK>();
List<ROrderPK> keys = new ArrayList<>();
keys.add(k0);
keys.add(k1);
keys.add(k2);
@@ -71,7 +71,7 @@ public class TestCKeyLazyLoad extends BaseTestCase {
int size = details.size();
Assert.assertTrue(size > 0);
List<Object> idList = new ArrayList<Object>();
List<Object> idList = new ArrayList<>();
idList.add(id);
idList.add(id2);
@@ -57,7 +57,7 @@ public class TestOnCascadeDeleteChildrenWithCompositeKeys extends BaseTestCase {
if (isMsSqlServer()) return;
assertEquals(2, Ebean.find(User.class).findList().size());
List<Long> ids = new ArrayList<Long>();
List<Long> ids = new ArrayList<>();
ids.add(1L);
ids.add(2L);
@@ -79,7 +79,7 @@ public class TestOnCascadeDeleteChildrenWithCompositeKeys extends BaseTestCase {
BeanPropertyAssocMany<?> beanProperty = (BeanPropertyAssocMany<?>)beanDescriptor.getBeanProperty("userRoles");
List<Object> ids = new ArrayList<Object>();
List<Object> ids = new ArrayList<>();
ids.add(1L);
ids.add(2L);
@@ -28,7 +28,7 @@ public class LinkQueryPublishTest {
EbeanServer server = Ebean.getDefaultServer();
List<Object> ids = new ArrayList<Object>();
List<Object> ids = new ArrayList<>();
ids.add(link1.getId());
ids.add(link2.getId());
ids.add(link3.getId());
@@ -13,7 +13,7 @@ public class TestConstructorManyAddAll extends BaseTestCase {
@Test
public void test() {
List<MRole> startRoles = new ArrayList<MRole>();
List<MRole> startRoles = new ArrayList<>();
MUser mUser = new MUser(startRoles);
mUser.getRoles();
}
@@ -19,7 +19,7 @@ import java.util.List;
*/
public class TestPropertyChangeSupport extends EbeanTestCase implements PropertyChangeListener {
private int nuofEvents = 0;
private List<PropertyChangeEvent> pces = new ArrayList<PropertyChangeEvent>();
private List<PropertyChangeEvent> pces = new ArrayList<>();
private PropertyChangeEvent lastPce;
public void propertyChange(PropertyChangeEvent evt) {
@@ -21,7 +21,7 @@ public class TestInsertCollection extends BaseTestCase {
Customer cust2 = new Customer();
cust2.setName("bob");
List<Customer> customers = new ArrayList<Customer>();
List<Customer> customers = new ArrayList<>();
customers.add(cust1);
customers.add(cust2);
@@ -51,7 +51,7 @@ public class TestInsertCollection extends BaseTestCase {
Customer cust3 = new Customer();
cust3.setName("mac");
List<Customer> saveList = new ArrayList<Customer>();
List<Customer> saveList = new ArrayList<>();
saveList.add(cust1Check2);
saveList.add(cust3);
@@ -64,7 +64,7 @@ public class TestInsertCollection extends BaseTestCase {
Customer cust3Check = Ebean.find(Customer.class, cust3.getId());
Assert.assertEquals("mac", cust3Check.getName());
List<Customer> deleteList = new ArrayList<Customer>();
List<Customer> deleteList = new ArrayList<>();
deleteList.add(cust1Check3);
deleteList.add(cust3);
deleteList.add(cust2Check2);
@@ -33,7 +33,7 @@ public class TestInsertOnStringKey extends BaseTestCase {
}
private List<OrderItemEntity> toList(OrderItemEntity orderItemEntity) {
List<OrderItemEntity> list = new ArrayList<OrderItemEntity>();
List<OrderItemEntity> list = new ArrayList<>();
list.add(orderItemEntity);
return list;
}
@@ -37,7 +37,7 @@ public class TestCarWheelIud extends BaseTestCase {
w4.setCar(car);
w4.setTire(t4);
List<Wheel> wheels = new ArrayList<Wheel>();
List<Wheel> wheels = new ArrayList<>();
wheels.add(w1);
wheels.add(w2);
wheels.add(w3);
@@ -38,13 +38,13 @@ public class TestDbJson_List extends BaseTestCase {
bean.setPlainBean(new PlainBean("plain", 52));
List<PlainBean> beanList = new ArrayList<PlainBean>();
List<PlainBean> beanList = new ArrayList<>();
beanList.add(new PlainBean("one", 1));
beanList.add(new PlainBean("two", 2));
bean.setBeanList(beanList);
Set<PlainBean> beanSet = new LinkedHashSet<PlainBean>();
Set<PlainBean> beanSet = new LinkedHashSet<>();
beanSet.add(new PlainBean("A", 1));
beanSet.add(new PlainBean("B", 2));
bean.setBeanSet(beanSet);
@@ -20,7 +20,7 @@ public class TestJsonExcludeEmptyList {
bean.setId(99);
bean.setStatus(null);
bean.setOrderDate(null);
bean.setDetails(new ArrayList<OrderDetail>());
bean.setDetails(new ArrayList<>());
JsonWriteOptions options = new JsonWriteOptions();
options.setInclude(JsonConfig.Include.NON_NULL);
@@ -39,7 +39,7 @@ public class TestJsonExcludeEmptyList {
bean.setId(99);
bean.setStatus(null);
bean.setOrderDate(null);
bean.setDetails(new ArrayList<OrderDetail>());
bean.setDetails(new ArrayList<>());
JsonWriteOptions options = new JsonWriteOptions();
options.setInclude(JsonConfig.Include.NON_EMPTY);
@@ -17,7 +17,7 @@ public class TestJsonExcludeEmptyMap {
EBasicJsonMap bean = new EBasicJsonMap();
bean.setId(99L);
bean.setContent(new LinkedHashMap<String, Object>());
bean.setContent(new LinkedHashMap<>());
JsonWriteOptions options = new JsonWriteOptions();
options.setInclude(JsonConfig.Include.NON_NULL);
@@ -34,7 +34,7 @@ public class TestJsonExcludeEmptyMap {
EBasicJsonMap bean = new EBasicJsonMap();
bean.setId(99L);
bean.setContent(new LinkedHashMap<String, Object>());
bean.setContent(new LinkedHashMap<>());
JsonWriteOptions options = new JsonWriteOptions();
options.setInclude(JsonConfig.Include.NON_EMPTY);
@@ -18,7 +18,7 @@ public class TestJsonExcludeEmptySet {
AttributeHolder bean = new AttributeHolder();
bean.setId(99);
bean.setAttributes(new LinkedHashSet<Attribute>());
bean.setAttributes(new LinkedHashSet<>());
JsonWriteOptions options = new JsonWriteOptions();
options.setInclude(JsonConfig.Include.NON_NULL);
@@ -35,7 +35,7 @@ public class TestJsonExcludeEmptySet {
AttributeHolder bean = new AttributeHolder();
bean.setId(99);
bean.setAttributes(new LinkedHashSet<Attribute>());
bean.setAttributes(new LinkedHashSet<>());
JsonWriteOptions options = new JsonWriteOptions();
options.setInclude(JsonConfig.Include.NON_EMPTY);
@@ -20,7 +20,7 @@ public class TestJsonExcludeTransientEmptyList {
EJsonTransientList bean = new EJsonTransientList();
bean.setId(99L);
bean.setFileNames(new ArrayList<String>());
bean.setFileNames(new ArrayList<>());
JsonWriteOptions options = new JsonWriteOptions();
options.setInclude(JsonConfig.Include.NON_NULL);
@@ -37,7 +37,7 @@ public class TestJsonExcludeTransientEmptyList {
EJsonTransientList bean = new EJsonTransientList();
bean.setId(99L);
bean.setFileNames(new ArrayList<String>());
bean.setFileNames(new ArrayList<>());
JsonWriteOptions options = new JsonWriteOptions();
options.setInclude(JsonConfig.Include.NON_EMPTY);
@@ -21,7 +21,7 @@ public class TestModelAJson {
b.setOneField(1);
b.setTwoField(1);
a.setList(new ArrayList<ModelB>());
a.setList(new ArrayList<>());
a.getList().add(b);
PathProperties pathProperties = PathProperties.parse("(a,list(oneField))");
@@ -32,7 +32,7 @@ public class TestM2MDeleteObjectWithCascadeToM2m extends BaseTestCase {
Role role1 = new Role("RoleOne");
role1.setTenant(tenant1);
Set<Permission> permissions = new HashSet<Permission>();
Set<Permission> permissions = new HashSet<>();
List<Permission> permsList = Ebean.find(Permission.class).findList();
permissions.addAll(permsList);
@@ -36,7 +36,7 @@ public class TestM2MDeleteWithCascade extends BaseTestCase {
MUser notThere = Ebean.find(MUser.class, u0.getUserid());
Assert.assertNull("been deleted", notThere);
List<Object> roleIds = new ArrayList<Object>();
List<Object> roleIds = new ArrayList<>();
Collections.addAll(roleIds, r0.getRoleid(), r1.getRoleid());
int rc = Ebean.find(MRole.class).where().idIn(roleIds).findCount();
@@ -34,7 +34,7 @@ public class TestM2mDeleteObject extends BaseTestCase {
Role role1 = new Role("role");
role1.setTenant(t);
Set<Permission> permissions = new HashSet<Permission>();
Set<Permission> permissions = new HashSet<>();
List<Permission> permsList = Ebean.find(Permission.class).findList();
permissions.addAll(permsList);
@@ -72,7 +72,7 @@ public class TestM2mDeleteObject extends BaseTestCase {
Role role1 = new Role("role");
Set<Permission> permissions = new HashSet<Permission>();
Set<Permission> permissions = new HashSet<>();
permissions.add(p2);
role1.setPermissions(permissions);
Ebean.save(role1);
@@ -19,13 +19,13 @@ public class EArrayBean {
String name;
@DbArray(length = 300)
List<String> phoneNumbers = new ArrayList<String>();
List<String> phoneNumbers = new ArrayList<>();
@DbArray
List<UUID> uids = new ArrayList<UUID>();
List<UUID> uids = new ArrayList<>();
@DbArray
List<Long> otherIds = new ArrayList<Long>();
List<Long> otherIds = new ArrayList<>();
@DbArray
List<Double> doubs;
@@ -29,7 +29,7 @@ public class TestDbArray_basic extends BaseTestCase {
phNumbers.add("9823");
List<Double> doubles = new ArrayList<Double>();
List<Double> doubles = new ArrayList<>();
doubles.add(1.3);
doubles.add(2.4);
@@ -140,7 +140,7 @@ public class TestDbArray_basic extends BaseTestCase {
bean.setOtherIds(null);
bean.setUids(null);
List<EArrayBean> all = new ArrayList<EArrayBean>();
List<EArrayBean> all = new ArrayList<>();
all.add(bean);
Ebean.saveAll(all);
@@ -56,7 +56,7 @@ public class Article extends BasicDomain {
public void addSection(Section s) {
if (sections == null) {
sections = new ArrayList<Section>();
sections = new ArrayList<>();
}
sections.add(s);
}
@@ -68,7 +68,7 @@ public class CKeyParent {
public void add(CKeyDetail detail) {
if (details == null) {
details = new ArrayList<CKeyDetail>();
details = new ArrayList<>();
}
details.add(detail);
}
@@ -42,7 +42,7 @@ public class Car extends Vehicle {
@OneToMany(mappedBy = "car")
@OrderBy("fuse.locationCode")
private Set<CarAccessory> accessories = new HashSet<CarAccessory>();
private Set<CarAccessory> accessories = new HashSet<>();
private String notes;
@@ -219,7 +219,7 @@ public class Customer extends BasicDomain {
public void addContact(Contact contact) {
if (contacts == null) {
contacts = new ArrayList<Contact>();
contacts = new ArrayList<>();
}
contacts.add(contact);
}
@@ -19,7 +19,7 @@ public class EVanillaCollection {
List<EVanillaCollectionDetail> details;
public EVanillaCollection() {
details = new ArrayList<EVanillaCollectionDetail>();
details = new ArrayList<>();
}
public Integer getId() {
@@ -64,7 +64,7 @@ public class MUser {
public void addRole(MRole role) {
if (roles == null) {
roles = new ArrayList<MRole>();
roles = new ArrayList<>();
}
roles.add(role);
}
@@ -67,7 +67,7 @@ public class MnocUser {
public void addValidRole(MnocRole role) {
if (validRoles == null) {
validRoles = new ArrayList<MnocRole>();
validRoles = new ArrayList<>();
}
validRoles.add(role);
}
@@ -30,7 +30,7 @@ public class MyEBasicConfigStartup implements ServerConfigStartup {
public static class EbasicBulkListener implements BulkTableEventListener {
final Set<String> s = new HashSet<String>();
final Set<String> s = new HashSet<>();
EbasicBulkListener() {
s.add("e_basic");
@@ -25,10 +25,10 @@ public class OCachedBean {
String name;
@ManyToMany(cascade = CascadeType.ALL)
List<Country> countries = new ArrayList<Country>();
List<Country> countries = new ArrayList<>();
@OneToMany(mappedBy = "cachedBean", cascade = CascadeType.ALL)
List<OCachedBeanChild> children = new ArrayList<OCachedBeanChild>();
List<OCachedBeanChild> children = new ArrayList<>();
public Long getId() {
return id;
@@ -252,7 +252,7 @@ public class Order implements Serializable {
public void addDetail(OrderDetail detail) {
if (details == null) {
details = new ArrayList<OrderDetail>();
details = new ArrayList<>();
}
details.add(detail);
}
@@ -268,7 +268,7 @@ public class Order implements Serializable {
public void addShipment(OrderShipment shipment) {
if (shipments == null) {
shipments = new ArrayList<OrderShipment>();
shipments = new ArrayList<>();
}
shipments.add(shipment);
}
@@ -257,7 +257,7 @@ public class ResetBasicData {
Order order = new Order();
order.setCustomer(customer);
List<OrderDetail> details = new ArrayList<OrderDetail>();
List<OrderDetail> details = new ArrayList<>();
details.add(new OrderDetail(product1, 5, 10.50));
details.add(new OrderDetail(product2, 3, 1.10));
details.add(new OrderDetail(product3, 1, 2.00));
@@ -278,7 +278,7 @@ public class ResetBasicData {
order.setStatus(Status.SHIPPED);
order.setCustomer(customer);
List<OrderDetail> details = new ArrayList<OrderDetail>();
List<OrderDetail> details = new ArrayList<>();
details.add(new OrderDetail(product1, 4, 10.50));
order.setDetails(details);
@@ -296,7 +296,7 @@ public class ResetBasicData {
order.setStatus(Status.COMPLETE);
order.setCustomer(customer);
List<OrderDetail> details = new ArrayList<OrderDetail>();
List<OrderDetail> details = new ArrayList<>();
details.add(new OrderDetail(product1, 3, 10.50));
details.add(new OrderDetail(product3, 40, 2.10));
details.add(new OrderDetail(product1, 5, 10.00));
@@ -73,7 +73,7 @@ public class Section extends BasicDomain {
public void addSubSection(SubSection s) {
if (subSections == null) {
subSections = new ArrayList<SubSection>();
subSections = new ArrayList<>();
}
subSections.add(s);
}
@@ -75,7 +75,7 @@ public class TSMaster {
public void addDetail(TSDetail detail) {
if (details == null) {
details = new ArrayList<TSDetail>();
details = new ArrayList<>();
}
details.add(detail);
}
@@ -72,7 +72,7 @@ public class TSMasterTwo {
public void addDetail(TSDetailTwo detail) {
if (details == null) {
details = new ArrayList<TSDetailTwo>();
details = new ArrayList<>();
}
details.add(detail);
}
@@ -78,7 +78,7 @@ public class UTMaster extends Model {
public void addDetail(UTDetail detail) {
if (details == null) {
details = new ArrayList<UTDetail>();
details = new ArrayList<>();
}
details.add(detail);
}
@@ -30,7 +30,7 @@ public class TestDeleteUnloadedChildren extends BaseTestCase {
EdChild child = new EdChild();
child.setName("Harddisk 123");
child.setParent(parent);
ArrayList<EdChild> children = new ArrayList<EdChild>();
ArrayList<EdChild> children = new ArrayList<>();
children.add(child);
parent.setChildren(children);
@@ -42,7 +42,7 @@ public class TestDeleteUnloadedChildren extends BaseTestCase {
child = new EdChild();
child.setName("DVBS Card");
children = new ArrayList<EdChild>();
children = new ArrayList<>();
children.add(child);
extendedParent.setChildren(children);
@@ -31,7 +31,7 @@ public class TestInsertBatchThenFlushThenUpdate extends BaseTestCase {
EdChild child = new EdChild();
child.setName("Harddisk 123");
child.setParent(parent);
ArrayList<EdChild> children = new ArrayList<EdChild>();
ArrayList<EdChild> children = new ArrayList<>();
children.add(child);
parent.setChildren(children);
@@ -33,7 +33,7 @@ public class TestInsertBatchThenUpdate extends BaseTestCase {
EdChild child = new EdChild();
child.setName("Harddisk 123");
child.setParent(parent);
ArrayList<EdChild> children = new ArrayList<EdChild>();
ArrayList<EdChild> children = new ArrayList<>();
children.add(child);
parent.setChildren(children);
@@ -30,7 +30,7 @@ public class TestInsertBatchWithDifferentRootTypes extends BaseTestCase {
EdChild child = new EdChild();
child.setName("Harddisk 123");
child.setParent(parent);
ArrayList<EdChild> children = new ArrayList<EdChild>();
ArrayList<EdChild> children = new ArrayList<>();
children.add(child);
parent.setChildren(children);
@@ -42,7 +42,7 @@ public class TestInsertBatchWithDifferentRootTypes extends BaseTestCase {
child = new EdChild();
child.setName("DVBS Card");
children = new ArrayList<EdChild>();
children = new ArrayList<>();
children.add(child);
extendedParent.setChildren(children);
@@ -10,7 +10,7 @@ import java.util.List;
@Entity
public class InfoCompany extends Model {
public static final Finder<Long,InfoCompany> find = new Finder<Long,InfoCompany>(InfoCompany.class);
public static final Finder<Long,InfoCompany> find = new Finder<>(InfoCompany.class);
@Id
Long id;
@@ -22,7 +22,7 @@ public class InfoCompany extends Model {
@JsonIgnore
@OneToMany(mappedBy = "company", cascade = CascadeType.ALL)
List<InfoContact> contacts = new ArrayList<InfoContact>();
List<InfoContact> contacts = new ArrayList<>();
public Long getId() {
return id;
@@ -11,7 +11,7 @@ import javax.persistence.Version;
@Entity
public class InfoCustomer extends Model {
public static final Finder<Long,InfoCustomer> find = new Finder<Long,InfoCustomer>(InfoCustomer.class);
public static final Finder<Long,InfoCustomer> find = new Finder<>(InfoCustomer.class);
@Id
Long id;
@@ -31,15 +31,15 @@ public class Oid<T> {
}
public static Oid<?> valueOf(String s) {
return new Oid<Object>(Integer.valueOf(s));
return new Oid<>(Integer.valueOf(s));
}
public static Oid<?> valueOf(long i) {
return new Oid<Object>(i);
return new Oid<>(i);
}
public static <T> Oid<T> valueOf(Class<T> cls, String s) {
Integer v = Integer.valueOf(s);
return new Oid<T>(v);
return new Oid<>(v);
}
}
@@ -9,7 +9,7 @@ public class OidTypeConverter {//implements ScalarTypeConverter<Oid<?>,Long> {
if (scalarType == null){
return null;
}
return new Oid<Object>(scalarType);
return new Oid<>(scalarType);
}
public Long unwrapValue(Oid<?> beanType) {
@@ -25,7 +25,7 @@ public class EBasicHstore {
public EBasicHstore(String name) {
this.name = name;
this.map = new LinkedHashMap<String, String>();
this.map = new LinkedHashMap<>();
}
public Long getId() {
@@ -29,16 +29,16 @@ public class EBasicJsonList {
List<PlainBean> beanList;
@DbJson(length = 700)
Map<String,PlainBean> beanMap = new LinkedHashMap<String, PlainBean>();
Map<String,PlainBean> beanMap = new LinkedHashMap<>();
@DbJson(length = 500)
PlainBean plainBean;
@DbJson(length = 50)
Set<Long> flags = new LinkedHashSet<Long>();
Set<Long> flags = new LinkedHashSet<>();
@DbJson(length = 100, storage = DbJsonType.VARCHAR)
List<String> tags = new ArrayList<String>();
List<String> tags = new ArrayList<>();
@Version
Long version;
@@ -18,7 +18,7 @@ public class MpUser {
@OneToMany(cascade = CascadeType.ALL)
@MapKey(name = "code")
public Map<String, MpRole> roles = new HashMap<String, MpRole>();
public Map<String, MpRole> roles = new HashMap<>();
public Long getId() {
return id;
@@ -10,7 +10,7 @@ import javax.persistence.OneToOne;
@Entity
public class Album extends BaseModel {
public static final Model.Finder<Long, Album> find = new Model.Finder<Long, Album>(Album.class);
public static final Model.Finder<Long, Album> find = new Model.Finder<>(Album.class);
private String name;
@@ -15,7 +15,7 @@ public class Cover extends Model {
private static final Logger logger = LoggerFactory.getLogger(Cover.class);
public static final Finder<Long, Cover> find = new Finder<Long, Cover>(Cover.class);
public static final Finder<Long, Cover> find = new Finder<>(Cover.class);
@Id
protected Long id;
@@ -296,7 +296,7 @@ public class DeleteById_SoftDelete_Tests extends BaseTestCase {
}
private List<Long> ids(List<Cover> beans) {
List<Long> ids = new ArrayList<Long>();
List<Long> ids = new ArrayList<>();
for (Cover someBean : beans) {
ids.add(someBean.getId());
}
@@ -304,7 +304,7 @@ public class DeleteById_SoftDelete_Tests extends BaseTestCase {
}
private List<Cover> beans(int count) {
List<Cover> beans = new ArrayList<Cover>();
List<Cover> beans = new ArrayList<>();
for (int i = 0; i < count; i++) {
beans.add(new Cover("delById " + i));
}
@@ -26,7 +26,7 @@ public class ResourceFile extends BaseResourceFile {
@OneToMany(cascade = CascadeType.REMOVE, fetch = FetchType.LAZY, mappedBy = "parent")
@PrivateOwned
private Set<ResourceFile> alternatives = new HashSet<ResourceFile>();
private Set<ResourceFile> alternatives = new HashSet<>();
@Column(name = "name", length = 128, nullable = false)
private String name;
@@ -29,7 +29,7 @@ public class Group {
@OneToMany(mappedBy = "group", cascade = {CascadeType.PERSIST, CascadeType.MERGE})
@OrderBy("sequenceNumber")
private List<Question> questions = new ArrayList<Question>();
private List<Question> questions = new ArrayList<>();
private int sequenceNumber;
@@ -16,25 +16,25 @@ public class TestOrderByFetch extends BaseTestCase {
public void test() {
Survey survey = new Survey("s1");
List<Category> categories = new ArrayList<Category>();
List<Category> categories = new ArrayList<>();
Category category = new Category("c1");
category.setSequenceNumber(1);
categories.add(category);
survey.setCategories(categories);
List<Group> groups = new ArrayList<Group>();
List<Group> groups = new ArrayList<>();
Group group1 = group(1);
Group group2 = group(2);
groups.add(group1);
groups.add(group2);
category.setGroups(groups);
List<Question> questionListGroup1 = new ArrayList<Question>();
List<Question> questionListGroup1 = new ArrayList<>();
questionListGroup1.add(question(1));
questionListGroup1.add(question(2));
questionListGroup1.add(question(3));
group1.setQuestions(questionListGroup1);
List<Question> questionListGroup2 = new ArrayList<Question>();
List<Question> questionListGroup2 = new ArrayList<>();
questionListGroup2.add(question(1));
questionListGroup2.add(question(2));
group2.setQuestions(questionListGroup2);
@@ -34,8 +34,8 @@ public class TestPersistenceContextScopeUsingOrders extends BaseTestCase {
assertTrue(!orders.isEmpty());
// collect the customer instances
List<Customer> customers = new ArrayList<Customer>();
Set<Integer> identities = new HashSet<Integer>();
List<Customer> customers = new ArrayList<>();
Set<Integer> identities = new HashSet<>();
for (Order order : orders) {
Customer customer = order.getCustomer();
@@ -24,7 +24,7 @@ public class TestSubQuery extends BaseTestCase {
ResetBasicData.reset();
List<Integer> productIds = new ArrayList<Integer>();
List<Integer> productIds = new ArrayList<>();
productIds.add(3);
Query<Order> sq = Ebean.createQuery(Order.class).select("id").where()
@@ -29,7 +29,7 @@ public class TestManyLazyLoadingQuery extends BaseTestCase {
BeanDescriptor<Order> descOrder = server.getBeanDescriptor(Order.class);
BeanPropertyAssocMany<?> beanProperty = (BeanPropertyAssocMany<?>)descOrder.getBeanProperty("details");
List<Object> parentIds = new ArrayList<Object>();
List<Object> parentIds = new ArrayList<>();
parentIds.add(1);
@@ -17,7 +17,7 @@ public class TestSoftDeletePagingList extends BaseTestCase {
@Test
public void test() {
List<Cover> list = new ArrayList<Cover>();
List<Cover> list = new ArrayList<>();
list.add(new Cover("SoftDelPaged-1"));
list.add(new Cover("SoftDelPaged-2"));
list.add(new Cover("SoftDelPaged-3"));
@@ -19,7 +19,7 @@ public class ParentQueryTest extends BaseTestCase {
@Test
public void QueryParentCollectionFetch() {
List<Data> exampleData = new ArrayList<Data>();
List<Data> exampleData = new ArrayList<>();
exampleData.add(new Data(0));
exampleData.add(new Data(1));
exampleData.add(new Data(2));
@@ -25,7 +25,7 @@ public class ParentRawSqlTest extends BaseTestCase {
@Test
public void RawSqlParentLoad() {
List<Data> exampleData = new ArrayList<Data>();
List<Data> exampleData = new ArrayList<>();
exampleData.add(new Data(0));
exampleData.add(new Data(1));
exampleData.add(new Data(2));
@@ -57,7 +57,7 @@ public class ParentRawSqlTest extends BaseTestCase {
@Test
public void RawSqlParentFetch() {
List<Data> exampleData = new ArrayList<Data>();
List<Data> exampleData = new ArrayList<>();
exampleData.add(new Data(0));
exampleData.add(new Data(1));
exampleData.add(new Data(2));
@@ -178,7 +178,7 @@ public class ParentRawSqlTest extends BaseTestCase {
.fetch("parent", new FetchConfig().query())
.findList();
List<Parent> partial = new ArrayList<Parent>();
List<Parent> partial = new ArrayList<>();
for (ParentAggregate aggregate : aggregates) {
partial.add(aggregate.parent);
}
@@ -202,7 +202,7 @@ public class ParentRawSqlTest extends BaseTestCase {
.fetch("parent", new FetchConfig().query())
.findList();
List<Parent> partial = new ArrayList<Parent>();
List<Parent> partial = new ArrayList<>();
for (ParentAggregate aggregate : aggregates) {
partial.add(aggregate.parent);
}
@@ -228,7 +228,7 @@ public class ParentRawSqlTest extends BaseTestCase {
.fetch("parent", new FetchConfig().query())
.findList();
List<Parent> partial = new ArrayList<Parent>();
List<Parent> partial = new ArrayList<>();
for (ParentAggregate aggregate : aggregates) {
partial.add(aggregate.parent);
}
@@ -359,9 +359,9 @@ public class TestReadAudit extends BaseTestCase {
class TDReadAuditLogger implements ReadAuditLogger {
Set<ReadAuditQueryPlan> plans = new HashSet<ReadAuditQueryPlan>();
List<ReadEvent> beans = new ArrayList<ReadEvent>();
List<ReadEvent> many = new ArrayList<ReadEvent>();
Set<ReadAuditQueryPlan> plans = new HashSet<>();
List<ReadEvent> beans = new ArrayList<>();
List<ReadEvent> many = new ArrayList<>();
TDReadAuditLogger(boolean dummy) {
}
@@ -43,7 +43,7 @@ public class TestSoftDeleteTop extends BaseTestCase {
transaction.end();
}
List<ESoftDelUp> list = new ArrayList<ESoftDelUp>();
List<ESoftDelUp> list = new ArrayList<>();
list.add(up1);
list.add(up2);
@@ -56,7 +56,7 @@ public class TestSoftDeleteTop extends BaseTestCase {
ESoftDelUp up1 = new ESoftDelUp("upBatchX");
ESoftDelUp up2 = new ESoftDelUp("upBatchY");
List<ESoftDelUp> list = new ArrayList<ESoftDelUp>();
List<ESoftDelUp> list = new ArrayList<>();
list.add(up1);
list.add(up2);
@@ -20,7 +20,7 @@ public class TestManyToManySaveTwice extends BaseTestCase {
Ebean.createSqlUpdate("delete from sp_car_wheel").execute();
Ebean.createSqlUpdate("delete from sp_car_car").execute();
List<Wheel> wheels = new LinkedList<Wheel>();
List<Wheel> wheels = new LinkedList<>();
wheels.add(new Wheel());
wheels.add(new Wheel());
wheels.add(new Wheel());

Some files were not shown because too many files have changed in this diff Show More