groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [3/8] groovy git commit: Minor refactoring: Explicit type can be replaced with <>
Date Sat, 25 Aug 2018 16:44:51 GMT
http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/runtime/m12n/MetaInfExtensionModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/runtime/m12n/MetaInfExtensionModule.java b/src/main/java/org/codehaus/groovy/runtime/m12n/MetaInfExtensionModule.java
index 10c1fd3..d8bcdb6 100644
--- a/src/main/java/org/codehaus/groovy/runtime/m12n/MetaInfExtensionModule.java
+++ b/src/main/java/org/codehaus/groovy/runtime/m12n/MetaInfExtensionModule.java
@@ -68,9 +68,9 @@ public class MetaInfExtensionModule extends SimpleExtensionModule {
             throw new GroovyRuntimeException("Module file hasn't set the module version using key [" + PropertiesModuleFactory.MODULE_VERSION_KEY + "]");
         String[] extensionClasses = properties.getProperty(MODULE_INSTANCE_CLASSES_KEY, "").trim().split("[,; ]");
         String[] staticExtensionClasses = properties.getProperty(MODULE_STATIC_CLASSES_KEY, "").trim().split("[,; ]");
-        List<Class> instanceClasses = new ArrayList<Class>(extensionClasses.length);
-        List<Class> staticClasses = new ArrayList<Class>(staticExtensionClasses.length);
-        List<String> errors = new LinkedList<String>();
+        List<Class> instanceClasses = new ArrayList<>(extensionClasses.length);
+        List<Class> staticClasses = new ArrayList<>(staticExtensionClasses.length);
+        List<String> errors = new LinkedList<>();
         loadExtensionClass(loader, extensionClasses, instanceClasses, errors);
         loadExtensionClass(loader, staticExtensionClasses, staticClasses, errors);
         if (!errors.isEmpty()) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/runtime/m12n/SimpleExtensionModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/runtime/m12n/SimpleExtensionModule.java b/src/main/java/org/codehaus/groovy/runtime/m12n/SimpleExtensionModule.java
index af5df54..09432ab 100644
--- a/src/main/java/org/codehaus/groovy/runtime/m12n/SimpleExtensionModule.java
+++ b/src/main/java/org/codehaus/groovy/runtime/m12n/SimpleExtensionModule.java
@@ -95,7 +95,7 @@ public abstract class SimpleExtensionModule extends ExtensionModule {
 
     @Override
     public List<MetaMethod> getMetaMethods() {
-        List<MetaMethod> metaMethods = new LinkedList<MetaMethod>();
+        List<MetaMethod> metaMethods = new LinkedList<>();
         List<Class> extensionClasses = getInstanceMethodsExtensionClasses();
         for (Class extensionClass : extensionClasses) {
             try {

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/runtime/memoize/CommonCache.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/runtime/memoize/CommonCache.java b/src/main/java/org/codehaus/groovy/runtime/memoize/CommonCache.java
index 0f7fb75..868f104 100644
--- a/src/main/java/org/codehaus/groovy/runtime/memoize/CommonCache.java
+++ b/src/main/java/org/codehaus/groovy/runtime/memoize/CommonCache.java
@@ -53,7 +53,7 @@ public class CommonCache<K, V> implements EvictableCache<K, V>, ValueConvertable
      * Constructs a cache with unlimited size
      */
     public CommonCache() {
-        this(new LinkedHashMap<K, V>());
+        this(new LinkedHashMap<>());
     }
 
     /**
@@ -212,7 +212,7 @@ public class CommonCache<K, V> implements EvictableCache<K, V>, ValueConvertable
      */
     @Override
     public Map<K, V> clearAll() {
-        Map<K, V> result = new LinkedHashMap<K, V>(map);
+        Map<K, V> result = new LinkedHashMap<>(map);
         map.clear();
         return result;
     }

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/runtime/memoize/ConcurrentCommonCache.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/runtime/memoize/ConcurrentCommonCache.java b/src/main/java/org/codehaus/groovy/runtime/memoize/ConcurrentCommonCache.java
index 7032889..bcb5ea5 100644
--- a/src/main/java/org/codehaus/groovy/runtime/memoize/ConcurrentCommonCache.java
+++ b/src/main/java/org/codehaus/groovy/runtime/memoize/ConcurrentCommonCache.java
@@ -45,7 +45,7 @@ public class ConcurrentCommonCache<K, V> implements EvictableCache<K, V>, ValueC
      * Constructs a cache with unlimited size
      */
     public ConcurrentCommonCache() {
-        commonCache = new CommonCache<K, V>();
+        commonCache = new CommonCache<>();
     }
 
     /**
@@ -56,7 +56,7 @@ public class ConcurrentCommonCache<K, V> implements EvictableCache<K, V>, ValueC
      * @param evictionStrategy LRU or FIFO, see {@link org.codehaus.groovy.runtime.memoize.EvictableCache.EvictionStrategy}
      */
     public ConcurrentCommonCache(int initialCapacity, int maxSize, EvictionStrategy evictionStrategy) {
-        commonCache = new CommonCache<K, V>(initialCapacity, maxSize, evictionStrategy);
+        commonCache = new CommonCache<>(initialCapacity, maxSize, evictionStrategy);
     }
 
     /**
@@ -67,7 +67,7 @@ public class ConcurrentCommonCache<K, V> implements EvictableCache<K, V>, ValueC
      * @param maxSize         max size of the LRU cache
      */
     public ConcurrentCommonCache(int initialCapacity, int maxSize) {
-        commonCache = new CommonCache<K, V>(initialCapacity, maxSize);
+        commonCache = new CommonCache<>(initialCapacity, maxSize);
     }
 
     /**
@@ -77,7 +77,7 @@ public class ConcurrentCommonCache<K, V> implements EvictableCache<K, V>, ValueC
      * @see #ConcurrentCommonCache(int, int)
      */
     public ConcurrentCommonCache(int maxSize) {
-        commonCache = new CommonCache<K, V>(maxSize);
+        commonCache = new CommonCache<>(maxSize);
     }
 
     /**
@@ -86,7 +86,7 @@ public class ConcurrentCommonCache<K, V> implements EvictableCache<K, V>, ValueC
      * @param map the {@link java.util.Map} instance
      */
     public ConcurrentCommonCache(Map<K, V> map) {
-        commonCache = new CommonCache<K, V>(map);
+        commonCache = new CommonCache<>(map);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/runtime/memoize/Memoize.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/runtime/memoize/Memoize.java b/src/main/java/org/codehaus/groovy/runtime/memoize/Memoize.java
index 21608df..0faaf80 100644
--- a/src/main/java/org/codehaus/groovy/runtime/memoize/Memoize.java
+++ b/src/main/java/org/codehaus/groovy/runtime/memoize/Memoize.java
@@ -52,7 +52,7 @@ public abstract class Memoize {
      * @return A new memoized closure
      */
     public static <V> Closure<V> buildMemoizeFunction(final MemoizeCache<Object, Object> cache, final Closure<V> closure) {
-        return new MemoizeFunction<V>(cache, closure);
+        return new MemoizeFunction<>(cache, closure);
     }
 
     /**
@@ -81,7 +81,7 @@ public abstract class Memoize {
 
         final ReferenceQueue queue = new ReferenceQueue();
 
-        return new SoftReferenceMemoizeFunction<V>(cache, closure, lruProtectionStorage, queue);
+        return new SoftReferenceMemoizeFunction<>(cache, closure, lruProtectionStorage, queue);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/runtime/memoize/StampedCommonCache.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/runtime/memoize/StampedCommonCache.java b/src/main/java/org/codehaus/groovy/runtime/memoize/StampedCommonCache.java
index f465248..a830bf2 100644
--- a/src/main/java/org/codehaus/groovy/runtime/memoize/StampedCommonCache.java
+++ b/src/main/java/org/codehaus/groovy/runtime/memoize/StampedCommonCache.java
@@ -46,7 +46,7 @@ public class StampedCommonCache<K, V> implements EvictableCache<K, V>, ValueConv
      * Constructs a cache with unlimited size
      */
     public StampedCommonCache() {
-        commonCache = new CommonCache<K, V>();
+        commonCache = new CommonCache<>();
     }
 
     /**
@@ -57,7 +57,7 @@ public class StampedCommonCache<K, V> implements EvictableCache<K, V>, ValueConv
      * @param evictionStrategy LRU or FIFO, see {@link EvictionStrategy}
      */
     public StampedCommonCache(int initialCapacity, int maxSize, EvictionStrategy evictionStrategy) {
-        commonCache = new CommonCache<K, V>(initialCapacity, maxSize, evictionStrategy);
+        commonCache = new CommonCache<>(initialCapacity, maxSize, evictionStrategy);
     }
 
     /**
@@ -68,7 +68,7 @@ public class StampedCommonCache<K, V> implements EvictableCache<K, V>, ValueConv
      * @param maxSize         max size of the LRU cache
      */
     public StampedCommonCache(int initialCapacity, int maxSize) {
-        commonCache = new CommonCache<K, V>(initialCapacity, maxSize);
+        commonCache = new CommonCache<>(initialCapacity, maxSize);
     }
 
     /**
@@ -78,7 +78,7 @@ public class StampedCommonCache<K, V> implements EvictableCache<K, V>, ValueConv
      * @see #StampedCommonCache(int, int)
      */
     public StampedCommonCache(int maxSize) {
-        commonCache = new CommonCache<K, V>(maxSize);
+        commonCache = new CommonCache<>(maxSize);
     }
 
     /**
@@ -87,7 +87,7 @@ public class StampedCommonCache<K, V> implements EvictableCache<K, V>, ValueConv
      * @param map the {@link Map} instance
      */
     public StampedCommonCache(Map<K, V> map) {
-        commonCache = new CommonCache<K, V>(map);
+        commonCache = new CommonCache<>(map);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/runtime/memoize/UnlimitedConcurrentCache.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/runtime/memoize/UnlimitedConcurrentCache.java b/src/main/java/org/codehaus/groovy/runtime/memoize/UnlimitedConcurrentCache.java
index cfefb08..f7d14a7 100644
--- a/src/main/java/org/codehaus/groovy/runtime/memoize/UnlimitedConcurrentCache.java
+++ b/src/main/java/org/codehaus/groovy/runtime/memoize/UnlimitedConcurrentCache.java
@@ -39,7 +39,7 @@ public final class UnlimitedConcurrentCache<K, V> implements EvictableCache<K, V
      * Constructs a cache with unlimited size
      */
     public UnlimitedConcurrentCache() {
-        map = new ConcurrentHashMap<K, V>();
+        map = new ConcurrentHashMap<>();
     }
 
     /**
@@ -47,7 +47,7 @@ public final class UnlimitedConcurrentCache<K, V> implements EvictableCache<K, V
      * @param initialCapacity the initial capacity
      */
     public UnlimitedConcurrentCache(int initialCapacity) {
-        map = new ConcurrentHashMap<K, V>(initialCapacity);
+        map = new ConcurrentHashMap<>(initialCapacity);
     }
 
     /**
@@ -87,7 +87,7 @@ public final class UnlimitedConcurrentCache<K, V> implements EvictableCache<K, V
      */
     @Override
     public Map<K, V> clearAll() {
-        Map<K, V> result = new LinkedHashMap<K, V>(map.size());
+        Map<K, V> result = new LinkedHashMap<>(map.size());
 
         for (Map.Entry<K, V> entry : map.entrySet()) {
             K key = entry.getKey();

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/runtime/metaclass/ClosureMetaClass.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/runtime/metaclass/ClosureMetaClass.java b/src/main/java/org/codehaus/groovy/runtime/metaclass/ClosureMetaClass.java
index 1a59c0b..5b77b27 100644
--- a/src/main/java/org/codehaus/groovy/runtime/metaclass/ClosureMetaClass.java
+++ b/src/main/java/org/codehaus/groovy/runtime/metaclass/ClosureMetaClass.java
@@ -73,7 +73,7 @@ import java.util.Map;
 public final class ClosureMetaClass extends MetaClassImpl {
     private volatile boolean initialized;
     private final FastArray closureMethods = new FastArray(3);
-    private Map<String, CachedField> attributes = new HashMap<String, CachedField>();
+    private Map<String, CachedField> attributes = new HashMap<>();
     private MethodChooser chooser;
     private volatile boolean attributeInitDone = false;
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/runtime/metaclass/ClosureMetaMethod.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/runtime/metaclass/ClosureMetaMethod.java b/src/main/java/org/codehaus/groovy/runtime/metaclass/ClosureMetaMethod.java
index e747ab6..d3cff53 100644
--- a/src/main/java/org/codehaus/groovy/runtime/metaclass/ClosureMetaMethod.java
+++ b/src/main/java/org/codehaus/groovy/runtime/metaclass/ClosureMetaMethod.java
@@ -94,7 +94,7 @@ public class ClosureMetaMethod extends MetaMethod implements ClosureInvokingMeth
     }
 
     public static List<MetaMethod> createMethodList(final String name, final Class declaringClass, final Closure closure) {
-        List<MetaMethod> res = new ArrayList<MetaMethod>();
+        List<MetaMethod> res = new ArrayList<>();
         if (closure instanceof MethodClosure) {
             MethodClosure methodClosure = (MethodClosure) closure;
             Object owner = closure.getOwner();

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java b/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
index eda5f06..4e69b34 100644
--- a/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
+++ b/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
@@ -69,9 +69,9 @@ public class MetaClassRegistryImpl implements MetaClassRegistry{
     private final FastArray instanceMethods = new FastArray();
     private final FastArray staticMethods = new FastArray();
 
-    private final LinkedList<MetaClassRegistryChangeEventListener> changeListenerList = new LinkedList<MetaClassRegistryChangeEventListener>();
-    private final LinkedList<MetaClassRegistryChangeEventListener> nonRemoveableChangeListenerList = new LinkedList<MetaClassRegistryChangeEventListener>();
-    private final ManagedConcurrentLinkedQueue<MetaClass> metaClassInfo = new ManagedConcurrentLinkedQueue<MetaClass>(ReferenceBundle.getWeakBundle());
+    private final LinkedList<MetaClassRegistryChangeEventListener> changeListenerList = new LinkedList<>();
+    private final LinkedList<MetaClassRegistryChangeEventListener> nonRemoveableChangeListenerList = new LinkedList<>();
+    private final ManagedConcurrentLinkedQueue<MetaClass> metaClassInfo = new ManagedConcurrentLinkedQueue<>(ReferenceBundle.getWeakBundle());
     private final ExtensionModuleRegistry moduleRegistry = new ExtensionModuleRegistry();
 
     public static final int LOAD_DEFAULT = 0;
@@ -99,7 +99,7 @@ public class MetaClassRegistryImpl implements MetaClassRegistry{
         this.useAccessible = useAccessible;
 
         if (loadDefault == LOAD_DEFAULT) {
-            final Map<CachedClass, List<MetaMethod>> map = new HashMap<CachedClass, List<MetaMethod>>();
+            final Map<CachedClass, List<MetaMethod>> map = new HashMap<>();
 
             // let's register the default methods
             registerMethods(null, true, true, map);
@@ -211,7 +211,7 @@ public class MetaClassRegistryImpl implements MetaClassRegistry{
                     final CachedClass declClass = method.getDeclaringClass();
                     List<MetaMethod> arr = map.get(declClass);
                     if (arr == null) {
-                        arr = new ArrayList<MetaMethod>(4);
+                        arr = new ArrayList<>(4);
                         map.put(declClass, arr);
                     }
                     arr.add(method);
@@ -232,7 +232,7 @@ public class MetaClassRegistryImpl implements MetaClassRegistry{
                     if (paramTypes.length > 0) {
                         List<MetaMethod> arr = map.get(paramTypes[0]);
                         if (arr == null) {
-                            arr = new ArrayList<MetaMethod>(4);
+                            arr = new ArrayList<>(4);
                             map.put(paramTypes[0], arr);
                         }
                         if (useInstanceMethods) {
@@ -256,7 +256,7 @@ public class MetaClassRegistryImpl implements MetaClassRegistry{
             final CachedClass declClass = method.getDeclaringClass();
             List<MetaMethod> arr = map.get(declClass);
             if (arr == null) {
-                arr = new ArrayList<MetaMethod>(4);
+                arr = new ArrayList<>(4);
                 map.put(declClass, arr);
             }
             arr.add(method);
@@ -411,7 +411,7 @@ public class MetaClassRegistryImpl implements MetaClassRegistry{
     public MetaClassRegistryChangeEventListener[] getMetaClassRegistryChangeEventListeners() {
         synchronized (changeListenerList) {
             ArrayList<MetaClassRegistryChangeEventListener> ret =
-                    new ArrayList<MetaClassRegistryChangeEventListener>(changeListenerList.size()+nonRemoveableChangeListenerList.size());
+                    new ArrayList<>(changeListenerList.size() + nonRemoveableChangeListenerList.size());
             ret.addAll(nonRemoveableChangeListenerList);
             ret.addAll(changeListenerList);
             return ret.toArray(new MetaClassRegistryChangeEventListener[0]);
@@ -528,7 +528,7 @@ public class MetaClassRegistryImpl implements MetaClassRegistry{
                 CachedClass cachedClass = metaMethod.getDeclaringClass();
                 List<MetaMethod> methods = map.get(cachedClass);
                 if (methods == null) {
-                    methods = new ArrayList<MetaMethod>(4);
+                    methods = new ArrayList<>(4);
                     map.put(cachedClass, methods);
                 }
                 methods.add(metaMethod);

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/runtime/metaclass/ThreadManagedMetaBeanProperty.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/runtime/metaclass/ThreadManagedMetaBeanProperty.java b/src/main/java/org/codehaus/groovy/runtime/metaclass/ThreadManagedMetaBeanProperty.java
index 8cce40e..e73b9f5 100644
--- a/src/main/java/org/codehaus/groovy/runtime/metaclass/ThreadManagedMetaBeanProperty.java
+++ b/src/main/java/org/codehaus/groovy/runtime/metaclass/ThreadManagedMetaBeanProperty.java
@@ -41,7 +41,7 @@ import java.util.concurrent.ConcurrentHashMap;
  * @since 1.5
  */
 public class ThreadManagedMetaBeanProperty extends MetaBeanProperty {
-    private static final ConcurrentHashMap<String,ManagedConcurrentMap> PROPNAME_TO_MAP = new ConcurrentHashMap<String, ManagedConcurrentMap>();
+    private static final ConcurrentHashMap<String,ManagedConcurrentMap> PROPNAME_TO_MAP = new ConcurrentHashMap<>();
 
     private final ManagedConcurrentMap instance2Prop;
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/runtime/powerassert/AssertionRenderer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/runtime/powerassert/AssertionRenderer.java b/src/main/java/org/codehaus/groovy/runtime/powerassert/AssertionRenderer.java
index 792b144..eb1d736 100644
--- a/src/main/java/org/codehaus/groovy/runtime/powerassert/AssertionRenderer.java
+++ b/src/main/java/org/codehaus/groovy/runtime/powerassert/AssertionRenderer.java
@@ -33,9 +33,9 @@ import java.util.List;
 public final class AssertionRenderer {
     private final String text;
     private final ValueRecorder recorder;
-    private final List<StringBuilder> lines = new ArrayList<StringBuilder>();
+    private final List<StringBuilder> lines = new ArrayList<>();
     // startColumns.get(i) is the first non-empty column of lines.get(i)
-    private final List<Integer> startColumns = new ArrayList<Integer>();
+    private final List<Integer> startColumns = new ArrayList<>();
 
     private AssertionRenderer(String text, ValueRecorder recorder) {
         if (text.contains("\n"))

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/runtime/powerassert/SourceText.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/runtime/powerassert/SourceText.java b/src/main/java/org/codehaus/groovy/runtime/powerassert/SourceText.java
index 6a9f96d..0f969c0 100644
--- a/src/main/java/org/codehaus/groovy/runtime/powerassert/SourceText.java
+++ b/src/main/java/org/codehaus/groovy/runtime/powerassert/SourceText.java
@@ -37,8 +37,8 @@ public class SourceText {
     private final int firstLine;
     private String normalizedText;
 
-    private final List<Integer> lineOffsets = new ArrayList<Integer>();
-    private final List<Integer> textOffsets = new ArrayList<Integer>();
+    private final List<Integer> lineOffsets = new ArrayList<>();
+    private final List<Integer> textOffsets = new ArrayList<>();
 
     /**
      * Constructs a <tt>SourceText</tt> by reading the given assertion's source

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/runtime/powerassert/ValueRecorder.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/runtime/powerassert/ValueRecorder.java b/src/main/java/org/codehaus/groovy/runtime/powerassert/ValueRecorder.java
index 4cc675a..c074335 100644
--- a/src/main/java/org/codehaus/groovy/runtime/powerassert/ValueRecorder.java
+++ b/src/main/java/org/codehaus/groovy/runtime/powerassert/ValueRecorder.java
@@ -28,7 +28,7 @@ import java.util.List;
  * @author Peter Niederwieser
  */
 public class ValueRecorder {
-    private final List<Value> values = new ArrayList<Value>();
+    private final List<Value> values = new ArrayList<>();
 
     public void clear() {
         values.clear();

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/runtime/typehandling/NumberMathModificationInfo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/runtime/typehandling/NumberMathModificationInfo.java b/src/main/java/org/codehaus/groovy/runtime/typehandling/NumberMathModificationInfo.java
index adc9c76..2a8f1af 100644
--- a/src/main/java/org/codehaus/groovy/runtime/typehandling/NumberMathModificationInfo.java
+++ b/src/main/java/org/codehaus/groovy/runtime/typehandling/NumberMathModificationInfo.java
@@ -30,7 +30,7 @@ public class NumberMathModificationInfo {
 
     public static final NumberMathModificationInfo instance = new NumberMathModificationInfo();
 
-    private static final HashSet<String> NAMES = new HashSet<String>();
+    private static final HashSet<String> NAMES = new HashSet<>();
 
     static {
         Collections.addAll(NAMES, "plus", "minus", "multiply", "div", "compareTo", "or", "and", "xor", "intdiv", "mod", "leftShift", "rightShift", "rightShiftUnsigned");

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/syntax/ASTHelper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/syntax/ASTHelper.java b/src/main/java/org/codehaus/groovy/syntax/ASTHelper.java
index 9929a64..d267fa8 100644
--- a/src/main/java/org/codehaus/groovy/syntax/ASTHelper.java
+++ b/src/main/java/org/codehaus/groovy/syntax/ASTHelper.java
@@ -68,7 +68,7 @@ public class ASTHelper {
     }
 
     public void setPackageName(String packageName) {
-        setPackage(packageName, new ArrayList<AnnotationNode>());
+        setPackage(packageName, new ArrayList<>());
     }
 
     public PackageNode setPackage(String packageName, List<AnnotationNode> annotations) {
@@ -127,7 +127,7 @@ public class ASTHelper {
     }
 
     protected void addImport(ClassNode type, String name, String aliasName) {
-        addImport(type, name, aliasName, new ArrayList<AnnotationNode>());
+        addImport(type, name, aliasName, new ArrayList<>());
     }
 
     protected void addImport(ClassNode type, String name, String aliasName, List<AnnotationNode> annotations) {
@@ -136,7 +136,7 @@ public class ASTHelper {
     }
 
     protected void addStaticImport(ClassNode type, String name, String alias) {
-        addStaticImport(type, name, alias, new ArrayList<AnnotationNode>());
+        addStaticImport(type, name, alias, new ArrayList<>());
     }
 
     protected void addStaticImport(ClassNode type, String name, String alias, List<AnnotationNode> annotations) {
@@ -145,7 +145,7 @@ public class ASTHelper {
     }
 
     protected void addStaticStarImport(ClassNode type, String importClass) {
-        addStaticStarImport(type, importClass, new ArrayList<AnnotationNode>());
+        addStaticStarImport(type, importClass, new ArrayList<>());
     }
 
     protected void addStaticStarImport(ClassNode type, String importClass, List<AnnotationNode> annotations) {
@@ -153,7 +153,7 @@ public class ASTHelper {
     }
 
     protected void addStarImport(String importPackage) {
-        addStarImport(importPackage, new ArrayList<AnnotationNode>());
+        addStarImport(importPackage, new ArrayList<>());
     }
 
     protected void addStarImport(String importPackage, List<AnnotationNode> annotations) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/syntax/Types.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/syntax/Types.java b/src/main/java/org/codehaus/groovy/syntax/Types.java
index 6feeed5..b7d45242 100644
--- a/src/main/java/org/codehaus/groovy/syntax/Types.java
+++ b/src/main/java/org/codehaus/groovy/syntax/Types.java
@@ -1097,9 +1097,9 @@ public class Types
   //---------------------------------------------------------------------------
   // TEXTS
 
-    private static final Map<Integer,String> TEXTS  = new HashMap<Integer,String>();  // symbol/keyword type -> text
-    private static final Map<String,Integer> LOOKUP = new HashMap<String,Integer>();  // text -> symbol/keyword type
-    private static final Set<String> KEYWORDS = new HashSet<String>();  // valid keywords
+    private static final Map<Integer,String> TEXTS  = new HashMap<>();  // symbol/keyword type -> text
+    private static final Map<String,Integer> LOOKUP = new HashMap<>();  // text -> symbol/keyword type
+    private static final Set<String> KEYWORDS = new HashSet<>();  // valid keywords
 
     public static Collection<String> getKeywords() {
         return Collections.unmodifiableSet(KEYWORDS);
@@ -1338,7 +1338,7 @@ public class Types
   // DESCRIPTIONS
 
 
-    private static final Map<Integer,String> DESCRIPTIONS = new HashMap<Integer,String>();
+    private static final Map<Integer,String> DESCRIPTIONS = new HashMap<>();
 
 
    /**

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/tools/DgmConverter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/tools/DgmConverter.java b/src/main/java/org/codehaus/groovy/tools/DgmConverter.java
index b8adfd3..444ae6f 100644
--- a/src/main/java/org/codehaus/groovy/tools/DgmConverter.java
+++ b/src/main/java/org/codehaus/groovy/tools/DgmConverter.java
@@ -46,13 +46,13 @@ public class DgmConverter implements Opcodes {
             targetDirectory = args[1];
             if (!targetDirectory.endsWith("/")) targetDirectory += "/";
         }
-        List<CachedMethod> cachedMethodsList = new ArrayList<CachedMethod>();
+        List<CachedMethod> cachedMethodsList = new ArrayList<>();
         for (Class aClass : DefaultGroovyMethods.DGM_LIKE_CLASSES) {
             Collections.addAll(cachedMethodsList, ReflectionCache.getCachedClass(aClass).getMethods());
         }
         final CachedMethod[] cachedMethods = cachedMethodsList.toArray(CachedMethod.EMPTY_ARRAY);
 
-        List<GeneratedMetaMethod.DgmMethodRecord> records = new ArrayList<GeneratedMetaMethod.DgmMethodRecord>();
+        List<GeneratedMetaMethod.DgmMethodRecord> records = new ArrayList<>();
 
         int cur = 0;
         for (CachedMethod method : cachedMethods) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java b/src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java
index 545478c..958080d 100644
--- a/src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java
+++ b/src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java
@@ -251,7 +251,7 @@ public class FileSystemCompiler {
         if (filenames == null) {
             return new String[0];
         }
-        List<String> fileList = new ArrayList<String>(filenames.size());
+        List<String> fileList = new ArrayList<>(filenames.size());
         boolean errors = false;
         for (String filename : filenames) {
             if (filename.startsWith("@")) {
@@ -377,7 +377,7 @@ public class FileSystemCompiler {
 
             // joint compilation parameters
             if (jointCompilation) {
-                Map<String, Object> compilerOptions = new HashMap<String, Object>();
+                Map<String, Object> compilerOptions = new HashMap<>();
                 compilerOptions.put("namedValues", javacOptionsList());
                 compilerOptions.put("flags", flagsWithParameterMetaData());
                 configuration.setJointCompilationOptions(compilerOptions);
@@ -390,7 +390,7 @@ public class FileSystemCompiler {
 
             String configScripts = System.getProperty("groovy.starter.configscripts", null);
             if (configScript != null || (configScripts != null && !configScripts.isEmpty())) {
-                List<String> scripts = new ArrayList<String>();
+                List<String> scripts = new ArrayList<>();
                 if (configScript != null) {
                     scripts.add(configScript);
                 }
@@ -411,7 +411,7 @@ public class FileSystemCompiler {
             if (javacOptionsMap == null) {
                 return null;
             }
-            List<String> result = new ArrayList<String>();
+            List<String> result = new ArrayList<>();
             for (Map.Entry<String, String> entry : javacOptionsMap.entrySet()) {
                 result.add(entry.getKey());
                 result.add(entry.getValue());

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/tools/GrapeUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/tools/GrapeUtil.java b/src/main/java/org/codehaus/groovy/tools/GrapeUtil.java
index 86707cc..c2750c9 100644
--- a/src/main/java/org/codehaus/groovy/tools/GrapeUtil.java
+++ b/src/main/java/org/codehaus/groovy/tools/GrapeUtil.java
@@ -23,7 +23,7 @@ import java.util.Map;
 
 public class GrapeUtil {
     public static Map<String, Object> getIvyParts(String allstr) {
-        Map<String, Object> result = new LinkedHashMap<String, Object>();
+        Map<String, Object> result = new LinkedHashMap<>();
         String ext = "";
         String[] parts;
         if (allstr.contains("@")) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/tools/LoaderConfiguration.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/tools/LoaderConfiguration.java b/src/main/java/org/codehaus/groovy/tools/LoaderConfiguration.java
index dcd1aa6..8a785e7 100644
--- a/src/main/java/org/codehaus/groovy/tools/LoaderConfiguration.java
+++ b/src/main/java/org/codehaus/groovy/tools/LoaderConfiguration.java
@@ -80,15 +80,15 @@ import java.util.regex.Pattern;
 public class LoaderConfiguration {
 
     private static final String MAIN_PREFIX = "main is", LOAD_PREFIX = "load", GRAB_PREFIX = "grab", PROP_PREFIX = "property", CONFIGSCRIPT_PREFIX = "configscript";
-    private final List<URL> classPath = new ArrayList<URL>();
+    private final List<URL> classPath = new ArrayList<>();
     private String main;
     private boolean requireMain;
     private static final char WILDCARD = '*';
     private static final String ALL_WILDCARD = "" + WILDCARD + WILDCARD;
     private static final String MATCH_FILE_NAME = "\\\\E[^/]+?\\\\Q";
     private static final String MATCH_ALL = "\\\\E.+?\\\\Q";
-    private final List<String> grabList = new ArrayList<String>();
-    private final List<String> configScripts = new ArrayList<String>();
+    private final List<String> grabList = new ArrayList<>();
+    private final List<String> configScripts = new ArrayList<>();
 
     /**
      * creates a new loader configuration

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/tools/RootLoader.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/tools/RootLoader.java b/src/main/java/org/codehaus/groovy/tools/RootLoader.java
index bfe2d66..d005e4e 100644
--- a/src/main/java/org/codehaus/groovy/tools/RootLoader.java
+++ b/src/main/java/org/codehaus/groovy/tools/RootLoader.java
@@ -75,7 +75,7 @@ import java.util.Map;
  */
 public class RootLoader extends URLClassLoader {
     private static final URL[] EMPTY_URL_ARRAY = new URL[0];
-    private final Map<String, Class> customClasses = new HashMap<String, Class>();
+    private final Map<String, Class> customClasses = new HashMap<>();
     private static final String ORG_W3C_DOM_NODE = "org.w3c.dom.Node";
 
     /**

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/tools/Utilities.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/tools/Utilities.java b/src/main/java/org/codehaus/groovy/tools/Utilities.java
index 522b5d3..63adcbd 100644
--- a/src/main/java/org/codehaus/groovy/tools/Utilities.java
+++ b/src/main/java/org/codehaus/groovy/tools/Utilities.java
@@ -28,11 +28,11 @@ import java.util.Set;
 
 public abstract class Utilities
 {
-    private static final Set<String> INVALID_JAVA_IDENTIFIERS = new HashSet<String>(Arrays.asList((
+    private static final Set<String> INVALID_JAVA_IDENTIFIERS = new HashSet<>(Arrays.asList((
             "abstract assert boolean break byte case catch char class const continue default do double else enum " +
-            "extends final finally float for goto if implements import instanceof int interface long native new " +
-            "package private protected public short static strictfp super switch synchronized this throw throws " +
-            "transient try void volatile while true false null").split(" ")));
+                    "extends final finally float for goto if implements import instanceof int interface long native new " +
+                    "package private protected public short static strictfp super switch synchronized this throw throws " +
+                    "transient try void volatile while true false null").split(" ")));
 
    /**
     *  Returns a string made up of repetitions of the specified string.

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/tools/gse/StringSetMap.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/tools/gse/StringSetMap.java b/src/main/java/org/codehaus/groovy/tools/gse/StringSetMap.java
index fe2b7ad..b99d81b 100644
--- a/src/main/java/org/codehaus/groovy/tools/gse/StringSetMap.java
+++ b/src/main/java/org/codehaus/groovy/tools/gse/StringSetMap.java
@@ -41,14 +41,14 @@ public class StringSetMap extends LinkedHashMap<String,Set<String>> {
         String name = (String) o;
         Set<String> set = super.get(name);
         if (set==null) {
-            set = new LinkedHashSet<String>();
+            set = new LinkedHashSet<>();
             put(name,set);
         }
         return set;
     }
 
     public void makeTransitiveHull() {
-        Set<String> nameSet = new TreeSet<String>(keySet());
+        Set<String> nameSet = new TreeSet<>(keySet());
         
         for (String k: nameSet) {
             StringSetMap delta = new StringSetMap();

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/tools/javac/JavaAwareCompilationUnit.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/tools/javac/JavaAwareCompilationUnit.java b/src/main/java/org/codehaus/groovy/tools/javac/JavaAwareCompilationUnit.java
index 5a26b4c..fe79139 100644
--- a/src/main/java/org/codehaus/groovy/tools/javac/JavaAwareCompilationUnit.java
+++ b/src/main/java/org/codehaus/groovy/tools/javac/JavaAwareCompilationUnit.java
@@ -60,7 +60,7 @@ public class JavaAwareCompilationUnit extends CompilationUnit {
     public JavaAwareCompilationUnit(CompilerConfiguration configuration, GroovyClassLoader groovyClassLoader,
                                     GroovyClassLoader transformClassLoader) {
         super(configuration, null, groovyClassLoader, transformClassLoader);
-        javaSources = new LinkedList<String>();
+        javaSources = new LinkedList<>();
         Map options = configuration.getJointCompilationOptions();
         generationGoal = (File) options.get("stubDir");
         boolean useJava5 = CompilerConfiguration.isPostJDK5(configuration.getTargetBytecode());

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/tools/javac/JavaStubGenerator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/tools/javac/JavaStubGenerator.java b/src/main/java/org/codehaus/groovy/tools/javac/JavaStubGenerator.java
index 0c1acbd..7c98026 100644
--- a/src/main/java/org/codehaus/groovy/tools/javac/JavaStubGenerator.java
+++ b/src/main/java/org/codehaus/groovy/tools/javac/JavaStubGenerator.java
@@ -72,10 +72,10 @@ public class JavaStubGenerator {
     private final String encoding;
     private final boolean requireSuperResolved;
     private final File outputPath;
-    private final List<String> toCompile = new ArrayList<String>();
-    private final ArrayList<MethodNode> propertyMethods = new ArrayList<MethodNode>();
-    private final Map<String, MethodNode> propertyMethodsWithSigs = new HashMap<String, MethodNode>();
-    private final ArrayList<ConstructorNode> constructors = new ArrayList<ConstructorNode>();
+    private final List<String> toCompile = new ArrayList<>();
+    private final ArrayList<MethodNode> propertyMethods = new ArrayList<>();
+    private final Map<String, MethodNode> propertyMethodsWithSigs = new HashMap<>();
+    private final ArrayList<ConstructorNode> constructors = new ArrayList<>();
     private ModuleNode currentModule;
 
     public JavaStubGenerator(final File outputPath, final boolean requireSuperResolved, final boolean java5, String encoding) {
@@ -147,7 +147,7 @@ public class JavaStubGenerator {
             Verifier verifier = new Verifier() {
                 @Override
                 public void visitClass(final ClassNode node) {
-                    List<Statement> savedStatements = new ArrayList<Statement>(node.getObjectInitializerStatements());
+                    List<Statement> savedStatements = new ArrayList<>(node.getObjectInitializerStatements());
                     super.visitClass(node);
                     node.getObjectInitializerStatements().addAll(savedStatements);
                     for (ClassNode inode : node.getAllInterfaces()) {
@@ -377,8 +377,8 @@ public class JavaStubGenerator {
         boolean isInterface = isInterfaceOrTrait(classNode);
         List<FieldNode> fields = classNode.getFields();
         if (fields == null) return;
-        List<FieldNode> enumFields = new ArrayList<FieldNode>(fields.size());
-        List<FieldNode> normalFields = new ArrayList<FieldNode>(fields.size());
+        List<FieldNode> enumFields = new ArrayList<>(fields.size());
+        List<FieldNode> normalFields = new ArrayList<>(fields.size());
         for (FieldNode field : fields) {
             boolean isSynthetic = (field.getModifiers() & Opcodes.ACC_SYNTHETIC) != 0;
             if (field.isEnum()) {
@@ -938,7 +938,7 @@ public class JavaStubGenerator {
     }
 
     private static void printImports(PrintWriter out, ClassNode classNode) {
-        List<String> imports = new ArrayList<String>();
+        List<String> imports = new ArrayList<>();
 
         ModuleNode moduleNode = classNode.getModule();
         for (ImportNode importNode : moduleNode.getStarImports()) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/tools/javac/JavacJavaCompiler.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/tools/javac/JavacJavaCompiler.java b/src/main/java/org/codehaus/groovy/tools/javac/JavacJavaCompiler.java
index e50da83..83da0bd 100644
--- a/src/main/java/org/codehaus/groovy/tools/javac/JavacJavaCompiler.java
+++ b/src/main/java/org/codehaus/groovy/tools/javac/JavacJavaCompiler.java
@@ -102,7 +102,7 @@ public class JavacJavaCompiler implements JavaCompiler {
 
     private String[] makeParameters(List<String> files, GroovyClassLoader parentClassLoader) {
         Map options = config.getJointCompilationOptions();
-        LinkedList<String> paras = new LinkedList<String>();
+        LinkedList<String> paras = new LinkedList<>();
 
         File target = config.getTargetDirectory();
         if (target == null) target = new File(".");
@@ -136,7 +136,7 @@ public class JavacJavaCompiler implements JavaCompiler {
         // append classpath if not already defined
         if (!hadClasspath) {
             // add all classpaths that compilation unit sees
-            List<String> paths = new ArrayList<String>(config.getClasspath());
+            List<String> paths = new ArrayList<>(config.getClasspath());
             ClassLoader cl = parentClassLoader;
             while (cl != null) {
                 if (cl instanceof URLClassLoader) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/transform/ASTTransformationCollectorCodeVisitor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/transform/ASTTransformationCollectorCodeVisitor.java b/src/main/java/org/codehaus/groovy/transform/ASTTransformationCollectorCodeVisitor.java
index c827b04..b78b639 100644
--- a/src/main/java/org/codehaus/groovy/transform/ASTTransformationCollectorCodeVisitor.java
+++ b/src/main/java/org/codehaus/groovy/transform/ASTTransformationCollectorCodeVisitor.java
@@ -91,9 +91,9 @@ public class ASTTransformationCollectorCodeVisitor extends ClassCodeVisitorSuppo
     public void visitAnnotations(AnnotatedNode node) {
         super.visitAnnotations(node);
 
-        Map<Integer, List<AnnotationNode>> existing = new TreeMap<Integer, List<AnnotationNode>>();
-        Map<Integer, List<AnnotationNode>> replacements = new LinkedHashMap<Integer, List<AnnotationNode>>();
-        Map<Integer, AnnotationCollectorMode> modes = new LinkedHashMap<Integer, AnnotationCollectorMode>();
+        Map<Integer, List<AnnotationNode>> existing = new TreeMap<>();
+        Map<Integer, List<AnnotationNode>> replacements = new LinkedHashMap<>();
+        Map<Integer, AnnotationCollectorMode> modes = new LinkedHashMap<>();
         int index = 0;
         for (AnnotationNode annotation : node.getAnnotations()) {
             findCollectedAnnotations(annotation, node, index, modes, existing, replacements);
@@ -105,7 +105,7 @@ public class ASTTransformationCollectorCodeVisitor extends ClassCodeVisitorSuppo
             mergeCollectedAnnotations(modes.get(replacementIndex), existing, annotationNodeList);
             existing.put(replacementIndex, annotationNodeList);
         }
-        List<AnnotationNode> mergedList = new ArrayList<AnnotationNode>();
+        List<AnnotationNode> mergedList = new ArrayList<>();
         for (List<AnnotationNode> next : existing.values()) {
             mergedList.addAll(next);
         }
@@ -146,7 +146,7 @@ public class ASTTransformationCollectorCodeVisitor extends ClassCodeVisitorSuppo
         for (AnnotationNode replacement : replacements) {
             for (Map.Entry<Integer, List<AnnotationNode>> entry : existingMap.entrySet()) {
                 Integer key = entry.getKey();
-                List<AnnotationNode> annotationNodes = new ArrayList<AnnotationNode>(entry.getValue());
+                List<AnnotationNode> annotationNodes = new ArrayList<>(entry.getValue());
                 Iterator<AnnotationNode> iterator = annotationNodes.iterator();
                 while (iterator.hasNext()) {
                     AnnotationNode existing = iterator.next();
@@ -340,7 +340,7 @@ public class ASTTransformationCollectorCodeVisitor extends ClassCodeVisitorSuppo
     }
 
     private List<String> getTransformClassNames(AnnotationNode annotation, Annotation transformClassAnnotation) {
-        List<String> result = new ArrayList<String>();
+        List<String> result = new ArrayList<>();
 
         try {
             Method valueMethod = transformClassAnnotation.getClass().getMethod("value");

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/transform/ASTTransformationVisitor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/transform/ASTTransformationVisitor.java b/src/main/java/org/codehaus/groovy/transform/ASTTransformationVisitor.java
index 1e6de12..25d10e8 100644
--- a/src/main/java/org/codehaus/groovy/transform/ASTTransformationVisitor.java
+++ b/src/main/java/org/codehaus/groovy/transform/ASTTransformationVisitor.java
@@ -105,7 +105,7 @@ public final class ASTTransformationVisitor extends ClassCodeVisitorSupport {
         // only descend if we have annotations to look for
         Map<Class<? extends ASTTransformation>, Set<ASTNode>> baseTransforms = classNode.getTransforms(phase);
         if (!baseTransforms.isEmpty()) {
-            final Map<Class<? extends ASTTransformation>, ASTTransformation> transformInstances = new HashMap<Class<? extends ASTTransformation>, ASTTransformation>();
+            final Map<Class<? extends ASTTransformation>, ASTTransformation> transformInstances = new HashMap<>();
             for (Class<? extends ASTTransformation> transformClass : baseTransforms.keySet()) {
                 try {
                     transformInstances.put(transformClass, transformClass.newInstance());
@@ -121,19 +121,19 @@ public final class ASTTransformationVisitor extends ClassCodeVisitorSupport {
 
 
             // invert the map, is now one to many
-            transforms = new HashMap<ASTNode, List<ASTTransformation>>();
+            transforms = new HashMap<>();
             for (Map.Entry<Class<? extends ASTTransformation>, Set<ASTNode>> entry : baseTransforms.entrySet()) {
                 for (ASTNode node : entry.getValue()) {
                     List<ASTTransformation> list = transforms.get(node);
                     if (list == null)  {
-                        list = new ArrayList<ASTTransformation>();
+                        list = new ArrayList<>();
                         transforms.put(node, list);
                     }
                     list.add(transformInstances.get(entry.getKey()));
                 }
             }
 
-            targetNodes = new LinkedList<ASTNode[]>();
+            targetNodes = new LinkedList<>();
 
             // first pass, collect nodes
             super.visitClass(classNode);
@@ -208,7 +208,7 @@ public final class ASTTransformationVisitor extends ClassCodeVisitorSupport {
     private static void doAddGlobalTransforms(ASTTransformationsContext context, boolean isFirstScan) {
         final CompilationUnit compilationUnit = context.getCompilationUnit();
         GroovyClassLoader transformLoader = compilationUnit.getTransformLoader();
-        Map<String, URL> transformNames = new LinkedHashMap<String, URL>();
+        Map<String, URL> transformNames = new LinkedHashMap<>();
         try {
             Enumeration<URL> globalServices = transformLoader.getResources("META-INF/services/org.codehaus.groovy.transform.ASTTransformation");
             while (globalServices.hasMoreElements()) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/transform/AbstractASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/transform/AbstractASTTransformation.java b/src/main/java/org/codehaus/groovy/transform/AbstractASTTransformation.java
index c13c8ef..9e27ce6 100644
--- a/src/main/java/org/codehaus/groovy/transform/AbstractASTTransformation.java
+++ b/src/main/java/org/codehaus/groovy/transform/AbstractASTTransformation.java
@@ -67,8 +67,8 @@ public abstract class AbstractASTTransformation implements Opcodes, ASTTransform
      * Annotations with {@link org.codehaus.groovy.runtime.GeneratedClosure} members are not supported for now.
      */
     protected List<AnnotationNode> copyAnnotatedNodeAnnotations(final AnnotatedNode annotatedNode, String myTypeName) {
-        final List<AnnotationNode> copiedAnnotations = new ArrayList<AnnotationNode>();
-        final List<AnnotationNode> notCopied = new ArrayList<AnnotationNode>();
+        final List<AnnotationNode> copiedAnnotations = new ArrayList<>();
+        final List<AnnotationNode> notCopied = new ArrayList<>();
         GeneralUtils.copyAnnotatedNodeAnnotations(annotatedNode, copiedAnnotations, notCopied);
         for (AnnotationNode annotation : notCopied) {
             addError(myTypeName + " does not support keeping Closure annotation members.", annotation);
@@ -188,7 +188,7 @@ public abstract class AbstractASTTransformation implements Opcodes, ASTTransform
     }
 
     private static List<String> getValueStringList(ListExpression listExpression) {
-        List<String> list = new ArrayList<String>();
+        List<String> list = new ArrayList<>();
         for (Expression itemExpr : listExpression.getExpressions()) {
             if (itemExpr instanceof ConstantExpression) {
                 Object value = ((ConstantExpression) itemExpr).getValue();
@@ -200,7 +200,7 @@ public abstract class AbstractASTTransformation implements Opcodes, ASTTransform
 
     @Deprecated
     public List<ClassNode> getClassList(AnnotationNode anno, String name) {
-        List<ClassNode> list = new ArrayList<ClassNode>();
+        List<ClassNode> list = new ArrayList<>();
         Expression expr = anno.getMember(name);
         if (expr instanceof ListExpression) {
             final ListExpression listExpression = (ListExpression) expr;
@@ -213,7 +213,7 @@ public abstract class AbstractASTTransformation implements Opcodes, ASTTransform
     }
 
     public List<ClassNode> getMemberClassList(AnnotationNode anno, String name) {
-        List<ClassNode> list = new ArrayList<ClassNode>();
+        List<ClassNode> list = new ArrayList<>();
         Expression expr = anno.getMember(name);
         if (expr == null) {
             return null;
@@ -233,7 +233,7 @@ public abstract class AbstractASTTransformation implements Opcodes, ASTTransform
     }
 
     private static List<ClassNode> getTypeList(ListExpression listExpression) {
-        List<ClassNode> list = new ArrayList<ClassNode>();
+        List<ClassNode> list = new ArrayList<>();
         for (Expression itemExpr : listExpression.getExpressions()) {
             if (itemExpr instanceof ClassExpression) {
                 ClassNode cn = itemExpr.getType();
@@ -265,7 +265,7 @@ public abstract class AbstractASTTransformation implements Opcodes, ASTTransform
     }
 
     public static List<String> tokenize(String rawExcludes) {
-        return rawExcludes == null ? new ArrayList<String>() : StringGroovyMethods.tokenize(rawExcludes, ", ");
+        return rawExcludes == null ? new ArrayList<>() : StringGroovyMethods.tokenize(rawExcludes, ", ");
     }
 
     public static boolean deemedInternalName(String name) {
@@ -297,7 +297,7 @@ public abstract class AbstractASTTransformation implements Opcodes, ASTTransform
         String descriptor = mNode.getTypeDescriptor();
         String descriptorNoReturn = MethodNodeUtils.methodDescriptorWithoutReturnType(mNode);
         for (ClassNode cn : excludeTypes) {
-            List<ClassNode> remaining = new LinkedList<ClassNode>();
+            List<ClassNode> remaining = new LinkedList<>();
             remaining.add(cn);
             Map updatedGenericsSpec = new HashMap(genericsSpec);
             while (!remaining.isEmpty()) {
@@ -320,7 +320,7 @@ public abstract class AbstractASTTransformation implements Opcodes, ASTTransform
         }
         if (includeTypes.isEmpty()) return false;
         for (ClassNode cn : includeTypes) {
-            List<ClassNode> remaining = new LinkedList<ClassNode>();
+            List<ClassNode> remaining = new LinkedList<>();
             remaining.add(cn);
             Map updatedGenericsSpec = new HashMap(genericsSpec);
             while (!remaining.isEmpty()) {
@@ -349,7 +349,7 @@ public abstract class AbstractASTTransformation implements Opcodes, ASTTransform
         String descriptorNoReturn = MethodNodeUtils.methodDescriptorWithoutReturnType(mNode);
         if (excludeTypes != null) {
             for (ClassNode cn : excludeTypes) {
-                List<ClassNode> remaining = new LinkedList<ClassNode>();
+                List<ClassNode> remaining = new LinkedList<>();
                 remaining.add(cn);
                 Map updatedGenericsSpec = new HashMap(genericsSpec);
                 while (!remaining.isEmpty()) {
@@ -373,7 +373,7 @@ public abstract class AbstractASTTransformation implements Opcodes, ASTTransform
         }
         if (includeTypes == null) return false;
         for (ClassNode cn : includeTypes) {
-            List<ClassNode> remaining = new LinkedList<ClassNode>();
+            List<ClassNode> remaining = new LinkedList<>();
             remaining.add(cn);
             Map updatedGenericsSpec = new HashMap(genericsSpec);
             while (!remaining.isEmpty()) {
@@ -450,13 +450,13 @@ public abstract class AbstractASTTransformation implements Opcodes, ASTTransform
         if (propertyNameList == null || propertyNameList.isEmpty()) {
             return true;
         }
-        final List<String> pNames = new ArrayList<String>();
+        final List<String> pNames = new ArrayList<>();
         for (PropertyNode pNode : BeanUtils.getAllProperties(cNode, includeSuperProperties, includeStatic, allProperties)) {
             pNames.add(pNode.getField().getName());
         }
         boolean result = true;
         if (includeFields || includeSuperFields) {
-            final List<String> fNames = new ArrayList<String>();
+            final List<String> fNames = new ArrayList<>();
             if (includeFields) {
                 fNames.addAll(getInstanceNonPropertyFieldNames(cNode));
             }

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/transform/AnnotationCollectorTransform.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/transform/AnnotationCollectorTransform.java b/src/main/java/org/codehaus/groovy/transform/AnnotationCollectorTransform.java
index 4d00531..59bece0 100644
--- a/src/main/java/org/codehaus/groovy/transform/AnnotationCollectorTransform.java
+++ b/src/main/java/org/codehaus/groovy/transform/AnnotationCollectorTransform.java
@@ -115,7 +115,7 @@ public class AnnotationCollectorTransform {
 
             // add static value():Object[][] method
             List<AnnotationNode> meta = getMeta(cn); 
-            List<Expression> outer = new ArrayList<Expression>(meta.size());
+            List<Expression> outer = new ArrayList<>(meta.size());
             for (AnnotationNode an : meta) {
                 Expression serialized = serialize(an);
                 outer.add(serialized);
@@ -146,7 +146,7 @@ public class AnnotationCollectorTransform {
                 boolean annotationConstant = false;
                 ListExpression le = (ListExpression) e;
                 List<Expression> list = le.getExpressions();
-                List<Expression> newList = new ArrayList<Expression>(list.size());
+                List<Expression> newList = new ArrayList<>(list.size());
                 for (Expression exp: list) {
                     annotationConstant = annotationConstant || exp instanceof AnnotationConstantExpression;
                     newList.add(serialize(exp));
@@ -163,7 +163,7 @@ public class AnnotationCollectorTransform {
             for (String key : an.getMembers().keySet()) {
                 map.addMapEntryExpression(new ConstantExpression(key), serialize(an.getMember(key)));
             }
-            List<Expression> l = new ArrayList<Expression>(2);
+            List<Expression> l = new ArrayList<>(2);
             l.add(new ClassExpression(an.getClassNode()));
             l.add(map);
             return new ArrayExpression(ClassHelper.OBJECT_TYPE, l);
@@ -197,7 +197,7 @@ public class AnnotationCollectorTransform {
         if (memberList.isEmpty()) {
             return Collections.emptyList();
         }
-        List<AnnotationNode> ret = new ArrayList<AnnotationNode>();
+        List<AnnotationNode> ret = new ArrayList<>();
         for (Expression e : memberList) {
             AnnotationNode toAdd = new AnnotationNode(e.getType());
             toAdd.setSourcePosition(aliasAnnotationUsage);
@@ -214,7 +214,7 @@ public class AnnotationCollectorTransform {
 
     private static List<AnnotationNode> copy(List<AnnotationNode> orig, AnnotationNode aliasAnnotationUsage) {
         if (orig.isEmpty()) return orig;
-        List<AnnotationNode> ret = new ArrayList<AnnotationNode>(orig.size());
+        List<AnnotationNode> ret = new ArrayList<>(orig.size());
         for (AnnotationNode an : orig) {
             AnnotationNode newAn = new AnnotationNode(an.getClassNode());
             copyMembers(an, newAn);
@@ -229,7 +229,7 @@ public class AnnotationCollectorTransform {
         if (annotations.size() < 2) {
             return Collections.emptyList();
         }
-        List<AnnotationNode> ret = new ArrayList<AnnotationNode>(annotations.size());
+        List<AnnotationNode> ret = new ArrayList<>(annotations.size());
         for (AnnotationNode an : annotations) {
             ClassNode type = an.getClassNode();
             if (type.getName().equals(AnnotationCollector.class.getName())) continue;
@@ -267,7 +267,7 @@ public class AnnotationCollectorTransform {
         if (data.length == 0) {
             return Collections.emptyList();
         }
-        List<AnnotationNode> ret = new ArrayList<AnnotationNode>(data.length);
+        List<AnnotationNode> ret = new ArrayList<>(data.length);
         for (Object[] inner : data) {
             Class<?> anno = (Class) inner[0];
             AnnotationNode toAdd = new AnnotationNode(ClassHelper.make(anno));
@@ -278,7 +278,7 @@ public class AnnotationCollectorTransform {
             if (member.isEmpty()) {
                 continue;
             }
-            Map<String, Expression> generated = new HashMap<String, Expression>(member.size());
+            Map<String, Expression> generated = new HashMap<>(member.size());
             for (Map.Entry<String, Object> entry : member.entrySet()) {
                 generated.put(entry.getKey(), makeExpression(entry.getValue()));
             }
@@ -325,7 +325,7 @@ public class AnnotationCollectorTransform {
         if (size == 0) {
             return Collections.emptyList();
         }
-        List<AnnotationNode> ret = new ArrayList<AnnotationNode>(size);
+        List<AnnotationNode> ret = new ArrayList<>(size);
         ret.addAll(stored);
         ret.addAll(targetList);
 
@@ -348,7 +348,7 @@ public class AnnotationCollectorTransform {
      */
     public List<AnnotationNode> visit(AnnotationNode collector, AnnotationNode aliasAnnotationUsage, AnnotatedNode aliasAnnotated, SourceUnit source) {
         List<AnnotationNode> ret =  getTargetAnnotationList(collector, aliasAnnotationUsage, source);
-        Set<String> unusedNames = new HashSet<String>(aliasAnnotationUsage.getMembers().keySet());
+        Set<String> unusedNames = new HashSet<>(aliasAnnotationUsage.getMembers().keySet());
         
         for (AnnotationNode an: ret) {
             for (String name : aliasAnnotationUsage.getMembers().keySet()) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/transform/AutoImplementASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/transform/AutoImplementASTTransformation.java b/src/main/java/org/codehaus/groovy/transform/AutoImplementASTTransformation.java
index 0507116..cd5e3cd 100644
--- a/src/main/java/org/codehaus/groovy/transform/AutoImplementASTTransformation.java
+++ b/src/main/java/org/codehaus/groovy/transform/AutoImplementASTTransformation.java
@@ -105,7 +105,7 @@ public class AutoImplementASTTransformation extends AbstractASTTransformation {
      * by a concrete declared/inherited method.
      */
     private static Map<String, MethodNode> getAllCorrectedMethodsMap(ClassNode cNode) {
-        Map<String, MethodNode> result = new HashMap<String, MethodNode>();
+        Map<String, MethodNode> result = new HashMap<>();
         for (MethodNode mn : cNode.getMethods()) {
             result.put(methodDescriptorWithoutReturnType(mn), mn);
         }
@@ -126,8 +126,8 @@ public class AutoImplementASTTransformation extends AbstractASTTransformation {
                     }
                 }
             }
-            List<ClassNode> interfaces = new ArrayList<ClassNode>(Arrays.asList(next.getInterfaces()));
-            Map<String, ClassNode> updatedGenericsSpec = new HashMap<String, ClassNode>(genericsSpec);
+            List<ClassNode> interfaces = new ArrayList<>(Arrays.asList(next.getInterfaces()));
+            Map<String, ClassNode> updatedGenericsSpec = new HashMap<>(genericsSpec);
             while (!interfaces.isEmpty()) {
                 ClassNode origInterface = interfaces.remove(0);
                 if (!origInterface.equals(ClassHelper.OBJECT_TYPE)) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/transform/BuilderASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/transform/BuilderASTTransformation.java b/src/main/java/org/codehaus/groovy/transform/BuilderASTTransformation.java
index 3f4ea27..19e443f 100644
--- a/src/main/java/org/codehaus/groovy/transform/BuilderASTTransformation.java
+++ b/src/main/java/org/codehaus/groovy/transform/BuilderASTTransformation.java
@@ -88,7 +88,7 @@ public class BuilderASTTransformation extends AbstractASTTransformation implemen
         }
 
         protected static List<PropertyInfo> getPropertyInfoFromClassNode(ClassNode cNode, List<String> includes, List<String> excludes, boolean allNames) {
-            List<PropertyInfo> props = new ArrayList<PropertyInfo>();
+            List<PropertyInfo> props = new ArrayList<>();
             for (FieldNode fNode : getInstancePropertyFields(cNode)) {
                 if (shouldSkip(fNode.getName(), excludes, includes, allNames)) continue;
                 props.add(new PropertyInfo(fNode.getName(), fNode.getType()));
@@ -97,7 +97,7 @@ public class BuilderASTTransformation extends AbstractASTTransformation implemen
         }
 
         protected static List<PropertyInfo> getPropertyInfoFromBeanInfo(ClassNode cNode, List<String> includes, List<String> excludes, boolean allNames) {
-            final List<PropertyInfo> result = new ArrayList<PropertyInfo>();
+            final List<PropertyInfo> result = new ArrayList<>();
             try {
                 BeanInfo beanInfo = Introspector.getBeanInfo(cNode.getTypeClass());
                 for (PropertyDescriptor descriptor : beanInfo.getPropertyDescriptors()) {
@@ -188,8 +188,8 @@ public class BuilderASTTransformation extends AbstractASTTransformation implemen
         }
 
         protected List<PropertyInfo> getPropertyInfoFromClassNode(BuilderASTTransformation transform, AnnotationNode anno, ClassNode cNode, List<String> includes, List<String> excludes, boolean allNames, boolean allProperties) {
-            List<PropertyInfo> props = new ArrayList<PropertyInfo>();
-            List<String> seen = new ArrayList<String>();
+            List<PropertyInfo> props = new ArrayList<>();
+            List<String> seen = new ArrayList<>();
             for (PropertyNode pNode : BeanUtils.getAllProperties(cNode, false, false, allProperties)) {
                 if (shouldSkip(pNode.getName(), excludes, includes, allNames)) continue;
                 props.add(new PropertyInfo(pNode.getName(), pNode.getType()));

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/transform/CategoryASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/transform/CategoryASTTransformation.java b/src/main/java/org/codehaus/groovy/transform/CategoryASTTransformation.java
index 2e9831c..30736b1 100644
--- a/src/main/java/org/codehaus/groovy/transform/CategoryASTTransformation.java
+++ b/src/main/java/org/codehaus/groovy/transform/CategoryASTTransformation.java
@@ -92,10 +92,10 @@ public class CategoryASTTransformation implements ASTTransformation, Opcodes {
         ClassNode targetClass = getTargetClass(source, annotation);
         thisExpression.setType(targetClass);
 
-        final LinkedList<Set<String>> varStack = new LinkedList<Set<String>>();
+        final LinkedList<Set<String>> varStack = new LinkedList<>();
         if (!ensureNoInstanceFieldOrProperty(source, parent)) return;
 
-        Set<String> names = new HashSet<String>();
+        Set<String> names = new HashSet<>();
         for (FieldNode field : parent.getFields()) {
             names.add(field.getName());
         }
@@ -111,7 +111,7 @@ public class CategoryASTTransformation implements ASTTransformation, Opcodes {
             }
 
             private void addVariablesToStack(Parameter[] params) {
-                Set<String> names = new HashSet<String>(varStack.getLast());
+                Set<String> names = new HashSet<>(varStack.getLast());
                 for (Parameter param : params) {
                     names.add(param.getName());
                 }
@@ -134,7 +134,7 @@ public class CategoryASTTransformation implements ASTTransformation, Opcodes {
 
             @Override
             public void visitBlockStatement(BlockStatement block) {
-                Set<String> names = new HashSet<String>(varStack.getLast());
+                Set<String> names = new HashSet<>(varStack.getLast());
                 varStack.add(names);
                 super.visitBlockStatement(block);
                 varStack.remove(names);

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/transform/DelegateASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/transform/DelegateASTTransformation.java b/src/main/java/org/codehaus/groovy/transform/DelegateASTTransformation.java
index 7195255..6d8aaeb 100644
--- a/src/main/java/org/codehaus/groovy/transform/DelegateASTTransformation.java
+++ b/src/main/java/org/codehaus/groovy/transform/DelegateASTTransformation.java
@@ -223,8 +223,8 @@ public class DelegateASTTransformation extends AbstractASTTransformation {
             if (cNode.getGetterMethod("get" + suffix) != null && cNode.getGetterMethod("is" + suffix) == null)
                 willHaveIsAccessor = false;
         }
-        Reference<Boolean> ownerWillHaveGetAccessor = new Reference<Boolean>();
-        Reference<Boolean> ownerWillHaveIsAccessor = new Reference<Boolean>();
+        Reference<Boolean> ownerWillHaveGetAccessor = new Reference<>();
+        Reference<Boolean> ownerWillHaveIsAccessor = new Reference<>();
         extractAccessorInfo(delegate.owner, name, ownerWillHaveGetAccessor, ownerWillHaveIsAccessor);
 
         for (String prefix : new String[]{"get", "is"}) {
@@ -343,7 +343,7 @@ public class DelegateASTTransformation extends AbstractASTTransformation {
 
     private static List<String> genericPlaceholderNames(MethodNode candidate) {
         GenericsType[] candidateGenericsTypes = candidate.getGenericsTypes();
-        List<String> names = new ArrayList<String>();
+        List<String> names = new ArrayList<>();
         if (candidateGenericsTypes != null) {
             for (GenericsType gt : candidateGenericsTypes) {
                 names.add(gt.getName());

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/transform/EqualsAndHashCodeASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/transform/EqualsAndHashCodeASTTransformation.java b/src/main/java/org/codehaus/groovy/transform/EqualsAndHashCodeASTTransformation.java
index a5068f2..2175b79 100644
--- a/src/main/java/org/codehaus/groovy/transform/EqualsAndHashCodeASTTransformation.java
+++ b/src/main/java/org/codehaus/groovy/transform/EqualsAndHashCodeASTTransformation.java
@@ -154,9 +154,9 @@ public class EqualsAndHashCodeASTTransformation extends AbstractASTTransformatio
     }
 
     private static Statement calculateHashStatements(ClassNode cNode, Expression hash, boolean includeFields, boolean callSuper, List<String> excludes, List<String> includes, boolean allNames, boolean allProperties) {
-        final Set<String> names = new HashSet<String>();
+        final Set<String> names = new HashSet<>();
         final List<PropertyNode> pList = getAllProperties(names, cNode, true, false, allProperties, false, false, false);
-        final List<FieldNode> fList = new ArrayList<FieldNode>();
+        final List<FieldNode> fList = new ArrayList<>();
         if (includeFields) {
             fList.addAll(getInstanceNonPropertyFields(cNode));
         }
@@ -251,7 +251,7 @@ public class EqualsAndHashCodeASTTransformation extends AbstractASTTransformatio
             body.addStatement(ifS(notX(callX(otherTyped, "canEqual", varX("this"))), returnS(constX(Boolean.FALSE,true))));
         }
 
-        final Set<String> names = new HashSet<String>();
+        final Set<String> names = new HashSet<>();
         final List<PropertyNode> pList = getAllProperties(names, cNode, true, includeFields, allProperties, false, false, false);
         for (PropertyNode pNode : pList) {
             if (shouldSkipUndefinedAware(pNode.getName(), excludes, includes, allNames)) continue;
@@ -272,7 +272,7 @@ public class EqualsAndHashCodeASTTransformation extends AbstractASTTransformatio
                 );
             }
         }
-        List<FieldNode> fList = new ArrayList<FieldNode>();
+        List<FieldNode> fList = new ArrayList<>();
         if (includeFields) {
             fList.addAll(getInstanceNonPropertyFields(cNode));
         }

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/transform/FieldASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/transform/FieldASTTransformation.java b/src/main/java/org/codehaus/groovy/transform/FieldASTTransformation.java
index 115a90d..7ffa2d1 100644
--- a/src/main/java/org/codehaus/groovy/transform/FieldASTTransformation.java
+++ b/src/main/java/org/codehaus/groovy/transform/FieldASTTransformation.java
@@ -206,7 +206,7 @@ public class FieldASTTransformation extends ClassCodeExpressionTransformer imple
     }
 
     private Expression adjustedArgList(Expression skip, List<Expression> origArgs) {
-        List<Expression> newArgs = new ArrayList<Expression>(origArgs.size() - 1);
+        List<Expression> newArgs = new ArrayList<>(origArgs.size() - 1);
         for (Expression origArg : origArgs) {
             if (skip != origArg) {
                 newArgs.add(origArg);

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/transform/ImmutableASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/transform/ImmutableASTTransformation.java b/src/main/java/org/codehaus/groovy/transform/ImmutableASTTransformation.java
index b8cc56c..05f66d7 100644
--- a/src/main/java/org/codehaus/groovy/transform/ImmutableASTTransformation.java
+++ b/src/main/java/org/codehaus/groovy/transform/ImmutableASTTransformation.java
@@ -116,7 +116,7 @@ public class ImmutableASTTransformation extends AbstractASTTransformation implem
     }
 
     private void doMakeImmutable(ClassNode cNode, AnnotationNode node, PropertyHandler handler) {
-        List<PropertyNode> newProperties = new ArrayList<PropertyNode>();
+        List<PropertyNode> newProperties = new ArrayList<>();
 
         String cName = cNode.getName();
         if (!checkNotInterface(cNode, MY_TYPE_NAME)) return;

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/transform/InheritConstructorsASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/transform/InheritConstructorsASTTransformation.java b/src/main/java/org/codehaus/groovy/transform/InheritConstructorsASTTransformation.java
index f7db6e4..6b1f6cf 100644
--- a/src/main/java/org/codehaus/groovy/transform/InheritConstructorsASTTransformation.java
+++ b/src/main/java/org/codehaus/groovy/transform/InheritConstructorsASTTransformation.java
@@ -104,7 +104,7 @@ public class InheritConstructorsASTTransformation extends AbstractASTTransformat
     }
 
     private List<Expression> buildParams(Parameter[] origParams, Parameter[] params, Map<String, ClassNode> genericsSpec, boolean copyParameterAnnotations) {
-        List<Expression> theArgs = new ArrayList<Expression>();
+        List<Expression> theArgs = new ArrayList<>();
         for (int i = 0; i < origParams.length; i++) {
             Parameter p = origParams[i];
             ClassNode newType = correctToGenericsSpecRecurse(genericsSpec, p.getType());

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/transform/MapConstructorASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/transform/MapConstructorASTTransformation.java b/src/main/java/org/codehaus/groovy/transform/MapConstructorASTTransformation.java
index 709cdb4..4bc2118 100644
--- a/src/main/java/org/codehaus/groovy/transform/MapConstructorASTTransformation.java
+++ b/src/main/java/org/codehaus/groovy/transform/MapConstructorASTTransformation.java
@@ -148,12 +148,12 @@ public class MapConstructorASTTransformation extends AbstractASTTransformation i
             if (next.getFirstStatement() == null) iterator.remove();
         }
 
-        Set<String> names = new HashSet<String>();
+        Set<String> names = new HashSet<>();
         List<PropertyNode> superList;
         if (includeSuperProperties || includeSuperFields) {
             superList = getAllProperties(names, cNode, cNode.getSuperClass(), includeSuperProperties, includeSuperFields, false, allProperties, true, false, false, allNames, includeStatic);
         } else {
-            superList = new ArrayList<PropertyNode>();
+            superList = new ArrayList<>();
         }
         List<PropertyNode> list = getAllProperties(names, cNode, cNode, includeProperties, includeFields, false, allProperties, false, false, false, allNames, includeStatic);
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/transform/MemoizedASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/transform/MemoizedASTTransformation.java b/src/main/java/org/codehaus/groovy/transform/MemoizedASTTransformation.java
index c20c075..f577ce8 100644
--- a/src/main/java/org/codehaus/groovy/transform/MemoizedASTTransformation.java
+++ b/src/main/java/org/codehaus/groovy/transform/MemoizedASTTransformation.java
@@ -136,7 +136,7 @@ public class MemoizedASTTransformation extends AbstractASTTransformation {
     }
 
     private static List<AnnotationNode> filterAnnotations(List<AnnotationNode> annotations) {
-        List<AnnotationNode> result = new ArrayList<AnnotationNode>(annotations.size());
+        List<AnnotationNode> result = new ArrayList<>(annotations.size());
         for (AnnotationNode annotation : annotations) {
             if (!OVERRIDE_CLASSNODE.equals(annotation.getClassNode())) {
                 result.add(annotation);
@@ -154,7 +154,7 @@ public class MemoizedASTTransformation extends AbstractASTTransformation {
                                                                    int protectedCacheSize, int maxCacheSize) {
         Parameter[] srcParams = privateMethod.getParameters();
         Parameter[] newParams = cloneParams(srcParams);
-        List<Expression> argList = new ArrayList<Expression>(newParams.length);
+        List<Expression> argList = new ArrayList<>(newParams.length);
         for (int i = 0; i < srcParams.length; i++) {
             argList.add(varX(newParams[i]));
         }

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/transform/NamedVariantASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/transform/NamedVariantASTTransformation.java b/src/main/java/org/codehaus/groovy/transform/NamedVariantASTTransformation.java
index b5e85e7..e855004 100644
--- a/src/main/java/org/codehaus/groovy/transform/NamedVariantASTTransformation.java
+++ b/src/main/java/org/codehaus/groovy/transform/NamedVariantASTTransformation.java
@@ -90,12 +90,12 @@ public class NamedVariantASTTransformation extends AbstractASTTransformation {
         }
 
         Parameter mapParam = param(GenericsUtils.nonGeneric(ClassHelper.MAP_TYPE), "__namedArgs");
-        List<Parameter> genParams = new ArrayList<Parameter>();
+        List<Parameter> genParams = new ArrayList<>();
         genParams.add(mapParam);
         ClassNode cNode = mNode.getDeclaringClass();
         final BlockStatement inner = new BlockStatement();
         ArgumentListExpression args = new ArgumentListExpression();
-        final List<String> propNames = new ArrayList<String>();
+        final List<String> propNames = new ArrayList<>();
 
         // first pass, just check for absence of annotations of interest
         boolean annoFound = false;
@@ -194,12 +194,12 @@ public class NamedVariantASTTransformation extends AbstractASTTransformation {
             }
         }
 
-        Set<String> names = new HashSet<String>();
+        Set<String> names = new HashSet<>();
         List<PropertyNode> props = getAllProperties(names, fromParam.getType(), true, false, false, true, false, true);
         for (String next : names) {
             if (hasDuplicates(mNode, propNames, next)) return false;
         }
-        List<MapEntryExpression> entries = new ArrayList<MapEntryExpression>();
+        List<MapEntryExpression> entries = new ArrayList<>();
         for (PropertyNode pNode : props) {
             String name = pNode.getName();
             entries.add(new MapEntryExpression(constX(name), propX(varX(mapParam), name)));

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/transform/NewifyASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/transform/NewifyASTTransformation.java b/src/main/java/org/codehaus/groovy/transform/NewifyASTTransformation.java
index ae71b14..27187a8 100644
--- a/src/main/java/org/codehaus/groovy/transform/NewifyASTTransformation.java
+++ b/src/main/java/org/codehaus/groovy/transform/NewifyASTTransformation.java
@@ -121,7 +121,7 @@ public class NewifyASTTransformation extends ClassCodeExpressionTransformer impl
     };
 
     static {
-        nameToGlobalClassesNodesMap = new ConcurrentHashMap<String, ClassNode>(16, 0.9f, 1);
+        nameToGlobalClassesNodesMap = new ConcurrentHashMap<>(16, 0.9f, 1);
         for (Class globalClass : globalClasses) {
             nameToGlobalClassesNodesMap.put(globalClass.getSimpleName(), ClassHelper.makeCached(globalClass));
         }
@@ -344,7 +344,7 @@ public class NewifyASTTransformation extends ClassCodeExpressionTransformer impl
 
 
     private void checkDuplicateNameClashes(ListExpression list) {
-        final Set<String> seen = new HashSet<String>();
+        final Set<String> seen = new HashSet<>();
         @SuppressWarnings("unchecked") final List<ClassExpression> classes = (List) list.getExpressions();
         for (ClassExpression ce : classes) {
             final String name = ce.getType().getNameWithoutPackage();
@@ -406,7 +406,7 @@ public class NewifyASTTransformation extends ClassCodeExpressionTransformer impl
                 final List<Expression> argExpList = argsListExp.getExpressions();
                 final VariableExpression thisVarExp = new VariableExpression("this");
 
-                final List<Expression> expressionsWithThis = new ArrayList<Expression>(argExpList.size() + 1);
+                final List<Expression> expressionsWithThis = new ArrayList<>(argExpList.size() + 1);
                 expressionsWithThis.add(thisVarExp);
                 expressionsWithThis.addAll(argExpList);
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/transform/PackageScopeASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/transform/PackageScopeASTTransformation.java b/src/main/java/org/codehaus/groovy/transform/PackageScopeASTTransformation.java
index 70851dd..eec0728 100644
--- a/src/main/java/org/codehaus/groovy/transform/PackageScopeASTTransformation.java
+++ b/src/main/java/org/codehaus/groovy/transform/PackageScopeASTTransformation.java
@@ -116,8 +116,8 @@ public class PackageScopeASTTransformation extends AbstractASTTransformation {
         }
         if (value.contains(PackageScopeTarget.FIELDS)) {
             final List<PropertyNode> pList = cNode.getProperties();
-            List<PropertyNode> foundProps = new ArrayList<PropertyNode>();
-            List<String> foundNames = new ArrayList<String>();
+            List<PropertyNode> foundProps = new ArrayList<>();
+            List<String> foundNames = new ArrayList<>();
             for (PropertyNode pNode : pList) {
                 foundProps.add(pNode);
                 foundNames.add(pNode.getName());
@@ -163,7 +163,7 @@ public class PackageScopeASTTransformation extends AbstractASTTransformation {
     }
 
     private static List<groovy.transform.PackageScopeTarget> determineTargets(Expression expr) {
-        List<groovy.transform.PackageScopeTarget> list = new ArrayList<groovy.transform.PackageScopeTarget>();
+        List<groovy.transform.PackageScopeTarget> list = new ArrayList<>();
         if (expr instanceof PropertyExpression) {
             list.add(extractTarget((PropertyExpression) expr));
         } else if (expr instanceof ListExpression) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/transform/SortableASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/transform/SortableASTTransformation.java b/src/main/java/org/codehaus/groovy/transform/SortableASTTransformation.java
index 68c0c72..332f726 100644
--- a/src/main/java/org/codehaus/groovy/transform/SortableASTTransformation.java
+++ b/src/main/java/org/codehaus/groovy/transform/SortableASTTransformation.java
@@ -139,7 +139,7 @@ public class SortableASTTransformation extends AbstractASTTransformation {
     }
 
     private static Statement createCompareToMethodBody(List<PropertyNode> properties, boolean reversed) {
-        List<Statement> statements = new ArrayList<Statement>();
+        List<Statement> statements = new ArrayList<>();
 
         // if (this.is(other)) return 0;
         statements.add(ifS(callThisX("is", args(OTHER)), returnS(constX(0))));
@@ -220,10 +220,10 @@ public class SortableASTTransformation extends AbstractASTTransformation {
     private List<PropertyNode> findProperties(AnnotationNode annotation, final ClassNode classNode, final List<String> includes,
                                               final List<String> excludes, final boolean allProperties,
                                               final boolean includeSuperProperties, final boolean allNames) {
-        Set<String> names = new HashSet<String>();
+        Set<String> names = new HashSet<>();
         List<PropertyNode> props = getAllProperties(names, classNode, classNode, true, false, allProperties,
                 false, includeSuperProperties, false, false, allNames, false);
-        List<PropertyNode> properties = new ArrayList<PropertyNode>();
+        List<PropertyNode> properties = new ArrayList<>();
         for (PropertyNode property : props) {
             String propertyName = property.getName();
             if ((excludes != null && excludes.contains(propertyName)) ||

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/transform/ToStringASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/transform/ToStringASTTransformation.java b/src/main/java/org/codehaus/groovy/transform/ToStringASTTransformation.java
index 3a76685..702b65e 100644
--- a/src/main/java/org/codehaus/groovy/transform/ToStringASTTransformation.java
+++ b/src/main/java/org/codehaus/groovy/transform/ToStringASTTransformation.java
@@ -177,7 +177,7 @@ public class ToStringASTTransformation extends AbstractASTTransformation {
         // def _result = new StringBuilder()
         final Expression result = varX("_result");
         body.addStatement(declS(result, ctorX(STRINGBUILDER_TYPE)));
-        List<ToStringElement> elements = new ArrayList<ToStringElement>();
+        List<ToStringElement> elements = new ArrayList<>();
 
         // def $toStringFirst = true
         final VariableExpression first = varX("$toStringFirst");
@@ -187,12 +187,12 @@ public class ToStringASTTransformation extends AbstractASTTransformation {
         String className = (includePackage) ? cNode.getName() : cNode.getNameWithoutPackage();
         body.addStatement(appendS(result, constX(className + "(")));
 
-        Set<String> names = new HashSet<String>();
+        Set<String> names = new HashSet<>();
         List<PropertyNode> superList;
         if (includeSuperProperties || includeSuperFields) {
             superList = getAllProperties(names, cNode, cNode.getSuperClass(), includeSuperProperties, includeSuperFields, allProperties, false, true, true, true, allNames, false);
         } else {
-            superList = new ArrayList<PropertyNode>();
+            superList = new ArrayList<>();
         }
         List<PropertyNode> list = getAllProperties(names, cNode, cNode,true, includeFields, allProperties, false, false, true, false, allNames, false);
         list.addAll(superList);


Mime
View raw message