commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r1712413 - in /commons/sandbox/beanutils2/trunk/src: main/java/org/apache/commons/beanutils2/ test/java/org/apache/commons/beanutils2/ test/java/org/apache/commons/beanutils2/testbeans/
Date Tue, 03 Nov 2015 21:06:48 GMT
Author: britter
Date: Tue Nov  3 21:06:48 2015
New Revision: 1712413

URL: http://svn.apache.org/viewvc?rev=1712413&view=rev
Log:
Explicit type can be replaced with <>

Modified:
    commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/AccessibleObjectsRegistry.java
    commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/Argument.java
    commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/BeanAccessorFactory.java
    commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/BeanUtils.java
    commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultBeanAccessor.java
    commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultClassAccessor.java
    commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultIndexedPropertySetterAccessor.java
    commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultMappedPropertySetterAccessor.java
    commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/MapBeanAccessor.java
    commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/MappedPropertyDescriptor.java
    commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/PropertyDescriptorsRegistry.java
    commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/PropertyInterpreter.java
    commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/TransformerRegistry.java
    commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/MapBeanTestCase.java
    commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/PopulateTestCase.java
    commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/TransformerRegistryTestCase.java
    commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/testbeans/TestBean.java

Modified: commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/AccessibleObjectsRegistry.java
URL: http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/AccessibleObjectsRegistry.java?rev=1712413&r1=1712412&r2=1712413&view=diff
==============================================================================
--- commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/AccessibleObjectsRegistry.java
(original)
+++ commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/AccessibleObjectsRegistry.java
Tue Nov  3 21:06:48 2015
@@ -55,7 +55,7 @@ abstract class AccessibleObjectsRegistry
     private static final AccessibleObjectsRegistry<Constructor<?>> CONSTRUCTORS_REGISTRY
= new ConstructorsRegistry();
 
     private static final AccessibleObjectsRegistry<Method> METHODS_REGISTRY = new MethodsRegistry();
-    private final Map<AccessibleObjectDescriptor, AO> cache = new WeakHashMap<AccessibleObjectDescriptor,
AO>();
+    private final Map<AccessibleObjectDescriptor, AO> cache = new WeakHashMap<>();
 
     private AccessibleObjectsRegistry() {
         // this class cannot be instantiated
@@ -208,7 +208,7 @@ abstract class AccessibleObjectsRegistry
     protected abstract AO resolveAccessible(Class<?> type, AO accessibleObject);
 
     private AO makeAccessible(AO accessibleObject) {
-        PrivilegedAction<AO> action = new MakeAccessiblePrivilegedAction<AO>(accessibleObject);
+        PrivilegedAction<AO> action = new MakeAccessiblePrivilegedAction<>(accessibleObject);
         if (getSecurityManager() != null) {
             return doPrivileged(action);
         }

Modified: commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/Argument.java
URL: http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/Argument.java?rev=1712413&r1=1712412&r2=1712413&view=diff
==============================================================================
--- commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/Argument.java
(original)
+++ commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/Argument.java
Tue Nov  3 21:06:48 2015
@@ -83,7 +83,7 @@ public final class Argument<T> {
                     value.getClass().getName(),
                     type.getName());
         }
-        return new Argument<T>(type, value);
+        return new Argument<>(type, value);
     }
 
     /**

Modified: commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/BeanAccessorFactory.java
URL: http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/BeanAccessorFactory.java?rev=1712413&r1=1712412&r2=1712413&view=diff
==============================================================================
--- commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/BeanAccessorFactory.java
(original)
+++ commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/BeanAccessorFactory.java
Tue Nov  3 21:06:48 2015
@@ -36,7 +36,7 @@ final class BeanAccessorFactory {
      */
     public static <B> BeanAccessor<B> createBeanAccessor(B bean, Class<?>
clazz, Method readMethod) {
         if (bean == null) {
-            return new NullBeanAccessor<B>(clazz.getName(), readMethod.getName());
+            return new NullBeanAccessor<>(clazz.getName(), readMethod.getName());
         } else {
             return createBeanAccessor(bean);
         }
@@ -51,9 +51,9 @@ final class BeanAccessorFactory {
      */
     public static <B> BeanAccessor<B> createBeanAccessor(B bean) {
         if (bean instanceof Map) {
-            return new MapBeanAccessor<B>(asMap(bean));
+            return new MapBeanAccessor<>(asMap(bean));
         } else {
-            return new DefaultBeanAccessor<B>(bean);
+            return new DefaultBeanAccessor<>(bean);
         }
     }
 

Modified: commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/BeanUtils.java
URL: http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/BeanUtils.java?rev=1712413&r1=1712412&r2=1712413&view=diff
==============================================================================
--- commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/BeanUtils.java
(original)
+++ commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/BeanUtils.java
Tue Nov  3 21:06:48 2015
@@ -60,7 +60,7 @@ public final class BeanUtils {
      */
     public static <B> ClassAccessor<B> on(Class<B> beanType) {
         beanType = checkNotNull(beanType, "No bean class specified");
-        return new DefaultClassAccessor<B>(beanType);
+        return new DefaultClassAccessor<>(beanType);
     }
 
     /**

Modified: commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultBeanAccessor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultBeanAccessor.java?rev=1712413&r1=1712412&r2=1712413&view=diff
==============================================================================
--- commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultBeanAccessor.java
(original)
+++ commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultBeanAccessor.java
Tue Nov  3 21:06:48 2015
@@ -75,7 +75,7 @@ final class DefaultBeanAccessor<B>
         checkNotNull(propertyName, "Parameter 'propertyName' must not be null!");
         Method indexedReadMethod;
         indexedReadMethod = properties.getIndexedReadMethod(propertyName);
-        return new DefaultIndexedPropertyGetterAccessor<B>(bean, propertyName, indexedReadMethod);
+        return new DefaultIndexedPropertyGetterAccessor<>(bean, propertyName, indexedReadMethod);
     }
 
     /**
@@ -85,7 +85,7 @@ final class DefaultBeanAccessor<B>
         checkNotNull(propertyName, "Parameter 'propertyName' must not be null!");
         Method mappedReadMethod;
         mappedReadMethod = properties.getMappedReadMethod(propertyName);
-        return new DefaultMappedPropertyGetterAccessor<B>(bean, propertyName, mappedReadMethod);
+        return new DefaultMappedPropertyGetterAccessor<>(bean, propertyName, mappedReadMethod);
     }
 
     /**
@@ -113,7 +113,7 @@ final class DefaultBeanAccessor<B>
         checkNotNull(propertyName, "Parameter 'propertyName' must not be null!");
         Method writeMethod;
         writeMethod = properties.getWriteMethod(propertyName);
-        return new DefaultBeanPropertySetter<B>(bean, writeMethod, propertyName);
+        return new DefaultBeanPropertySetter<>(bean, writeMethod, propertyName);
     }
 
     /**
@@ -123,7 +123,7 @@ final class DefaultBeanAccessor<B>
         checkNotNull(propertyName, "Parameter 'propertyName' must not be null!");
         Method indexedWriteMethod;
         indexedWriteMethod = properties.getIndexedWriteMethod(propertyName);
-        return new DefaultIndexedPropertySetterAccessor<B>(bean, propertyName, indexedWriteMethod);
+        return new DefaultIndexedPropertySetterAccessor<>(bean, propertyName, indexedWriteMethod);
     }
 
     /**
@@ -133,7 +133,7 @@ final class DefaultBeanAccessor<B>
         checkNotNull(propertyName, "Parameter 'propertyName' must not be null!");
         Method mappedWriteMethod;
         mappedWriteMethod = properties.getMappedWriteMethod(propertyName);
-        return new DefaultMappedPropertySetterAccessor<B>(bean, propertyName, mappedWriteMethod);
+        return new DefaultMappedPropertySetterAccessor<>(bean, propertyName, mappedWriteMethod);
     }
 
     /**
@@ -165,7 +165,7 @@ final class DefaultBeanAccessor<B>
     public Map<String, Object> describe() {
         Map<String, PropertyDescriptor> propertiesIndex;
         propertiesIndex = properties.getPropertiesIndex();
-        final Map<String, Object> result = new HashMap<String, Object>(propertiesIndex.size());
+        final Map<String, Object> result = new HashMap<>(propertiesIndex.size());
 
         for (Entry<String, PropertyDescriptor> key : propertiesIndex.entrySet()) {
             PropertyDescriptor propertyDescriptor = key.getValue();

Modified: commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultClassAccessor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultClassAccessor.java?rev=1712413&r1=1712412&r2=1712413&view=diff
==============================================================================
--- commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultClassAccessor.java
(original)
+++ commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultClassAccessor.java
Tue Nov  3 21:06:48 2015
@@ -39,7 +39,7 @@ final class DefaultClassAccessor<B>
 
     public DefaultClassAccessor(Class<B> beanClass) {
         this.beanClass = beanClass;
-        beanProperties = new DefaultBeanProperties<B>(beanClass);
+        beanProperties = new DefaultBeanProperties<>(beanClass);
     }
 
     // pure new class instantiation

Modified: commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultIndexedPropertySetterAccessor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultIndexedPropertySetterAccessor.java?rev=1712413&r1=1712412&r2=1712413&view=diff
==============================================================================
--- commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultIndexedPropertySetterAccessor.java
(original)
+++ commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultIndexedPropertySetterAccessor.java
Tue Nov  3 21:06:48 2015
@@ -44,7 +44,7 @@ final class DefaultIndexedPropertySetter
     public BeanPropertySetter<B> at(int index) {
         checkArgument(index >= 0, "Indexed property '%s' in bean of type %s cannot be
get from a negative index %s",
                 propertyName, bean.getClass().getName(), index);
-        return new DefaultIndexedPropertySetter<B>(bean, propertyName, indexedSetterMethod,
index);
+        return new DefaultIndexedPropertySetter<>(bean, propertyName, indexedSetterMethod,
index);
     }
 
 }

Modified: commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultMappedPropertySetterAccessor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultMappedPropertySetterAccessor.java?rev=1712413&r1=1712412&r2=1712413&view=diff
==============================================================================
--- commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultMappedPropertySetterAccessor.java
(original)
+++ commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultMappedPropertySetterAccessor.java
Tue Nov  3 21:06:48 2015
@@ -41,7 +41,7 @@ final class DefaultMappedPropertySetterA
     public BeanPropertySetter<B> forKey(String key) {
         checkNotNull(key, "Can not get mapped property '%s' in bean of type '%s' for null!",
propertyName,
                 bean.getClass().getName());
-        return new DefaultMappedPropertySetter<B>(bean, propertyName, mappedSetterMethod,
key);
+        return new DefaultMappedPropertySetter<>(bean, propertyName, mappedSetterMethod,
key);
     }
 
 }

Modified: commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/MapBeanAccessor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/MapBeanAccessor.java?rev=1712413&r1=1712412&r2=1712413&view=diff
==============================================================================
--- commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/MapBeanAccessor.java
(original)
+++ commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/MapBeanAccessor.java
Tue Nov  3 21:06:48 2015
@@ -82,7 +82,7 @@ final class MapBeanAccessor<B> implement
 
     public BeanPropertySetter<B> set(String propertyName) {
         checkNotNull(propertyName, "Parameter 'propertyName' must not be null!");
-        return new MapBeanPropertySetter<B>(map, propertyName);
+        return new MapBeanPropertySetter<>(map, propertyName);
     }
 
     public IndexedPropertySetterAccessor<B> setIndexed(String propertyName) {
@@ -95,7 +95,7 @@ final class MapBeanAccessor<B> implement
 
     public B cloneBean() {
         // FIXME would be better to get a new instance of the type of the wrapped map
-        Map<String, Object> cloned = new HashMap<String, Object>();
+        Map<String, Object> cloned = new HashMap<>();
         cloned.putAll(map);
         // BeanUtils.on(B) has been called with a Map, though creating this MapBeanAccessor.
Because of this we can be
         // sure that B is a subtype of Map.
@@ -115,7 +115,7 @@ final class MapBeanAccessor<B> implement
     }
 
     public Map<String, Object> describe() {
-        Map<String, Object> copy = new HashMap<String, Object>();
+        Map<String, Object> copy = new HashMap<>();
         copy.putAll(map);
         return copy;
     }

Modified: commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/MappedPropertyDescriptor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/MappedPropertyDescriptor.java?rev=1712413&r1=1712412&r2=1712413&view=diff
==============================================================================
--- commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/MappedPropertyDescriptor.java
(original)
+++ commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/MappedPropertyDescriptor.java
Tue Nov  3 21:06:48 2015
@@ -396,7 +396,7 @@ public class MappedPropertyDescriptor
             if (m != null) {
                 className = m.getDeclaringClass().getName();
                 methodName = m.getName();
-                methodRef = new SoftReference<Method>(m);
+                methodRef = new SoftReference<>(m);
                 classRef = new WeakReference<Class<?>>(m.getDeclaringClass());
                 Class<?>[] types = m.getParameterTypes();
                 if (types.length == 2) {
@@ -454,7 +454,7 @@ public class MappedPropertyDescriptor
                     throw new RuntimeException("Method " + methodName + " for " + className
                             + " could not be reconstructed - method not found");
                 }
-                methodRef = new SoftReference<Method>(m);
+                methodRef = new SoftReference<>(m);
             }
             return m;
         }

Modified: commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/PropertyDescriptorsRegistry.java
URL: http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/PropertyDescriptorsRegistry.java?rev=1712413&r1=1712412&r2=1712413&view=diff
==============================================================================
--- commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/PropertyDescriptorsRegistry.java
(original)
+++ commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/PropertyDescriptorsRegistry.java
Tue Nov  3 21:06:48 2015
@@ -44,7 +44,7 @@ final class PropertyDescriptorsRegistry
     private static final PropertyDescriptorsRegistry INSTANCE = new PropertyDescriptorsRegistry();
     private final AccessibleObjectsRegistry<Method> methodsRegistry = AccessibleObjectsRegistry.getMethodsRegistry();
     private final Map<Class<?>, Map<String, PropertyDescriptor>> cache
=
-            new WeakHashMap<Class<?>, Map<String, PropertyDescriptor>>();
+            new WeakHashMap<>();
 
     /**
      * This class can not be instantiated.
@@ -67,11 +67,11 @@ final class PropertyDescriptorsRegistry
                 return propertiesIndex;
             }
 
-            propertiesIndex = new HashMap<String, PropertyDescriptor>();
+            propertiesIndex = new HashMap<>();
             BeanInfo beanInfo = getBeanInfo(beanType);
 
             List<PropertyDescriptor> propertyDescriptors =
-                    new ArrayList<PropertyDescriptor>(Arrays.asList(beanInfo.getPropertyDescriptors()));
+                    new ArrayList<>(Arrays.asList(beanInfo.getPropertyDescriptors()));
             propertyDescriptors.addAll(getMappedPropertyDescriptors(beanType));
             for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
                 makeMethodsAccessible(beanType, propertyDescriptor);
@@ -88,7 +88,7 @@ final class PropertyDescriptorsRegistry
 
     private Collection<PropertyDescriptor> getMappedPropertyDescriptors(Class<?>
beanType)
             throws IntrospectionException {
-        Map<String, PropertyDescriptor> mappedPropertyDescirptors = new HashMap<String,
PropertyDescriptor>();
+        Map<String, PropertyDescriptor> mappedPropertyDescirptors = new HashMap<>();
         for (Method method : beanType.getMethods()) {
             if (MethodUtils.isMappedGetter(method) || MethodUtils.isMappedSetter(method))
{
                 String propertyName = method.getName().substring(3);

Modified: commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/PropertyInterpreter.java
URL: http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/PropertyInterpreter.java?rev=1712413&r1=1712412&r2=1712413&view=diff
==============================================================================
--- commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/PropertyInterpreter.java
(original)
+++ commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/PropertyInterpreter.java
Tue Nov  3 21:06:48 2015
@@ -39,7 +39,7 @@ final class PropertyInterpreter {
     }
 
     private static Queue<Expression> buildExpressionQueue(String propertyExpression)
{
-        Queue<Expression> expressionQueue = new LinkedList<Expression>();
+        Queue<Expression> expressionQueue = new LinkedList<>();
 
         String[] properties = obtainProperties(propertyExpression);
 

Modified: commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/TransformerRegistry.java
URL: http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/TransformerRegistry.java?rev=1712413&r1=1712412&r2=1712413&view=diff
==============================================================================
--- commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/TransformerRegistry.java
(original)
+++ commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/TransformerRegistry.java
Tue Nov  3 21:06:48 2015
@@ -106,7 +106,7 @@ public class TransformerRegistry {
     }
 
     public TransformerRegistry() {
-        transformers = new HashMap<TransformerMapKey, Transformer<?, ?>>();
+        transformers = new HashMap<>();
     }
 
     /**

Modified: commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/MapBeanTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/MapBeanTestCase.java?rev=1712413&r1=1712412&r2=1712413&view=diff
==============================================================================
--- commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/MapBeanTestCase.java
(original)
+++ commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/MapBeanTestCase.java
Tue Nov  3 21:06:48 2015
@@ -38,10 +38,10 @@ public class MapBeanTestCase {
 
     @Before
     public void setUp() throws Exception {
-        map = new HashMap<String, Object>();
+        map = new HashMap<>();
         map.put("integerProperty", Integer.valueOf(15));
 
-        Map<String, Object> nestedMap = new HashMap<String, Object>();
+        Map<String, Object> nestedMap = new HashMap<>();
         nestedMap.put("booleanProperty", Boolean.TRUE);
         map.put("nestedMap", nestedMap);
 
@@ -153,7 +153,7 @@ public class MapBeanTestCase {
 
     @Test
     public void copyPropertiesToAddsAllPropertiesToGivenMap() throws Exception {
-        HashMap<String, Object> target = new HashMap<String, Object>();
+        HashMap<String, Object> target = new HashMap<>();
         on(map).copyPropertiesTo(target);
         assertEquals(map, target);
     }

Modified: commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/PopulateTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/PopulateTestCase.java?rev=1712413&r1=1712412&r2=1712413&view=diff
==============================================================================
--- commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/PopulateTestCase.java
(original)
+++ commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/PopulateTestCase.java
Tue Nov  3 21:06:48 2015
@@ -42,7 +42,7 @@ public class PopulateTestCase {
     public void setUp() {
         target = new TestBean();
         defaults = new TestBean();
-        properties = new HashMap<String, Object>();
+        properties = new HashMap<>();
     }
 
     @After

Modified: commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/TransformerRegistryTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/TransformerRegistryTestCase.java?rev=1712413&r1=1712412&r2=1712413&view=diff
==============================================================================
--- commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/TransformerRegistryTestCase.java
(original)
+++ commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/TransformerRegistryTestCase.java
Tue Nov  3 21:06:48 2015
@@ -74,7 +74,7 @@ public class TransformerRegistryTestCase
     @Test
     public void testRegisterAll() {
 
-        List<Transformer<?, ?>> transformerList = new ArrayList<Transformer<?,
?>>(
+        List<Transformer<?, ?>> transformerList = new ArrayList<>(
                 2);
         transformerList.add(transformerStringIntegerImpl);
         transformerList.add(transformerStringFloatImpl);

Modified: commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/testbeans/TestBean.java
URL: http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/testbeans/TestBean.java?rev=1712413&r1=1712412&r2=1712413&view=diff
==============================================================================
--- commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/testbeans/TestBean.java
(original)
+++ commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/testbeans/TestBean.java
Tue Nov  3 21:06:48 2015
@@ -104,7 +104,7 @@ public class TestBean
     /**
      * A List property accessed as an indexed property.
      */
-    private List<String> listIndexed = new ArrayList<String>();
+    private List<String> listIndexed = new ArrayList<>();
     /**
      * A long property.
      */
@@ -378,7 +378,7 @@ public class TestBean
     public Map<String, Object> getMapProperty() {
         // Create the map the very first time
         if (mapProperty == null) {
-            mapProperty = new HashMap<String, Object>();
+            mapProperty = new HashMap<>();
             mapProperty.put("First Key", "First Value");
             mapProperty.put("Second Key", "Second Value");
         }
@@ -388,7 +388,7 @@ public class TestBean
     public void setMapProperty(Map<String, Object> mapProperty) {
         // Create the map the very first time
         if (mapProperty == null) {
-            mapProperty = new HashMap<String, Object>();
+            mapProperty = new HashMap<>();
             mapProperty.put("First Key", "First Value");
             mapProperty.put("Second Key", "Second Value");
         }
@@ -398,7 +398,7 @@ public class TestBean
     public Object getMappedObjects(String key) {
         // Create the map the very first time
         if (mappedObjects == null) {
-            mappedObjects = new HashMap<String, Object>();
+            mappedObjects = new HashMap<>();
             mappedObjects.put("First Key", "First Value");
             mappedObjects.put("Second Key", "Second Value");
         }
@@ -408,7 +408,7 @@ public class TestBean
     public void setMappedObjects(String key, Object value) {
         // Create the map the very first time
         if (mappedObjects == null) {
-            mappedObjects = new HashMap<String, Object>();
+            mappedObjects = new HashMap<>();
             mappedObjects.put("First Key", "First Value");
             mappedObjects.put("Second Key", "Second Value");
         }
@@ -418,7 +418,7 @@ public class TestBean
     public String getMappedProperty(String key) {
         // Create the map the very first time
         if (mappedProperty == null) {
-            mappedProperty = new HashMap<String, Object>();
+            mappedProperty = new HashMap<>();
             mappedProperty.put("First Key", "First Value");
             mappedProperty.put("Second Key", "Second Value");
         }
@@ -428,7 +428,7 @@ public class TestBean
     public void setMappedProperty(String key, String value) {
         // Create the map the very first time
         if (mappedProperty == null) {
-            mappedProperty = new HashMap<String, Object>();
+            mappedProperty = new HashMap<>();
             mappedProperty.put("First Key", "First Value");
             mappedProperty.put("Second Key", "Second Value");
         }
@@ -438,7 +438,7 @@ public class TestBean
     public int getMappedIntProperty(String key) {
         // Create the map the very first time
         if (mappedIntProperty == null) {
-            mappedIntProperty = new HashMap<String, Object>();
+            mappedIntProperty = new HashMap<>();
             mappedIntProperty.put("One", new Integer(1));
             mappedIntProperty.put("Two", new Integer(2));
         }



Mime
View raw message