You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2017/04/10 21:56:48 UTC
svn commit: r1790899 [3/5] - in /commons/proper/configuration/trunk/src:
main/java/org/apache/commons/configuration2/
main/java/org/apache/commons/configuration2/beanutils/
main/java/org/apache/commons/configuration2/builder/
main/java/org/apache/commo...
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestCompositeConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestCompositeConfiguration.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestCompositeConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestCompositeConfiguration.java Mon Apr 10 21:56:46 2017
@@ -306,7 +306,7 @@ public class TestCompositeConfiguration
// we should get 3 packages here
assertEquals(3, packages.size());
- List<Object> defaultList = new ArrayList<Object>();
+ List<Object> defaultList = new ArrayList<>();
defaultList.add("1");
defaultList.add("2");
@@ -374,12 +374,12 @@ public class TestCompositeConfiguration
public void testGetKeysPreservesOrder() throws Exception
{
cc.addConfiguration(conf1);
- List<String> orderedList = new ArrayList<String>();
+ List<String> orderedList = new ArrayList<>();
for (Iterator<String> keys = conf1.getKeys(); keys.hasNext();)
{
orderedList.add(keys.next());
}
- List<String> iteratedList = new ArrayList<String>();
+ List<String> iteratedList = new ArrayList<>();
for (Iterator<String> keys = cc.getKeys(); keys.hasNext();)
{
iteratedList.add(keys.next());
@@ -398,12 +398,12 @@ public class TestCompositeConfiguration
public void testGetKeys2PreservesOrder() throws Exception
{
cc.addConfiguration(conf1);
- List<String> orderedList = new ArrayList<String>();
+ List<String> orderedList = new ArrayList<>();
for (Iterator<String> keys = conf1.getKeys("test"); keys.hasNext();)
{
orderedList.add(keys.next());
}
- List<String> iteratedList = new ArrayList<String>();
+ List<String> iteratedList = new ArrayList<>();
for (Iterator<String> keys = cc.getKeys("test"); keys.hasNext();)
{
iteratedList.add(keys.next());
@@ -512,7 +512,7 @@ public class TestCompositeConfiguration
@Test
public void testInstanciateWithCollection()
{
- Collection<Configuration> configs = new ArrayList<Configuration>();
+ Collection<Configuration> configs = new ArrayList<>();
configs.add(xmlConf);
configs.add(conf1);
configs.add(conf2);
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestConfigurationUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestConfigurationUtils.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestConfigurationUtils.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestConfigurationUtils.java Mon Apr 10 21:56:46 2017
@@ -132,12 +132,12 @@ public class TestConfigurationUtils
// append the source configuration to the target configuration
ConfigurationUtils.append(conf1, conf2);
- List<Object> expected = new ArrayList<Object>();
+ List<Object> expected = new ArrayList<>();
expected.add("value3");
expected.add("value1");
ListAssert.assertEquals("'key1' property", expected, conf2.getList("key1"));
- expected = new ArrayList<Object>();
+ expected = new ArrayList<>();
expected.add("value4");
expected.add("value2");
ListAssert.assertEquals("'key2' property", expected, conf2.getList("key2"));
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestDataConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestDataConfiguration.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestDataConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestDataConfiguration.java Mon Apr 10 21:56:46 2017
@@ -81,7 +81,7 @@ public class TestDataConfiguration
conf.addProperty("boolean.list3", Boolean.FALSE);
conf.addPropertyDirect("boolean.list4", new Boolean[] { Boolean.TRUE, Boolean.FALSE });
conf.addPropertyDirect("boolean.list5", new boolean[] { true, false });
- List<Object> booleans = new ArrayList<Object>();
+ List<Object> booleans = new ArrayList<>();
booleans.add(Boolean.TRUE);
booleans.add(Boolean.FALSE);
conf.addProperty("boolean.list6", booleans);
@@ -97,7 +97,7 @@ public class TestDataConfiguration
conf.addProperty("byte.list3", new Byte("2"));
conf.addPropertyDirect("byte.list4", new Byte[] { new Byte("1"), new Byte("2") });
conf.addPropertyDirect("byte.list5", new byte[] { 1, 2 });
- List<Object> bytes = new ArrayList<Object>();
+ List<Object> bytes = new ArrayList<>();
bytes.add(new Byte("1"));
bytes.add(new Byte("2"));
conf.addProperty("byte.list6", bytes);
@@ -113,7 +113,7 @@ public class TestDataConfiguration
conf.addProperty("short.list3", new Short("2"));
conf.addPropertyDirect("short.list4", new Short[] { new Short("1"), new Short("2") });
conf.addPropertyDirect("short.list5", new short[] { 1, 2 });
- List<Object> shorts = new ArrayList<Object>();
+ List<Object> shorts = new ArrayList<>();
shorts.add(new Short("1"));
shorts.add(new Short("2"));
conf.addProperty("short.list6", shorts);
@@ -129,7 +129,7 @@ public class TestDataConfiguration
conf.addProperty("integer.list3", new Integer("2"));
conf.addPropertyDirect("integer.list4", new Integer[] { new Integer("1"), new Integer("2") });
conf.addPropertyDirect("integer.list5", new int[] { 1, 2 });
- List<Object> integers = new ArrayList<Object>();
+ List<Object> integers = new ArrayList<>();
integers.add(new Integer("1"));
integers.add(new Integer("2"));
conf.addProperty("integer.list6", integers);
@@ -145,7 +145,7 @@ public class TestDataConfiguration
conf.addProperty("long.list3", new Long("2"));
conf.addPropertyDirect("long.list4", new Long[] { new Long("1"), new Long("2") });
conf.addPropertyDirect("long.list5", new long[] { 1, 2 });
- List<Object> longs = new ArrayList<Object>();
+ List<Object> longs = new ArrayList<>();
longs.add(new Long("1"));
longs.add(new Long("2"));
conf.addProperty("long.list6", longs);
@@ -161,7 +161,7 @@ public class TestDataConfiguration
conf.addProperty("float.list3", new Float("2"));
conf.addPropertyDirect("float.list4", new Float[] { new Float("1"), new Float("2") });
conf.addPropertyDirect("float.list5", new float[] { 1, 2 });
- List<Object> floats = new ArrayList<Object>();
+ List<Object> floats = new ArrayList<>();
floats.add(new Float("1"));
floats.add(new Float("2"));
conf.addProperty("float.list6", floats);
@@ -177,7 +177,7 @@ public class TestDataConfiguration
conf.addProperty("double.list3", new Double("2"));
conf.addPropertyDirect("double.list4", new Double[] { new Double("1"), new Double("2") });
conf.addPropertyDirect("double.list5", new double[] { 1, 2 });
- List<Object> doubles = new ArrayList<Object>();
+ List<Object> doubles = new ArrayList<>();
doubles.add(new Double("1"));
doubles.add(new Double("2"));
conf.addProperty("double.list6", doubles);
@@ -192,7 +192,7 @@ public class TestDataConfiguration
conf.addProperty("biginteger.list3", new BigInteger("1"));
conf.addProperty("biginteger.list3", new BigInteger("2"));
conf.addPropertyDirect("biginteger.list4", new BigInteger[] { new BigInteger("1"), new BigInteger("2") });
- List<Object> bigintegers = new ArrayList<Object>();
+ List<Object> bigintegers = new ArrayList<>();
bigintegers.add(new BigInteger("1"));
bigintegers.add(new BigInteger("2"));
conf.addProperty("biginteger.list6", bigintegers);
@@ -207,7 +207,7 @@ public class TestDataConfiguration
conf.addProperty("bigdecimal.list3", new BigDecimal("1"));
conf.addProperty("bigdecimal.list3", new BigDecimal("2"));
conf.addPropertyDirect("bigdecimal.list4", new BigDecimal[] { new BigDecimal("1"), new BigDecimal("2") });
- List<Object> bigdecimals = new ArrayList<Object>();
+ List<Object> bigdecimals = new ArrayList<>();
bigdecimals.add(new BigDecimal("1"));
bigdecimals.add(new BigDecimal("2"));
conf.addProperty("bigdecimal.list6", bigdecimals);
@@ -227,7 +227,7 @@ public class TestDataConfiguration
conf.addProperty("uri.list3", new URI(uri1));
conf.addProperty("uri.list3", new URI(uri2));
conf.addPropertyDirect("uri.list4", new URI[] { new URI(uri1), new URI(uri2) });
- List<Object> uris = new ArrayList<Object>();
+ List<Object> uris = new ArrayList<>();
uris.add(new URI(uri1));
uris.add(new URI(uri2));
conf.addProperty("uri.list6", uris);
@@ -245,7 +245,7 @@ public class TestDataConfiguration
conf.addProperty("url.list3", new URL(url1));
conf.addProperty("url.list3", new URL(url2));
conf.addPropertyDirect("url.list4", new URL[] { new URL(url1), new URL(url2) });
- List<Object> urls = new ArrayList<Object>();
+ List<Object> urls = new ArrayList<>();
urls.add(new URL(url1));
urls.add(new URL(url2));
conf.addProperty("url.list6", urls);
@@ -261,7 +261,7 @@ public class TestDataConfiguration
conf.addProperty("locale.list3", Locale.FRENCH);
conf.addProperty("locale.list3", Locale.GERMAN);
conf.addPropertyDirect("locale.list4", new Locale[] { Locale.FRENCH, Locale.GERMAN });
- List<Object> locales = new ArrayList<Object>();
+ List<Object> locales = new ArrayList<>();
locales.add(Locale.FRENCH);
locales.add(Locale.GERMAN);
conf.addProperty("locale.list6", locales);
@@ -279,7 +279,7 @@ public class TestDataConfiguration
conf.addProperty("color.list3", Color.red);
conf.addProperty("color.list3", Color.blue);
conf.addPropertyDirect("color.list4", new Color[] { Color.red, Color.blue });
- List<Object> colors = new ArrayList<Object>();
+ List<Object> colors = new ArrayList<>();
colors.add(Color.red);
colors.add(Color.blue);
conf.addProperty("color.list6", colors);
@@ -307,7 +307,7 @@ public class TestDataConfiguration
conf.addProperty("date.list3", date2);
conf.addPropertyDirect("date.list4", new Date[] { date1, date2 });
conf.addPropertyDirect("date.list5", new Calendar[] { calendar1, calendar2 });
- List<Object> dates = new ArrayList<Object>();
+ List<Object> dates = new ArrayList<>();
dates.add(date1);
dates.add(date2);
conf.addProperty("date.list6", dates);
@@ -324,7 +324,7 @@ public class TestDataConfiguration
conf.addProperty("calendar.list3", calendar2);
conf.addPropertyDirect("calendar.list4", new Calendar[] { calendar1, calendar2 });
conf.addPropertyDirect("calendar.list5", new Date[] { date1, date2 });
- List<Object> calendars = new ArrayList<Object>();
+ List<Object> calendars = new ArrayList<>();
calendars.add(date1);
calendars.add(date2);
conf.addProperty("calendar.list6", calendars);
@@ -466,7 +466,7 @@ public class TestDataConfiguration
// missing list
ListAssert.assertEquals(null, conf.getBooleanList("boolean.list", null));
- List<Object> expected = new ArrayList<Object>();
+ List<Object> expected = new ArrayList<>();
expected.add(Boolean.TRUE);
expected.add(Boolean.FALSE);
@@ -492,13 +492,13 @@ public class TestDataConfiguration
ListAssert.assertEquals(expected, conf.getBooleanList("boolean.list.interpolated"));
// single boolean values
- expected = new ArrayList<Object>();
+ expected = new ArrayList<>();
expected.add(Boolean.TRUE);
ListAssert.assertEquals(expected, conf.getBooleanList("boolean.string"));
ListAssert.assertEquals(expected, conf.getBooleanList("boolean.object"));
// empty list
- ListAssert.assertEquals(new ArrayList<Object>(), conf.getBooleanList("empty"));
+ ListAssert.assertEquals(new ArrayList<>(), conf.getBooleanList("empty"));
}
@Test
@@ -545,7 +545,7 @@ public class TestDataConfiguration
// missing list
ListAssert.assertEquals(null, conf.getByteList("byte.list", null));
- List<Object> expected = new ArrayList<Object>();
+ List<Object> expected = new ArrayList<>();
expected.add(new Byte("1"));
expected.add(new Byte("2"));
@@ -571,13 +571,13 @@ public class TestDataConfiguration
ListAssert.assertEquals(expected, conf.getByteList("byte.list.interpolated"));
// single byte values
- expected = new ArrayList<Object>();
+ expected = new ArrayList<>();
expected.add(new Byte("1"));
ListAssert.assertEquals(expected, conf.getByteList("byte.string"));
ListAssert.assertEquals(expected, conf.getByteList("byte.object"));
// empty list
- ListAssert.assertEquals(new ArrayList<Object>(), conf.getByteList("empty"));
+ ListAssert.assertEquals(new ArrayList<>(), conf.getByteList("empty"));
}
@Test
@@ -624,7 +624,7 @@ public class TestDataConfiguration
// missing list
ListAssert.assertEquals(null, conf.getShortList("short.list", null));
- List<Object> expected = new ArrayList<Object>();
+ List<Object> expected = new ArrayList<>();
expected.add(new Short("1"));
expected.add(new Short("2"));
@@ -650,13 +650,13 @@ public class TestDataConfiguration
ListAssert.assertEquals(expected, conf.getShortList("short.list.interpolated"));
// single short values
- expected = new ArrayList<Object>();
+ expected = new ArrayList<>();
expected.add(new Short("1"));
ListAssert.assertEquals(expected, conf.getShortList("short.string"));
ListAssert.assertEquals(expected, conf.getShortList("short.object"));
// empty list
- ListAssert.assertEquals(new ArrayList<Object>(), conf.getShortList("empty"));
+ ListAssert.assertEquals(new ArrayList<>(), conf.getShortList("empty"));
}
@Test
@@ -703,7 +703,7 @@ public class TestDataConfiguration
// missing list
ListAssert.assertEquals(null, conf.getIntegerList("integer.list", null));
- List<Object> expected = new ArrayList<Object>();
+ List<Object> expected = new ArrayList<>();
expected.add(new Integer("1"));
expected.add(new Integer("2"));
@@ -729,13 +729,13 @@ public class TestDataConfiguration
ListAssert.assertEquals(expected, conf.getIntegerList("integer.list.interpolated"));
// single int values
- expected = new ArrayList<Object>();
+ expected = new ArrayList<>();
expected.add(new Integer("1"));
ListAssert.assertEquals(expected, conf.getIntegerList("integer.string"));
ListAssert.assertEquals(expected, conf.getIntegerList("integer.object"));
// empty list
- ListAssert.assertEquals(new ArrayList<Object>(), conf.getIntegerList("empty"));
+ ListAssert.assertEquals(new ArrayList<>(), conf.getIntegerList("empty"));
}
@Test
@@ -782,7 +782,7 @@ public class TestDataConfiguration
// missing list
ListAssert.assertEquals(null, conf.getLongList("long.list", null));
- List<Object> expected = new ArrayList<Object>();
+ List<Object> expected = new ArrayList<>();
expected.add(new Long("1"));
expected.add(new Long("2"));
@@ -808,13 +808,13 @@ public class TestDataConfiguration
ListAssert.assertEquals(expected, conf.getLongList("long.list.interpolated"));
// single long values
- expected = new ArrayList<Object>();
+ expected = new ArrayList<>();
expected.add(new Long("1"));
ListAssert.assertEquals(expected, conf.getLongList("long.string"));
ListAssert.assertEquals(expected, conf.getLongList("long.object"));
// empty list
- ListAssert.assertEquals(new ArrayList<Object>(), conf.getLongList("empty"));
+ ListAssert.assertEquals(new ArrayList<>(), conf.getLongList("empty"));
}
@Test
@@ -861,7 +861,7 @@ public class TestDataConfiguration
// missing list
ListAssert.assertEquals(null, conf.getFloatList("float.list", null));
- List<Object> expected = new ArrayList<Object>();
+ List<Object> expected = new ArrayList<>();
expected.add(new Float("1"));
expected.add(new Float("2"));
@@ -887,13 +887,13 @@ public class TestDataConfiguration
ListAssert.assertEquals(expected, conf.getFloatList("float.list.interpolated"));
// single float values
- expected = new ArrayList<Object>();
+ expected = new ArrayList<>();
expected.add(new Float("1"));
ListAssert.assertEquals(expected, conf.getFloatList("float.string"));
ListAssert.assertEquals(expected, conf.getFloatList("float.object"));
// empty list
- ListAssert.assertEquals(new ArrayList<Object>(), conf.getFloatList("empty"));
+ ListAssert.assertEquals(new ArrayList<>(), conf.getFloatList("empty"));
}
@Test
@@ -940,7 +940,7 @@ public class TestDataConfiguration
// missing list
ListAssert.assertEquals(null, conf.getDoubleList("double.list", null));
- List<Object> expected = new ArrayList<Object>();
+ List<Object> expected = new ArrayList<>();
expected.add(new Double("1"));
expected.add(new Double("2"));
@@ -966,13 +966,13 @@ public class TestDataConfiguration
ListAssert.assertEquals(expected, conf.getDoubleList("double.list.interpolated"));
// single double values
- expected = new ArrayList<Object>();
+ expected = new ArrayList<>();
expected.add(new Double("1"));
ListAssert.assertEquals(expected, conf.getDoubleList("double.string"));
ListAssert.assertEquals(expected, conf.getDoubleList("double.object"));
// empty list
- ListAssert.assertEquals(new ArrayList<Object>(), conf.getDoubleList("empty"));
+ ListAssert.assertEquals(new ArrayList<>(), conf.getDoubleList("empty"));
}
@Test
@@ -1017,7 +1017,7 @@ public class TestDataConfiguration
List<BigInteger> bigIntegerList = conf.getBigIntegerList("biginteger.list", null);
ListAssert.assertEquals(null, bigIntegerList);
- List<Object> expected = new ArrayList<Object>();
+ List<Object> expected = new ArrayList<>();
expected.add(new BigInteger("1"));
expected.add(new BigInteger("2"));
@@ -1040,13 +1040,13 @@ public class TestDataConfiguration
ListAssert.assertEquals(expected, conf.getBigIntegerList("biginteger.list.interpolated"));
// single BigInteger values
- expected = new ArrayList<Object>();
+ expected = new ArrayList<>();
expected.add(new BigInteger("1"));
ListAssert.assertEquals(expected, conf.getBigIntegerList("biginteger.string"));
ListAssert.assertEquals(expected, conf.getBigIntegerList("biginteger.object"));
// empty list
- ListAssert.assertEquals(new ArrayList<Object>(), conf.getBigIntegerList("empty"));
+ ListAssert.assertEquals(new ArrayList<>(), conf.getBigIntegerList("empty"));
}
@Test
@@ -1090,7 +1090,7 @@ public class TestDataConfiguration
// missing list
ListAssert.assertEquals(null, conf.getBigDecimalList("bigdecimal.list", null));
- List<Object> expected = new ArrayList<Object>();
+ List<Object> expected = new ArrayList<>();
expected.add(new BigDecimal("1"));
expected.add(new BigDecimal("2"));
@@ -1113,13 +1113,13 @@ public class TestDataConfiguration
ListAssert.assertEquals(expected, conf.getBigDecimalList("bigdecimal.list.interpolated"));
// single BigDecimal values
- expected = new ArrayList<Object>();
+ expected = new ArrayList<>();
expected.add(new BigDecimal("1"));
ListAssert.assertEquals(expected, conf.getBigDecimalList("bigdecimal.string"));
ListAssert.assertEquals(expected, conf.getBigDecimalList("bigdecimal.object"));
// empty list
- ListAssert.assertEquals(new ArrayList<Object>(), conf.getBigDecimalList("empty"));
+ ListAssert.assertEquals(new ArrayList<>(), conf.getBigDecimalList("empty"));
}
@Test
@@ -1182,7 +1182,7 @@ public class TestDataConfiguration
// missing list
ListAssert.assertEquals(null, conf.getURIList("uri.list", null));
- List<Object> expected = new ArrayList<Object>();
+ List<Object> expected = new ArrayList<>();
expected.add(new URI("http://jakarta.apache.org"));
expected.add(new URI("http://www.apache.org"));
@@ -1205,13 +1205,13 @@ public class TestDataConfiguration
ListAssert.assertEquals(expected, conf.getURIList("uri.list.interpolated"));
// single URI values
- expected = new ArrayList<Object>();
+ expected = new ArrayList<>();
expected.add(new URI("http://jakarta.apache.org"));
ListAssert.assertEquals(expected, conf.getURIList("uri.string"));
ListAssert.assertEquals(expected, conf.getURIList("uri.object"));
// empty list
- ListAssert.assertEquals(new ArrayList<Object>(), conf.getURIList("empty"));
+ ListAssert.assertEquals(new ArrayList<>(), conf.getURIList("empty"));
}
@Test
@@ -1274,7 +1274,7 @@ public class TestDataConfiguration
// missing list
ListAssert.assertEquals(null, conf.getURLList("url.list", null));
- List<Object> expected = new ArrayList<Object>();
+ List<Object> expected = new ArrayList<>();
expected.add(new URL("http://jakarta.apache.org"));
expected.add(new URL("http://www.apache.org"));
@@ -1297,13 +1297,13 @@ public class TestDataConfiguration
ListAssert.assertEquals(expected, conf.getURLList("url.list.interpolated"));
// single URL values
- expected = new ArrayList<Object>();
+ expected = new ArrayList<>();
expected.add(new URL("http://jakarta.apache.org"));
ListAssert.assertEquals(expected, conf.getURLList("url.string"));
ListAssert.assertEquals(expected, conf.getURLList("url.object"));
// empty list
- ListAssert.assertEquals(new ArrayList<Object>(), conf.getURLList("empty"));
+ ListAssert.assertEquals(new ArrayList<>(), conf.getURLList("empty"));
}
@Test
@@ -1383,7 +1383,7 @@ public class TestDataConfiguration
// missing list
ListAssert.assertEquals(null, conf.getLocaleList("locale.list", null));
- List<Object> expected = new ArrayList<Object>();
+ List<Object> expected = new ArrayList<>();
expected.add(Locale.FRENCH);
expected.add(Locale.GERMAN);
@@ -1406,13 +1406,13 @@ public class TestDataConfiguration
ListAssert.assertEquals(expected, conf.getLocaleList("locale.list.interpolated"));
// single Locale values
- expected = new ArrayList<Object>();
+ expected = new ArrayList<>();
expected.add(Locale.FRENCH);
ListAssert.assertEquals(expected, conf.getLocaleList("locale.string"));
ListAssert.assertEquals(expected, conf.getLocaleList("locale.object"));
// empty list
- ListAssert.assertEquals(new ArrayList<Object>(), conf.getLocaleList("empty"));
+ ListAssert.assertEquals(new ArrayList<>(), conf.getLocaleList("empty"));
}
@Test
@@ -1483,7 +1483,7 @@ public class TestDataConfiguration
// missing list
ListAssert.assertEquals(null, conf.getColorList("color.list", null));
- List<Object> expected = new ArrayList<Object>();
+ List<Object> expected = new ArrayList<>();
expected.add(Color.red);
expected.add(Color.blue);
@@ -1506,13 +1506,13 @@ public class TestDataConfiguration
ListAssert.assertEquals(expected, conf.getColorList("color.list.interpolated"));
// single Color values
- expected = new ArrayList<Object>();
+ expected = new ArrayList<>();
expected.add(Color.red);
ListAssert.assertEquals(expected, conf.getColorList("color.string"));
ListAssert.assertEquals(expected, conf.getColorList("color.object"));
// empty list
- ListAssert.assertEquals(new ArrayList<Object>(), conf.getColorList("empty"));
+ ListAssert.assertEquals(new ArrayList<>(), conf.getColorList("empty"));
}
/**
@@ -1655,7 +1655,7 @@ public class TestDataConfiguration
List<Date> nullList = null;
ListAssert.assertEquals(null, conf.getDateList("date.list", nullList));
- List<Object> expected = new ArrayList<Object>();
+ List<Object> expected = new ArrayList<>();
expected.add(date1);
expected.add(date2);
@@ -1685,13 +1685,13 @@ public class TestDataConfiguration
ListAssert.assertEquals(expected, conf.getDateList("date.list.interpolated"));
// single Date values
- expected = new ArrayList<Object>();
+ expected = new ArrayList<>();
expected.add(date1);
ListAssert.assertEquals(expected, conf.getDateList("date.string"));
ListAssert.assertEquals(expected, conf.getDateList("date.object"));
// empty list
- ListAssert.assertEquals(new ArrayList<Object>(), conf.getDateList("empty"));
+ ListAssert.assertEquals(new ArrayList<>(), conf.getDateList("empty"));
}
@Test
@@ -1813,7 +1813,7 @@ public class TestDataConfiguration
List<Calendar> nullList = null;
ListAssert.assertEquals(null, conf.getCalendarList("calendar.list", nullList));
- List<Object> expected = new ArrayList<Object>();
+ List<Object> expected = new ArrayList<>();
expected.add(calendar1);
expected.add(calendar2);
@@ -1843,13 +1843,13 @@ public class TestDataConfiguration
ListAssert.assertEquals(expected, conf.getCalendarList("calendar.list.interpolated"));
// single Calendar values
- expected = new ArrayList<Object>();
+ expected = new ArrayList<>();
expected.add(calendar1);
ListAssert.assertEquals(expected, conf.getCalendarList("date.string"));
ListAssert.assertEquals(expected, conf.getCalendarList("date.object"));
// empty list
- ListAssert.assertEquals(new ArrayList<Object>(), conf.getCalendarList("empty"));
+ ListAssert.assertEquals(new ArrayList<>(), conf.getCalendarList("empty"));
}
@Test
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestDynamicCombinedConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestDynamicCombinedConfiguration.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestDynamicCombinedConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestDynamicCombinedConfiguration.java Mon Apr 10 21:56:46 2017
@@ -94,7 +94,7 @@ public class TestDynamicCombinedConfigur
config.setExpressionEngine(engine);
config.setKeyPattern(PATTERN);
ConfigurationBuilder<XMLConfiguration> multiBuilder =
- new MultiFileConfigurationBuilder<XMLConfiguration>(
+ new MultiFileConfigurationBuilder<>(
XMLConfiguration.class).configure(parameters
.multiFile()
.setFilePattern(PATTERN1)
@@ -548,7 +548,7 @@ public class TestDynamicCombinedConfigur
public static class ThreadLookup implements Lookup
{
- private static ThreadLocal<String> id = new ThreadLocal<String>();
+ private static ThreadLocal<String> id = new ThreadLocal<>();
public ThreadLookup()
{
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestHierarchicalConfigurationXMLReader.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestHierarchicalConfigurationXMLReader.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestHierarchicalConfigurationXMLReader.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestHierarchicalConfigurationXMLReader.java Mon Apr 10 21:56:46 2017
@@ -51,7 +51,7 @@ public class TestHierarchicalConfigurati
XMLConfiguration config = new XMLConfiguration();
FileHandler handler = new FileHandler(config);
handler.load(TEST_FILE);
- parser = new HierarchicalConfigurationXMLReader<ImmutableNode>(config);
+ parser = new HierarchicalConfigurationXMLReader<>(config);
}
@Test
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestINIConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestINIConfiguration.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestINIConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestINIConfiguration.java Mon Apr 10 21:56:46 2017
@@ -240,7 +240,7 @@ public class TestINIConfiguration
String input = MessageFormat.format(INI_DATA4, "=").trim();
String expectedOutput = MessageFormat.format(INI_DATA4, outputSeparator).trim();
- INIConfiguration instance = new FileBasedConfigurationBuilder<INIConfiguration>(
+ INIConfiguration instance = new FileBasedConfigurationBuilder<>(
INIConfiguration.class)
.configure(new Parameters().ini().setSeparatorUsedInOutput(outputSeparator))
.getConfiguration();
@@ -336,7 +336,7 @@ public class TestINIConfiguration
{
File file = writeTestFile(INI_DATA);
FileBasedConfigurationBuilder<INIConfiguration> builder =
- new FileBasedConfigurationBuilder<INIConfiguration>(
+ new FileBasedConfigurationBuilder<>(
INIConfiguration.class);
builder.configure(new FileBasedBuilderParametersImpl()
.setFile(file));
@@ -417,7 +417,7 @@ public class TestINIConfiguration
INIConfiguration instance = new INIConfiguration();
instance.addProperty("test1.foo", "bar");
instance.addProperty("test2.foo", "abc");
- Set<String> expResult = new HashSet<String>();
+ Set<String> expResult = new HashSet<>();
expResult.add("test1");
expResult.add("test2");
Set<String> result = instance.getSections();
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestImmutableConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestImmutableConfiguration.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestImmutableConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestImmutableConfiguration.java Mon Apr 10 21:56:46 2017
@@ -61,7 +61,7 @@ public class TestImmutableConfiguration
private static PropertiesConfiguration createTestConfig()
throws ConfigurationException
{
- return new FileBasedConfigurationBuilder<PropertiesConfiguration>(
+ return new FileBasedConfigurationBuilder<>(
PropertiesConfiguration.class).configure(
new FileBasedBuilderParametersImpl().setFile(ConfigurationAssert
.getTestFile(TEST_FILE))).getConfiguration();
@@ -114,7 +114,7 @@ public class TestImmutableConfiguration
*/
private static Set<String> fetchKeys(Iterator<String> it)
{
- Set<String> keys = new HashSet<String>();
+ Set<String> keys = new HashSet<>();
while (it.hasNext())
{
keys.add(it.next());
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestJNDIConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestJNDIConfiguration.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestJNDIConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestJNDIConfiguration.java Mon Apr 10 21:56:46 2017
@@ -314,7 +314,7 @@ public class TestJNDIConfiguration {
@Test
public void testGetKeysWithCycles() throws NamingException
{
- Hashtable<Object, Object> env = new Hashtable<Object, Object>();
+ Hashtable<Object, Object> env = new Hashtable<>();
env.put(MockInitialContextFactory.PROP_CYCLES, Boolean.TRUE);
InitialContext initCtx = new InitialContext(env);
JNDIConfiguration c = new JNDIConfiguration(initCtx);
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestMapConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestMapConfiguration.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestMapConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestMapConfiguration.java Mon Apr 10 21:56:46 2017
@@ -51,7 +51,7 @@ public class TestMapConfiguration extend
@Override
protected AbstractConfiguration getConfiguration()
{
- Map<String, Object> map = new HashMap<String, Object>();
+ Map<String, Object> map = new HashMap<>();
map.put(KEY, "value1");
map.put("key2", "value2");
map.put("list", "value1, value2");
@@ -71,7 +71,7 @@ public class TestMapConfiguration extend
@Test
public void testGetMap()
{
- Map<String, Object> map = new HashMap<String, Object>();
+ Map<String, Object> map = new HashMap<>();
MapConfiguration conf = new MapConfiguration(map);
assertEquals(map, conf.getMap());
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestNullCompositeConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestNullCompositeConfiguration.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestNullCompositeConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestNullCompositeConfiguration.java Mon Apr 10 21:56:46 2017
@@ -280,7 +280,7 @@ public class TestNullCompositeConfigurat
// we should get 3 packages here
assertEquals(3, packages.size());
- List<Object> defaultList = new ArrayList<Object>();
+ List<Object> defaultList = new ArrayList<>();
defaultList.add("1");
defaultList.add("2");
@@ -371,12 +371,12 @@ public class TestNullCompositeConfigurat
public void testGetKeysPreservesOrder() throws Exception
{
cc.addConfiguration(conf1);
- List<String> orderedList = new ArrayList<String>();
+ List<String> orderedList = new ArrayList<>();
for (Iterator<String> keys = conf1.getKeys(); keys.hasNext();)
{
orderedList.add(keys.next());
}
- List<String> iteratedList = new ArrayList<String>();
+ List<String> iteratedList = new ArrayList<>();
for (Iterator<String> keys = cc.getKeys(); keys.hasNext();)
{
iteratedList.add(keys.next());
@@ -395,12 +395,12 @@ public class TestNullCompositeConfigurat
public void testGetKeys2PreservesOrder() throws Exception
{
cc.addConfiguration(conf1);
- List<String> orderedList = new ArrayList<String>();
+ List<String> orderedList = new ArrayList<>();
for (Iterator<String> keys = conf1.getKeys("test"); keys.hasNext();)
{
orderedList.add(keys.next());
}
- List<String> iteratedList = new ArrayList<String>();
+ List<String> iteratedList = new ArrayList<>();
for (Iterator<String> keys = cc.getKeys("test"); keys.hasNext();)
{
iteratedList.add(keys.next());
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestPropertiesConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestPropertiesConfiguration.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestPropertiesConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestPropertiesConfiguration.java Mon Apr 10 21:56:46 2017
@@ -265,7 +265,7 @@ public class TestPropertiesConfiguration
{
// add an array of strings to the configuration
conf.addProperty("string", "value1");
- List<Object> list = new ArrayList<Object>();
+ List<Object> list = new ArrayList<>();
for (int i = 1; i < 5; i++)
{
list.add("value" + i);
@@ -301,7 +301,7 @@ public class TestPropertiesConfiguration
conf = new PropertiesConfiguration();
// add an array of strings to the configuration
conf.addProperty("string", "value1");
- List<Object> list = new ArrayList<Object>();
+ List<Object> list = new ArrayList<>();
for (int i = 1; i < 5; i++)
{
list.add("value" + i);
@@ -894,7 +894,7 @@ public class TestPropertiesConfiguration
@Test
public void testSetIOFactoryWriter() throws ConfigurationException, IOException
{
- final MutableObject<Writer> propertiesWriter = new MutableObject<Writer>();
+ final MutableObject<Writer> propertiesWriter = new MutableObject<>();
conf.setIOFactory(new PropertiesConfiguration.IOFactory()
{
@Override
@@ -938,7 +938,7 @@ public class TestPropertiesConfiguration
"test.separator.tab\tfoo", "test.separator.whitespace foo",
"test.separator.no.space=foo"
};
- Set<String> foundLines = new HashSet<String>();
+ Set<String> foundLines = new HashSet<>();
BufferedReader in = new BufferedReader(new FileReader(
testSavePropertiesFile));
try
@@ -1150,7 +1150,7 @@ public class TestPropertiesConfiguration
};
Parameters params = new Parameters();
FileBasedConfigurationBuilder<PropertiesConfiguration> builder =
- new FileBasedConfigurationBuilder<PropertiesConfiguration>(
+ new FileBasedConfigurationBuilder<>(
PropertiesConfiguration.class);
builder.configure(params.fileBased().setFile(testSavePropertiesFile)
.setBasePath(ConfigurationAssert.OUT_DIR.toURI().toString())
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestSubnodeConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestSubnodeConfiguration.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestSubnodeConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestSubnodeConfiguration.java Mon Apr 10 21:56:46 2017
@@ -234,7 +234,7 @@ public class TestSubnodeConfiguration
public void testGetKeys()
{
setUpSubnodeConfig();
- Set<String> keys = new HashSet<String>();
+ Set<String> keys = new HashSet<>();
keys.addAll(ConfigurationAssert.keysToList(config));
assertEquals("Incorrect number of keys", 2, keys.size());
assertTrue("Key 1 not contained", keys.contains("name"));
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestSubsetConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestSubsetConfiguration.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestSubsetConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestSubsetConfiguration.java Mon Apr 10 21:56:46 2017
@@ -160,7 +160,7 @@ public class TestSubsetConfiguration
conf.addProperty("test.abc", "value3");
Configuration subset = new SubsetConfiguration(conf, "test", ".");
- List<Object> list = subset.getList("abc", new ArrayList<Object>());
+ List<Object> list = subset.getList("abc", new ArrayList<>());
assertEquals(3, list.size());
}
@@ -238,7 +238,7 @@ public class TestSubsetConfiguration
assertTrue(subConf.getKeys().hasNext());
Configuration subSubConf = subConf.subset("fields.field(1)");
Iterator<String> itKeys = subSubConf.getKeys();
- Set<String> keys = new HashSet<String>();
+ Set<String> keys = new HashSet<>();
keys.add("name");
keys.add("type");
while(itKeys.hasNext())
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestXMLConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestXMLConfiguration.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestXMLConfiguration.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestXMLConfiguration.java Mon Apr 10 21:56:46 2017
@@ -426,7 +426,7 @@ public class TestXMLConfiguration
// If the file does not exist, an empty config is created
assertFalse("File exists", testSaveConf.exists());
FileBasedConfigurationBuilder<XMLConfiguration> builder =
- new FileBasedConfigurationBuilder<XMLConfiguration>(
+ new FileBasedConfigurationBuilder<>(
XMLConfiguration.class, null, true);
builder.configure(new FileBasedBuilderParametersImpl()
.setFile(testSaveConf));
@@ -1132,7 +1132,7 @@ public class TestXMLConfiguration
public void testAutoSaveWithSubnodeConfig() throws ConfigurationException
{
FileBasedConfigurationBuilder<XMLConfiguration> builder =
- new FileBasedConfigurationBuilder<XMLConfiguration>(
+ new FileBasedConfigurationBuilder<>(
XMLConfiguration.class);
builder.configure(new FileBasedBuilderParametersImpl()
.setFileName(testProperties));
@@ -1158,7 +1158,7 @@ public class TestXMLConfiguration
public void testAutoSaveWithSubSubnodeConfig() throws ConfigurationException
{
FileBasedConfigurationBuilder<XMLConfiguration> builder =
- new FileBasedConfigurationBuilder<XMLConfiguration>(
+ new FileBasedConfigurationBuilder<>(
XMLConfiguration.class);
builder.configure(new FileBasedBuilderParametersImpl()
.setFileName(testProperties));
@@ -1260,7 +1260,7 @@ public class TestXMLConfiguration
public void testAutoSaveAddNodes() throws ConfigurationException
{
FileBasedConfigurationBuilder<XMLConfiguration> builder =
- new FileBasedConfigurationBuilder<XMLConfiguration>(
+ new FileBasedConfigurationBuilder<>(
XMLConfiguration.class);
builder.configure(new FileBasedBuilderParametersImpl()
.setFileName(testProperties));
@@ -1269,7 +1269,7 @@ public class TestXMLConfiguration
builder.setAutoSave(true);
ImmutableNode node = NodeStructureHelper.createNode(
"addNodesTest", Boolean.TRUE);
- Collection<ImmutableNode> nodes = new ArrayList<ImmutableNode>(1);
+ Collection<ImmutableNode> nodes = new ArrayList<>(1);
nodes.add(node);
conf.addNodes("test.autosave", nodes);
XMLConfiguration c2 = new XMLConfiguration();
@@ -1477,7 +1477,7 @@ public class TestXMLConfiguration
InterruptedException
{
FileBasedConfigurationBuilder<XMLConfiguration> builder =
- new FileBasedConfigurationBuilder<XMLConfiguration>(
+ new FileBasedConfigurationBuilder<>(
XMLConfiguration.class);
builder.configure(new FileBasedBuilderParametersImpl()
.setFileName(testProperties));
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestXMLDocumentHelper.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestXMLDocumentHelper.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestXMLDocumentHelper.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/TestXMLDocumentHelper.java Mon Apr 10 21:56:46 2017
@@ -303,7 +303,7 @@ public class TestXMLDocumentHelper
*/
private static Collection<Node> findTextElements(Document document)
{
- Collection<Node> texts = new HashSet<Node>();
+ Collection<Node> texts = new HashSet<>();
findTextElementsForNode(document.getDocumentElement(), texts);
return texts;
}
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/beanutils/BeanCreationTestBeanWithListChild.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/beanutils/BeanCreationTestBeanWithListChild.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/beanutils/BeanCreationTestBeanWithListChild.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/beanutils/BeanCreationTestBeanWithListChild.java Mon Apr 10 21:56:46 2017
@@ -31,7 +31,7 @@ public class BeanCreationTestBeanWithLis
private int intValue;
- private final List<BeanCreationTestBean> children = new ArrayList<BeanCreationTestBean>();
+ private final List<BeanCreationTestBean> children = new ArrayList<>();
public List<BeanCreationTestBean> getChildren()
{
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/beanutils/TestBeanHelper.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/beanutils/TestBeanHelper.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/beanutils/TestBeanHelper.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/beanutils/TestBeanHelper.java Mon Apr 10 21:56:46 2017
@@ -413,18 +413,18 @@ public class TestBeanHelper
private BeanDeclarationTestImpl setUpBeanDeclaration()
{
BeanDeclarationTestImpl data = new BeanDeclarationTestImpl();
- Map<String, Object> properties = new HashMap<String, Object>();
+ Map<String, Object> properties = new HashMap<>();
properties.put("stringValue", TEST_STRING);
properties.put("intValue", String.valueOf(TEST_INT));
data.setBeanProperties(properties);
BeanDeclarationTestImpl buddyData = new BeanDeclarationTestImpl();
- Map<String, Object> properties2 = new HashMap<String, Object>();
+ Map<String, Object> properties2 = new HashMap<>();
properties2.put("stringValue", "Another test string");
properties2.put("intValue", new Integer(100));
buddyData.setBeanProperties(properties2);
buddyData.setBeanClassName(BeanCreationTestBean.class.getName());
- Map<String, Object> nested = new HashMap<String, Object>();
+ Map<String, Object> nested = new HashMap<>();
nested.put("buddy", buddyData);
data.setNestedBeanDeclarations(nested);
return data;
@@ -440,15 +440,15 @@ public class TestBeanHelper
private BeanDeclarationTestImpl setUpBeanDeclarationWithListChild()
{
BeanDeclarationTestImpl data = new BeanDeclarationTestImpl();
- Map<String, Object> properties = new HashMap<String, Object>();
+ Map<String, Object> properties = new HashMap<>();
properties.put("stringValue", TEST_STRING);
properties.put("intValue", String.valueOf(TEST_INT));
data.setBeanProperties(properties);
- List<BeanDeclaration> childData = new ArrayList<BeanDeclaration>();
+ List<BeanDeclaration> childData = new ArrayList<>();
childData.add(createChildBean("child1"));
childData.add(createChildBean("child2"));
- Map<String, Object> nested = new HashMap<String, Object>();
+ Map<String, Object> nested = new HashMap<>();
nested.put("children", childData);
data.setNestedBeanDeclarations(nested);
return data;
@@ -464,7 +464,7 @@ public class TestBeanHelper
private BeanDeclarationTestImpl createChildBean(String name)
{
BeanDeclarationTestImpl childBean = new BeanDeclarationTestImpl();
- Map<String, Object> properties2 = new HashMap<String, Object>();
+ Map<String, Object> properties2 = new HashMap<>();
properties2.put("stringValue", name + " Another test string");
properties2.put("intValue", new Integer(100));
childBean.setBeanProperties(properties2);
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/beanutils/TestCombinedBeanDeclaration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/beanutils/TestCombinedBeanDeclaration.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/beanutils/TestCombinedBeanDeclaration.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/beanutils/TestCombinedBeanDeclaration.java Mon Apr 10 21:56:46 2017
@@ -211,9 +211,9 @@ public class TestCombinedBeanDeclaration
@Test
public void testGetBeanProperties()
{
- Map<String, Object> props1 = new HashMap<String, Object>();
- Map<String, Object> props2 = new HashMap<String, Object>();
- Map<String, Object> props3 = new HashMap<String, Object>();
+ Map<String, Object> props1 = new HashMap<>();
+ Map<String, Object> props2 = new HashMap<>();
+ Map<String, Object> props3 = new HashMap<>();
props1.put("param1", "value1");
props1.put("param2", "value2");
props2.put("param2", "othervalue");
@@ -254,9 +254,9 @@ public class TestCombinedBeanDeclaration
@Test
public void testGetNestedBeanDeclarations()
{
- Map<String, Object> decls1 = new HashMap<String, Object>();
- Map<String, Object> decls2 = new HashMap<String, Object>();
- Map<String, Object> decls3 = new HashMap<String, Object>();
+ Map<String, Object> decls1 = new HashMap<>();
+ Map<String, Object> decls2 = new HashMap<>();
+ Map<String, Object> decls3 = new HashMap<>();
decls1.put("param1", "value1");
decls1.put("param2", "value2");
decls2.put("param2", "othervalue");
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/beanutils/TestDefaultBeanFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/beanutils/TestDefaultBeanFactory.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/beanutils/TestDefaultBeanFactory.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/beanutils/TestDefaultBeanFactory.java Mon Apr 10 21:56:46 2017
@@ -152,7 +152,7 @@ public class TestDefaultBeanFactory
public void testCreateBean() throws Exception
{
BeanDeclarationTestImpl decl = new BeanDeclarationTestImpl();
- Map<String, Object> props = new HashMap<String, Object>();
+ Map<String, Object> props = new HashMap<>();
props.put("throwExceptionOnMissing", Boolean.TRUE);
decl.setBeanProperties(props);
Object bean = factory.createBean(createBcc(PropertiesConfiguration.class, decl));
@@ -171,7 +171,7 @@ public class TestDefaultBeanFactory
public void testCreateBeanConstructor() throws Exception
{
BeanDeclarationTestImpl decl = new BeanDeclarationTestImpl();
- Collection<ConstructorArg> args = new ArrayList<ConstructorArg>();
+ Collection<ConstructorArg> args = new ArrayList<>();
args.add(ConstructorArg.forValue("test"));
args.add(ConstructorArg.forValue("42"));
decl.setConstructorArgs(args);
@@ -190,7 +190,7 @@ public class TestDefaultBeanFactory
public void testCreateBeanConstructorNestedBean() throws Exception
{
BeanDeclarationTestImpl declNested = new BeanDeclarationTestImpl();
- Collection<ConstructorArg> args = new ArrayList<ConstructorArg>();
+ Collection<ConstructorArg> args = new ArrayList<>();
args.add(ConstructorArg.forValue("test", String.class.getName()));
declNested.setConstructorArgs(args);
declNested.setBeanClassName(BeanCreationTestCtorBean.class.getName());
@@ -227,7 +227,7 @@ public class TestDefaultBeanFactory
public void testFindMatchingConstructorArgCount()
{
BeanDeclarationTestImpl decl = new BeanDeclarationTestImpl();
- Collection<ConstructorArg> args = new ArrayList<ConstructorArg>();
+ Collection<ConstructorArg> args = new ArrayList<>();
args.add(ConstructorArg.forValue(TEST_STRING));
args.add(ConstructorArg.forValue(String.valueOf(TEST_INT)));
decl.setConstructorArgs(args);
@@ -246,7 +246,7 @@ public class TestDefaultBeanFactory
public void testFindMatchingConstructorAmbiguous()
{
BeanDeclarationTestImpl decl = new BeanDeclarationTestImpl();
- Collection<ConstructorArg> args = new ArrayList<ConstructorArg>();
+ Collection<ConstructorArg> args = new ArrayList<>();
args.add(ConstructorArg.forValue(TEST_STRING));
decl.setConstructorArgs(args);
DefaultBeanFactory.findMatchingConstructor(BeanCreationTestCtorBean.class, decl);
@@ -260,7 +260,7 @@ public class TestDefaultBeanFactory
public void testFindMatchingConstructorExplicitType()
{
BeanDeclarationTestImpl decl = new BeanDeclarationTestImpl();
- Collection<ConstructorArg> args = new ArrayList<ConstructorArg>();
+ Collection<ConstructorArg> args = new ArrayList<>();
args.add(ConstructorArg.forBeanDeclaration(setUpBeanDeclaration(),
BeanCreationTestBean.class.getName()));
decl.setConstructorArgs(args);
@@ -279,18 +279,18 @@ public class TestDefaultBeanFactory
private static BeanDeclarationTestImpl setUpBeanDeclaration()
{
BeanDeclarationTestImpl data = new BeanDeclarationTestImpl();
- Map<String, Object> properties = new HashMap<String, Object>();
+ Map<String, Object> properties = new HashMap<>();
properties.put("stringValue", TEST_STRING);
properties.put("intValue", String.valueOf(TEST_INT));
data.setBeanProperties(properties);
BeanDeclarationTestImpl buddyData = new BeanDeclarationTestImpl();
- Map<String, Object> properties2 = new HashMap<String, Object>();
+ Map<String, Object> properties2 = new HashMap<>();
properties2.put("stringValue", "Another test string");
properties2.put("intValue", new Integer(100));
buddyData.setBeanProperties(properties2);
buddyData.setBeanClassName(BeanCreationTestBean.class.getName());
- Map<String, Object> nested = new HashMap<String, Object>();
+ Map<String, Object> nested = new HashMap<>();
nested.put("buddy", buddyData);
data.setNestedBeanDeclarations(nested);
return data;
@@ -303,7 +303,7 @@ public class TestDefaultBeanFactory
public void testFindMatchingConstructorNoMatch()
{
BeanDeclarationTestImpl decl = new BeanDeclarationTestImpl();
- Collection<ConstructorArg> args = new ArrayList<ConstructorArg>();
+ Collection<ConstructorArg> args = new ArrayList<>();
args.add(ConstructorArg.forValue(TEST_STRING, getClass().getName()));
decl.setConstructorArgs(args);
try
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/BuilderEventListenerImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/BuilderEventListenerImpl.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/BuilderEventListenerImpl.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/BuilderEventListenerImpl.java Mon Apr 10 21:56:46 2017
@@ -39,7 +39,7 @@ public class BuilderEventListenerImpl im
{
/** A list with the received events. */
private final List<ConfigurationBuilderEvent> events =
- new LinkedList<ConfigurationBuilderEvent>();
+ new LinkedList<>();
/** An iterator for inspecting the received events. */
private Iterator<ConfigurationBuilderEvent> iterator;
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/TestBasicBuilderParameters.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/TestBasicBuilderParameters.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/TestBasicBuilderParameters.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/TestBasicBuilderParameters.java Mon Apr 10 21:56:46 2017
@@ -79,7 +79,7 @@ public class TestBasicBuilderParameters
public void testGetParametersDefensiveCopy()
{
Map<String, Object> map1 = params.getParameters();
- Map<String, Object> mapCopy = new HashMap<String, Object>(map1);
+ Map<String, Object> mapCopy = new HashMap<>(map1);
map1.put("otherProperty", "value");
Map<String, Object> map2 = params.getParameters();
assertNotSame("Same map returned", map1, map2);
@@ -255,7 +255,7 @@ public class TestBasicBuilderParameters
{
ListDelimiterHandler handler1 = EasyMock.createMock(ListDelimiterHandler.class);
ListDelimiterHandler handler2 = EasyMock.createMock(ListDelimiterHandler.class);
- Map<String, Object> props = new HashMap<String, Object>();
+ Map<String, Object> props = new HashMap<>();
props.put("throwExceptionOnMissing", Boolean.TRUE);
props.put("listDelimiterHandler", handler1);
props.put("other", "test");
@@ -289,7 +289,7 @@ public class TestBasicBuilderParameters
Lookup l1 = EasyMock.createMock(Lookup.class);
Lookup l2 = EasyMock.createMock(Lookup.class);
Lookup l3 = EasyMock.createMock(Lookup.class);
- Map<String, Lookup> prefixLookups = new HashMap<String, Lookup>();
+ Map<String, Lookup> prefixLookups = new HashMap<>();
prefixLookups.put("p1", l1);
prefixLookups.put("p2", l2);
Collection<Lookup> defLookups = Collections.singleton(l3);
@@ -332,7 +332,7 @@ public class TestBasicBuilderParameters
@Test(expected = IllegalArgumentException.class)
public void testFetchInterpolatorSpecificationInvalidDataType()
{
- Map<String, Object> map = new HashMap<String, Object>();
+ Map<String, Object> map = new HashMap<>();
map.put("interpolator", this);
BasicBuilderParameters.fetchInterpolatorSpecification(map);
}
@@ -344,8 +344,8 @@ public class TestBasicBuilderParameters
@Test(expected = IllegalArgumentException.class)
public void testFetchInterpolatorSpecificationInvalidMapKey()
{
- Map<String, Object> map = new HashMap<String, Object>();
- Map<Object, Object> prefix = new HashMap<Object, Object>();
+ Map<String, Object> map = new HashMap<>();
+ Map<Object, Object> prefix = new HashMap<>();
prefix.put(42, EasyMock.createMock(Lookup.class));
map.put("prefixLookups", prefix);
BasicBuilderParameters.fetchInterpolatorSpecification(map);
@@ -358,8 +358,8 @@ public class TestBasicBuilderParameters
@Test(expected = IllegalArgumentException.class)
public void testFetchInterpolatorSpecificationInvalidMapValue()
{
- Map<String, Object> map = new HashMap<String, Object>();
- Map<Object, Object> prefix = new HashMap<Object, Object>();
+ Map<String, Object> map = new HashMap<>();
+ Map<Object, Object> prefix = new HashMap<>();
prefix.put("test", this);
map.put("prefixLookups", prefix);
BasicBuilderParameters.fetchInterpolatorSpecification(map);
@@ -372,7 +372,7 @@ public class TestBasicBuilderParameters
@Test(expected = IllegalArgumentException.class)
public void testFetchInterpolatorSpecificationInvalidCollectionValue()
{
- Map<String, Object> map = new HashMap<String, Object>();
+ Map<String, Object> map = new HashMap<>();
map.put("defaultLookups", Collections.singleton("not a lookup"));
BasicBuilderParameters.fetchInterpolatorSpecification(map);
}
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/TestBasicConfigurationBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/TestBasicConfigurationBuilder.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/TestBasicConfigurationBuilder.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/TestBasicConfigurationBuilder.java Mon Apr 10 21:56:46 2017
@@ -90,7 +90,7 @@ public class TestBasicConfigurationBuild
*/
private static Map<String, Object> createTestParameters()
{
- Map<String, Object> params = new HashMap<String, Object>();
+ Map<String, Object> params = new HashMap<>();
params.put("throwExceptionOnMissing", Boolean.TRUE);
params.put("listDelimiterHandler", listHandler);
return params;
@@ -107,7 +107,7 @@ public class TestBasicConfigurationBuild
new BasicConfigurationBuilder<Configuration>(
PropertiesConfiguration.class, params);
Map<String, Object> params2 =
- new HashMap<String, Object>(builder.getParameters());
+ new HashMap<>(builder.getParameters());
assertEquals("Wrong parameters", createTestParameters(), params2);
}
@@ -119,11 +119,11 @@ public class TestBasicConfigurationBuild
{
Map<String, Object> params = createTestParameters();
BasicConfigurationBuilder<PropertiesConfiguration> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class, params);
params.put("anotherParameter", "value");
Map<String, Object> params2 =
- new HashMap<String, Object>(builder.getParameters());
+ new HashMap<>(builder.getParameters());
assertEquals("Wrong parameters", createTestParameters(), params2);
}
@@ -134,7 +134,7 @@ public class TestBasicConfigurationBuild
public void testInitWithParametersNull()
{
BasicConfigurationBuilder<PropertiesConfiguration> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class, null);
assertTrue("Got parameters", builder.getParameters().isEmpty());
}
@@ -146,7 +146,7 @@ public class TestBasicConfigurationBuild
public void testGetParametersModify()
{
BasicConfigurationBuilder<PropertiesConfiguration> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class, createTestParameters());
builder.getParameters().clear();
}
@@ -158,13 +158,13 @@ public class TestBasicConfigurationBuild
public void testConfigure()
{
BasicConfigurationBuilder<PropertiesConfiguration> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class)
.configure(new BasicBuilderParameters()
.setListDelimiterHandler(listHandler)
.setThrowExceptionOnMissing(true));
Map<String, Object> params2 =
- new HashMap<String, Object>(builder.getParameters());
+ new HashMap<>(builder.getParameters());
assertEquals("Wrong parameters", createTestParameters(), params2);
}
@@ -174,15 +174,15 @@ public class TestBasicConfigurationBuild
@Test
public void testSetParameters()
{
- Map<String, Object> params1 = new HashMap<String, Object>();
+ Map<String, Object> params1 = new HashMap<>();
params1.put("someParameter", "value");
BasicConfigurationBuilder<PropertiesConfiguration> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class, params1);
assertSame("Wrong result", builder,
builder.setParameters(createTestParameters()));
Map<String, Object> params2 =
- new HashMap<String, Object>(builder.getParameters());
+ new HashMap<>(builder.getParameters());
assertEquals("Wrong parameters", createTestParameters(), params2);
}
@@ -193,7 +193,7 @@ public class TestBasicConfigurationBuild
public void testAddParameters()
{
BasicConfigurationBuilder<PropertiesConfiguration> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class, createTestParameters());
Map<String, Object> params = createTestParameters();
params.put("anotherParameter", "value");
@@ -212,7 +212,7 @@ public class TestBasicConfigurationBuild
public void testAddParametersNull()
{
BasicConfigurationBuilder<PropertiesConfiguration> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class, createTestParameters());
Map<String, Object> params = builder.getParameters();
builder.addParameters(null);
@@ -226,7 +226,7 @@ public class TestBasicConfigurationBuild
public void testResetParameters()
{
BasicConfigurationBuilder<PropertiesConfiguration> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class, createTestParameters());
builder.resetParameters();
assertTrue("Still got parameters", builder.getParameters().isEmpty());
@@ -240,7 +240,7 @@ public class TestBasicConfigurationBuild
public void testGetConfiguration() throws ConfigurationException
{
PropertiesConfiguration config =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class).configure(
new BasicBuilderParameters().setListDelimiterHandler(
listHandler).setThrowExceptionOnMissing(true))
@@ -261,7 +261,7 @@ public class TestBasicConfigurationBuild
CountDownLatch startLatch = new CountDownLatch(1);
CountDownLatch endLatch = new CountDownLatch(threadCount);
ConfigurationBuilder<?> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class);
AccessBuilderThread[] threads = new AccessBuilderThread[threadCount];
for (int i = 0; i < threadCount; i++)
@@ -271,7 +271,7 @@ public class TestBasicConfigurationBuild
}
startLatch.countDown();
assertTrue("Timeout", endLatch.await(5, TimeUnit.SECONDS));
- Set<Object> results = new HashSet<Object>();
+ Set<Object> results = new HashSet<>();
for (AccessBuilderThread t : threads)
{
results.add(t.result);
@@ -286,7 +286,7 @@ public class TestBasicConfigurationBuild
public void testResetResult() throws ConfigurationException
{
BasicConfigurationBuilder<PropertiesConfiguration> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class, createTestParameters());
PropertiesConfiguration config = builder.getConfiguration();
builder.resetResult();
@@ -302,7 +302,7 @@ public class TestBasicConfigurationBuild
public void testReset() throws ConfigurationException
{
BasicConfigurationBuilder<PropertiesConfiguration> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class, createTestParameters());
PropertiesConfiguration config = builder.getConfiguration();
builder.reset();
@@ -357,7 +357,7 @@ public class TestBasicConfigurationBuild
EventListener<ConfigurationEvent> l2 = createEventListener();
EasyMock.replay(l1, l2);
BasicConfigurationBuilder<PropertiesConfiguration> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class);
builder.addEventListener(ConfigurationEvent.ANY, l1);
PropertiesConfiguration config = builder.getConfiguration();
@@ -378,7 +378,7 @@ public class TestBasicConfigurationBuild
EventListener<ConfigurationEvent> l2 = createEventListener();
EasyMock.replay(l1, l2);
BasicConfigurationBuilder<PropertiesConfiguration> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class);
builder.addEventListener(ConfigurationEvent.ANY_HIERARCHICAL,
l1);
@@ -408,13 +408,13 @@ public class TestBasicConfigurationBuild
EventListener<ConfigurationEvent> l2 = createEventListener();
EventListener<ConfigurationErrorEvent> l3 = new ErrorListenerTestImpl(null);
BasicConfigurationBuilder<PropertiesConfiguration> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class);
builder.addEventListener(ConfigurationEvent.ANY, l1);
builder.addEventListener(ConfigurationEvent.ANY_HIERARCHICAL, l2);
builder.addEventListener(ConfigurationErrorEvent.ANY, l3);
BasicConfigurationBuilder<XMLConfiguration> builder2 =
- new BasicConfigurationBuilder<XMLConfiguration>(
+ new BasicConfigurationBuilder<>(
XMLConfiguration.class);
builder.copyEventListeners(builder2);
XMLConfiguration config = builder2.getConfiguration();
@@ -443,11 +443,11 @@ public class TestBasicConfigurationBuild
{
EventListenerTestImpl listener1 = new EventListenerTestImpl(null);
EventListenerRegistrationData<ConfigurationErrorEvent> regData =
- new EventListenerRegistrationData<ConfigurationErrorEvent>(
+ new EventListenerRegistrationData<>(
ConfigurationErrorEvent.WRITE,
new ErrorListenerTestImpl(null));
BasicConfigurationBuilder<PropertiesConfiguration> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class)
.configure(new EventListenerParameters()
.addEventListener(ConfigurationEvent.ANY,
@@ -471,7 +471,7 @@ public class TestBasicConfigurationBuild
{
EventListenerTestImpl listener = new EventListenerTestImpl(null);
BasicConfigurationBuilder<PropertiesConfiguration> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class)
.configure(new EventListenerParameters()
.addEventListener(ConfigurationEvent.ANY,
@@ -489,11 +489,11 @@ public class TestBasicConfigurationBuild
@Test
public void testReservedParameter() throws ConfigurationException
{
- Map<String, Object> params = new HashMap<String, Object>();
+ Map<String, Object> params = new HashMap<>();
params.put("throwExceptionOnMissing", Boolean.TRUE);
params.put("config-test", "a test");
BasicConfigurationBuilder<PropertiesConfiguration> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class, params);
PropertiesConfiguration config = builder.getConfiguration();
assertTrue("Flag not set", config.isThrowExceptionOnMissing());
@@ -533,7 +533,7 @@ public class TestBasicConfigurationBuild
public void testInitializableCalled() throws ConfigurationException
{
BasicConfigurationBuilder<InitializableConfiguration> builder =
- new BasicConfigurationBuilder<InitializableConfiguration>(
+ new BasicConfigurationBuilder<>(
InitializableConfiguration.class);
builder.configure(new BasicBuilderParameters()
.setThrowExceptionOnMissing(true));
@@ -548,7 +548,7 @@ public class TestBasicConfigurationBuild
@Test
public void testBeanHelperInConfiguration() throws ConfigurationException
{
- final Set<Class<?>> classesPassedToFactory = new HashSet<Class<?>>();
+ final Set<Class<?>> classesPassedToFactory = new HashSet<>();
BeanFactory factory = new DefaultBeanFactory()
{
@Override
@@ -560,7 +560,7 @@ public class TestBasicConfigurationBuild
};
BeanHelper helper = new BeanHelper(factory);
BasicConfigurationBuilder<PropertiesConfiguration> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class);
builder.configure(new BasicBuilderParameters().setBeanHelper(helper));
PropertiesConfiguration config = builder.getConfiguration();
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/TestBasicConfigurationBuilderEvents.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/TestBasicConfigurationBuilderEvents.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/TestBasicConfigurationBuilderEvents.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/TestBasicConfigurationBuilderEvents.java Mon Apr 10 21:56:46 2017
@@ -70,7 +70,7 @@ public class TestBasicConfigurationBuild
{
BuilderEventListenerImpl listener = new BuilderEventListenerImpl();
BasicConfigurationBuilder<PropertiesConfiguration> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class);
builder.addEventListener(ConfigurationBuilderEvent.RESET, listener);
@@ -92,7 +92,7 @@ public class TestBasicConfigurationBuild
{
BuilderEventListenerImpl listener = new BuilderEventListenerImpl();
BasicConfigurationBuilder<PropertiesConfiguration> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class);
builder.addEventListener(ConfigurationBuilderEvent.RESET, listener);
@@ -111,7 +111,7 @@ public class TestBasicConfigurationBuild
public void testRemoveEventListenerNotExisting()
{
BasicConfigurationBuilder<PropertiesConfiguration> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class);
BuilderEventListenerImpl listener = new BuilderEventListenerImpl();
builder.addEventListener(ConfigurationBuilderEvent.RESET, listener);
@@ -139,7 +139,7 @@ public class TestBasicConfigurationBuild
public void testConfigurationRequestEvent() throws ConfigurationException
{
BasicConfigurationBuilder<PropertiesConfiguration> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class);
builder.getConfiguration();
BuilderEventListenerImpl listener = new BuilderEventListenerImpl();
@@ -161,7 +161,7 @@ public class TestBasicConfigurationBuild
throws ConfigurationException
{
final BasicConfigurationBuilder<PropertiesConfiguration> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class);
PropertiesConfiguration configuration = builder.getConfiguration();
BuilderEventListenerImpl listener = new BuilderEventListenerImpl();
@@ -191,7 +191,7 @@ public class TestBasicConfigurationBuild
public void testResultCreatedEventNoConfiguration()
{
new ConfigurationBuilderResultCreatedEvent(
- new BasicConfigurationBuilder<Configuration>(
+ new BasicConfigurationBuilder<>(
Configuration.class),
ConfigurationBuilderResultCreatedEvent.RESULT_CREATED, null);
}
@@ -214,7 +214,7 @@ public class TestBasicConfigurationBuild
public void testResultCreatedEvent() throws ConfigurationException
{
BasicConfigurationBuilder<PropertiesConfiguration> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class);
BuilderEventListenerImpl listener = new BuilderEventListenerImpl();
builder.addEventListener(ConfigurationBuilderEvent.ANY, listener);
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/TestBuilderConfigurationWrapperFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/TestBuilderConfigurationWrapperFactory.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/TestBuilderConfigurationWrapperFactory.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/TestBuilderConfigurationWrapperFactory.java Mon Apr 10 21:56:46 2017
@@ -151,7 +151,7 @@ public class TestBuilderConfigurationWra
public void testEventSourceSupportBuilder() throws ConfigurationException
{
BasicConfigurationBuilder<PropertiesConfiguration> builder =
- new BasicConfigurationBuilder<PropertiesConfiguration>(
+ new BasicConfigurationBuilder<>(
PropertiesConfiguration.class);
EventListener<ConfigurationEvent> l1 = new EventListenerTestImpl(null);
EventListener<ConfigurationEvent> l2 = new EventListenerTestImpl(null);
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/TestEventListenerParameters.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/TestEventListenerParameters.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/TestEventListenerParameters.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/TestEventListenerParameters.java Mon Apr 10 21:56:46 2017
@@ -80,7 +80,7 @@ public class TestEventListenerParameters
public void testAddEventListenerRegistration()
{
EventListenerRegistrationData<ConfigurationEvent> reg =
- new EventListenerRegistrationData<ConfigurationEvent>(
+ new EventListenerRegistrationData<>(
ConfigurationEvent.SET_PROPERTY,
new EventListenerTestImpl(null));
EventListenerParameters parameters = new EventListenerParameters();
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/TestFileBasedBuilderParameters.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/TestFileBasedBuilderParameters.java?rev=1790899&r1=1790898&r2=1790899&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/TestFileBasedBuilderParameters.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration2/builder/TestFileBasedBuilderParameters.java Mon Apr 10 21:56:46 2017
@@ -323,7 +323,7 @@ public class TestFileBasedBuilderParamet
ReloadingDetectorFactory factory =
EasyMock.createMock(ReloadingDetectorFactory.class);
EasyMock.replay(factory);
- Map<String, Object> map = new HashMap<String, Object>();
+ Map<String, Object> map = new HashMap<>();
final String fileName = "someFileName";
final String basePath = "someBasePath";
final Long refreshDelay = 20140628222302L;