groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [5/8] groovy git commit: Minor refactoring: Explicit type can be replaced with <>
Date Sat, 25 Aug 2018 16:44:53 GMT
http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/classgen/ClassGenerator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/ClassGenerator.java b/src/main/java/org/codehaus/groovy/classgen/ClassGenerator.java
index 2ed8661..4697f03 100644
--- a/src/main/java/org/codehaus/groovy/classgen/ClassGenerator.java
+++ b/src/main/java/org/codehaus/groovy/classgen/ClassGenerator.java
@@ -33,7 +33,7 @@ import java.util.LinkedList;
  */
 public abstract class ClassGenerator extends ClassCodeVisitorSupport implements Opcodes {
     // inner classes created while generating bytecode
-    protected LinkedList<ClassNode> innerClasses = new LinkedList<ClassNode>();
+    protected LinkedList<ClassNode> innerClasses = new LinkedList<>();
 
     public LinkedList<ClassNode> getInnerClasses() {
         return innerClasses;

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/classgen/EnumCompletionVisitor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/EnumCompletionVisitor.java b/src/main/java/org/codehaus/groovy/classgen/EnumCompletionVisitor.java
index 8ef3a04..f9829ed 100644
--- a/src/main/java/org/codehaus/groovy/classgen/EnumCompletionVisitor.java
+++ b/src/main/java/org/codehaus/groovy/classgen/EnumCompletionVisitor.java
@@ -81,7 +81,7 @@ public class EnumCompletionVisitor extends ClassCodeVisitorSupport {
     private static void addImplicitConstructors(ClassNode enumClass, boolean aic) {
         if (aic) {
             ClassNode sn = enumClass.getSuperClass();
-            List<ConstructorNode> sctors = new ArrayList<ConstructorNode>(sn.getDeclaredConstructors());
+            List<ConstructorNode> sctors = new ArrayList<>(sn.getDeclaredConstructors());
             if (sctors.isEmpty()) {
                 addMapConstructors(enumClass);
             } else {
@@ -127,7 +127,7 @@ public class EnumCompletionVisitor extends ClassCodeVisitorSupport {
             argsExprs.add(1, intVariable);
         } else {
             // add a super call
-            List<Expression> args = new ArrayList<Expression>();
+            List<Expression> args = new ArrayList<>();
             args.add(stringVariable);
             args.add(intVariable);
             if (isAic) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/classgen/EnumVisitor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/EnumVisitor.java b/src/main/java/org/codehaus/groovy/classgen/EnumVisitor.java
index 743801f..c9b47e1 100644
--- a/src/main/java/org/codehaus/groovy/classgen/EnumVisitor.java
+++ b/src/main/java/org/codehaus/groovy/classgen/EnumVisitor.java
@@ -317,10 +317,10 @@ public class EnumVisitor extends ClassCodeVisitorSupport {
 
         // static init
         List<FieldNode> fields = enumClass.getFields();
-        List<Expression> arrayInit = new ArrayList<Expression>();
+        List<Expression> arrayInit = new ArrayList<>();
         int value = -1;
         Token assign = Token.newSymbol(Types.ASSIGN, -1, -1);
-        List<Statement> block = new ArrayList<Statement>();
+        List<Statement> block = new ArrayList<>();
         FieldNode tempMin = null;
         FieldNode tempMax = null;
         for (FieldNode field : fields) {
@@ -340,7 +340,7 @@ public class EnumVisitor extends ClassCodeVisitorSupport {
                 }
             } else {
                 ListExpression oldArgs = (ListExpression) field.getInitialExpression();
-                List<MapEntryExpression> savedMapEntries = new ArrayList<MapEntryExpression>();
+                List<MapEntryExpression> savedMapEntries = new ArrayList<>();
                 for (Expression exp : oldArgs.getExpressions()) {
                     if (exp instanceof MapEntryExpression) {
                         savedMapEntries.add((MapEntryExpression) exp);

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/classgen/ExtendedVerifier.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/ExtendedVerifier.java b/src/main/java/org/codehaus/groovy/classgen/ExtendedVerifier.java
index 8b7ed89..f58026c 100644
--- a/src/main/java/org/codehaus/groovy/classgen/ExtendedVerifier.java
+++ b/src/main/java/org/codehaus/groovy/classgen/ExtendedVerifier.java
@@ -152,14 +152,14 @@ public class ExtendedVerifier extends ClassCodeVisitorSupport {
             addError("Annotations are not supported in the current runtime. " + JVM_ERROR_MESSAGE, node);
             return;
         }
-        Map<String, List<AnnotationNode>> runtimeAnnotations = new LinkedHashMap<String, List<AnnotationNode>>();
+        Map<String, List<AnnotationNode>> runtimeAnnotations = new LinkedHashMap<>();
         for (AnnotationNode unvisited : node.getAnnotations()) {
             AnnotationNode visited = visitAnnotation(unvisited);
             String name = visited.getClassNode().getName();
             if (visited.hasRuntimeRetention()) {
                 List<AnnotationNode> seen = runtimeAnnotations.get(name);
                 if (seen == null) {
-                    seen = new ArrayList<AnnotationNode>();
+                    seen = new ArrayList<>();
                 }
                 seen.add(visited);
                 runtimeAnnotations.put(name, seen);
@@ -200,7 +200,7 @@ public class ExtendedVerifier extends ClassCodeVisitorSupport {
                 if (repeatable != null) {
                     AnnotationNode collector = new AnnotationNode(repeatable);
                     collector.setRuntimeRetention(true); // checked earlier
-                    List<Expression> annos = new ArrayList<Expression>();
+                    List<Expression> annos = new ArrayList<>();
                     for (AnnotationNode an : next.getValue()) {
                         annos.add(new AnnotationConstantExpression(an));
                     }
@@ -267,7 +267,7 @@ public class ExtendedVerifier extends ClassCodeVisitorSupport {
                 MethodNode found = getDeclaredMethodCorrected(genericsSpec, mn, correctedNext);
                 if (found != null) break;
             }
-            List<ClassNode> ifaces = new ArrayList<ClassNode>(Arrays.asList(next.getInterfaces()));
+            List<ClassNode> ifaces = new ArrayList<>(Arrays.asList(next.getInterfaces()));
             Map updatedGenericsSpec = new HashMap(genericsSpec);
             while (!ifaces.isEmpty()) {
                 ClassNode origInterface = ifaces.remove(0);

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/classgen/FinalVariableAnalyzer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/FinalVariableAnalyzer.java b/src/main/java/org/codehaus/groovy/classgen/FinalVariableAnalyzer.java
index 84c9546..2d9ce61 100644
--- a/src/main/java/org/codehaus/groovy/classgen/FinalVariableAnalyzer.java
+++ b/src/main/java/org/codehaus/groovy/classgen/FinalVariableAnalyzer.java
@@ -88,7 +88,7 @@ public class FinalVariableAnalyzer extends ClassCodeVisitorSupport {
         }
     }
 
-    private final Deque<Map<Variable, VariableState>> assignmentTracker = new LinkedList<Map<Variable, VariableState>>();
+    private final Deque<Map<Variable, VariableState>> assignmentTracker = new LinkedList<>();
 
     public FinalVariableAnalyzer(final SourceUnit sourceUnit) {
         this(sourceUnit, null);
@@ -138,7 +138,7 @@ public class FinalVariableAnalyzer extends ClassCodeVisitorSupport {
     @Override
     public void visitBlockStatement(final BlockStatement block) {
         Set<Variable> old = declaredFinalVariables;
-        declaredFinalVariables = new HashSet<Variable>();
+        declaredFinalVariables = new HashSet<>();
         super.visitBlockStatement(block);
         declaredFinalVariables = old;
     }
@@ -283,7 +283,7 @@ public class FinalVariableAnalyzer extends ClassCodeVisitorSupport {
 
         // merge if/else branches
         Map<Variable, VariableState> curState = getState();
-        Set<Variable> allVars = new HashSet<Variable>();
+        Set<Variable> allVars = new HashSet<>();
         allVars.addAll(curState.keySet());
         allVars.addAll(ifState.keySet());
         allVars.addAll(elseState.keySet());
@@ -317,24 +317,24 @@ public class FinalVariableAnalyzer extends ClassCodeVisitorSupport {
     @Override
     public void visitTryCatchFinally(final TryCatchStatement statement) {
         visitStatement(statement);
-        Map<Variable, VariableState> beforeTryState = new HashMap<Variable, VariableState>(getState());
+        Map<Variable, VariableState> beforeTryState = new HashMap<>(getState());
         pushState();
         Statement tryStatement = statement.getTryStatement();
         tryStatement.visit(this);
-        Map<Variable, VariableState> afterTryState = new HashMap<Variable, VariableState>(getState());
+        Map<Variable, VariableState> afterTryState = new HashMap<>(getState());
         Statement finallyStatement = statement.getFinallyStatement();
         List<Map<Variable, VariableState>> afterStates = new ArrayList<>();
         // the try finally case
         visitPossiblyEmptyStatement(finallyStatement);
         if (!returningBlock(tryStatement)) {
-            afterStates.add(new HashMap<Variable, VariableState>(getState()));
+            afterStates.add(new HashMap<>(getState()));
         }
         popState();
         // now the finally only case but only if no catches
         if (statement.getCatchStatements().isEmpty()) {
             visitPossiblyEmptyStatement(finallyStatement);
             if (!returningBlock(tryStatement)) {
-                afterStates.add(new HashMap<Variable, VariableState>(getState()));
+                afterStates.add(new HashMap<>(getState()));
             }
         }
         for (CatchStatement catchStatement : statement.getCatchStatements()) {
@@ -376,7 +376,7 @@ public class FinalVariableAnalyzer extends ClassCodeVisitorSupport {
         catchStatement.visit(this);
         visitPossiblyEmptyStatement(finallyStatement);
         if (code == null || !returningBlock(code)) {
-            afterTryCatchStates.add(new HashMap<Variable, VariableState>(getState()));
+            afterTryCatchStates.add(new HashMap<>(getState()));
         }
         popState();
     }

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/classgen/InnerClassVisitor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/InnerClassVisitor.java b/src/main/java/org/codehaus/groovy/classgen/InnerClassVisitor.java
index d2d570f..8f9d4f6 100644
--- a/src/main/java/org/codehaus/groovy/classgen/InnerClassVisitor.java
+++ b/src/main/java/org/codehaus/groovy/classgen/InnerClassVisitor.java
@@ -160,9 +160,9 @@ public class InnerClassVisitor extends InnerClassVisitorHelper implements Opcode
         BlockStatement block = new BlockStatement();
         // parameters = parameters of the constructor
         final int additionalParamCount = 1 + scope.getReferencedLocalVariablesCount();
-        List<Parameter> parameters = new ArrayList<Parameter>(expressions.size() + additionalParamCount);
+        List<Parameter> parameters = new ArrayList<>(expressions.size() + additionalParamCount);
         // superCallArguments = arguments for the super call == the constructor call arguments
-        List<Expression> superCallArguments = new ArrayList<Expression>(expressions.size());
+        List<Expression> superCallArguments = new ArrayList<>(expressions.size());
 
         // first we add a super() call for all expressions given in the 
         // constructor call expression

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/classgen/InnerClassVisitorHelper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/InnerClassVisitorHelper.java b/src/main/java/org/codehaus/groovy/classgen/InnerClassVisitorHelper.java
index 7ed0629..c6a59aa 100644
--- a/src/main/java/org/codehaus/groovy/classgen/InnerClassVisitorHelper.java
+++ b/src/main/java/org/codehaus/groovy/classgen/InnerClassVisitorHelper.java
@@ -47,10 +47,10 @@ import java.util.List;
 
 public abstract class InnerClassVisitorHelper extends ClassCodeVisitorSupport {
     protected static void setPropertyGetterDispatcher(BlockStatement block, Expression thiz, Parameter[] parameters) {
-        List<ConstantExpression> gStringStrings = new ArrayList<ConstantExpression>();
+        List<ConstantExpression> gStringStrings = new ArrayList<>();
         gStringStrings.add(new ConstantExpression(""));
         gStringStrings.add(new ConstantExpression(""));
-        List<Expression> gStringValues = new ArrayList<Expression>();
+        List<Expression> gStringValues = new ArrayList<>();
         gStringValues.add(new VariableExpression(parameters[0]));
         block.addStatement(
                 new ReturnStatement(
@@ -63,10 +63,10 @@ public abstract class InnerClassVisitorHelper extends ClassCodeVisitorSupport {
     }
 
     protected static void setPropertySetterDispatcher(BlockStatement block, Expression thiz, Parameter[] parameters) {
-        List<ConstantExpression> gStringStrings = new ArrayList<ConstantExpression>();
+        List<ConstantExpression> gStringStrings = new ArrayList<>();
         gStringStrings.add(new ConstantExpression(""));
         gStringStrings.add(new ConstantExpression(""));
-        List<Expression> gStringValues = new ArrayList<Expression>();
+        List<Expression> gStringValues = new ArrayList<>();
         gStringValues.add(new VariableExpression(parameters[0]));
         block.addStatement(
                 new ExpressionStatement(
@@ -83,10 +83,10 @@ public abstract class InnerClassVisitorHelper extends ClassCodeVisitorSupport {
     }
 
     protected static void setMethodDispatcherCode(BlockStatement block, Expression thiz, Parameter[] parameters) {
-        List<ConstantExpression> gStringStrings = new ArrayList<ConstantExpression>();
+        List<ConstantExpression> gStringStrings = new ArrayList<>();
         gStringStrings.add(new ConstantExpression(""));
         gStringStrings.add(new ConstantExpression(""));
-        List<Expression> gStringValues = new ArrayList<Expression>();
+        List<Expression> gStringValues = new ArrayList<>();
         gStringValues.add(new VariableExpression(parameters[0]));
         block.addStatement(
                 new ReturnStatement(

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/classgen/Verifier.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/Verifier.java b/src/main/java/org/codehaus/groovy/classgen/Verifier.java
index cd234f0..7b9bd32 100644
--- a/src/main/java/org/codehaus/groovy/classgen/Verifier.java
+++ b/src/main/java/org/codehaus/groovy/classgen/Verifier.java
@@ -216,11 +216,11 @@ public class Verifier implements GroovyClassVisitor, Opcodes {
         }
 
         ClassNode[] classNodes = classNode.getInterfaces();
-        List<String> interfaces = new ArrayList<String>();
+        List<String> interfaces = new ArrayList<>();
         for (ClassNode classNode : classNodes) {
             interfaces.add(classNode.getName());
         }
-        Set<String> interfaceSet = new HashSet<String>(interfaces);
+        Set<String> interfaceSet = new HashSet<>(interfaces);
         if (interfaceSet.size() != interfaces.size()) {
             throw new RuntimeParserException("Duplicate interfaces in implements list: " + interfaces, classNode);
         }
@@ -281,7 +281,7 @@ public class Verifier implements GroovyClassVisitor, Opcodes {
     }
 
     private static void checkForDuplicateMethods(ClassNode cn) {
-        Set<String> descriptors = new HashSet<String>();
+        Set<String> descriptors = new HashSet<>();
         for (MethodNode mn : cn.getMethods()) {
             if (mn.isSynthetic()) continue;
             String mySig = methodDescriptorWithoutReturnType(mn);
@@ -970,7 +970,7 @@ public class Verifier implements GroovyClassVisitor, Opcodes {
                         }
                     });
 
-            List<Statement> swapCall = new ArrayList<Statement>(1);
+            List<Statement> swapCall = new ArrayList<>(1);
             swapCall.add(seq);
             node.addStaticInitializerStatements(swapCall, true);
         }
@@ -987,11 +987,11 @@ public class Verifier implements GroovyClassVisitor, Opcodes {
         // in case of this(...) let the other constructor do the init
         if (first != null && (first.isThisCall())) return;
 
-        List<Statement> statements = new ArrayList<Statement>();
-        List<Statement> staticStatements = new ArrayList<Statement>();
+        List<Statement> statements = new ArrayList<>();
+        List<Statement> staticStatements = new ArrayList<>();
         final boolean isEnum = node.isEnum();
-        List<Statement> initStmtsAfterEnumValuesInit = new ArrayList<Statement>();
-        Set<String> explicitStaticPropsInEnum = new HashSet<String>();
+        List<Statement> initStmtsAfterEnumValuesInit = new ArrayList<>();
+        Set<String> explicitStaticPropsInEnum = new HashSet<>();
         if (isEnum) {
             for (PropertyNode propNode : node.getProperties()) {
                 if (!propNode.isSynthetic() && propNode.getField().isStatic()) {
@@ -1223,10 +1223,10 @@ public class Verifier implements GroovyClassVisitor, Opcodes {
 
         // unimplemented abstract methods from interfaces
         Map<String, MethodNode> abstractMethods = ClassNodeUtils.getDeclaredMethodsFromInterfaces(classNode);
-        Map<String, MethodNode> allInterfaceMethods = new HashMap<String, MethodNode>(abstractMethods);
+        Map<String, MethodNode> allInterfaceMethods = new HashMap<>(abstractMethods);
         ClassNodeUtils.addDeclaredMethodsFromAllInterfaces(classNode, allInterfaceMethods);
 
-        List<MethodNode> declaredMethods = new ArrayList<MethodNode>(classNode.getMethods());
+        List<MethodNode> declaredMethods = new ArrayList<>(classNode.getMethods());
         // remove all static, private and package private methods
         for (Iterator methodsIterator = declaredMethods.iterator(); methodsIterator.hasNext(); ) {
             MethodNode m = (MethodNode) methodsIterator.next();
@@ -1246,7 +1246,7 @@ public class Verifier implements GroovyClassVisitor, Opcodes {
 
         addCovariantMethods(classNode, declaredMethods, abstractMethods, methodsToAdd, genericsSpec);
 
-        Map<String, MethodNode> declaredMethodsMap = new HashMap<String, MethodNode>();
+        Map<String, MethodNode> declaredMethodsMap = new HashMap<>();
         if (!methodsToAdd.isEmpty()) {
             for (MethodNode mn : declaredMethods) {
                 declaredMethodsMap.put(mn.getTypeDescriptor(), mn);

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/classgen/asm/AssertionWriter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/AssertionWriter.java b/src/main/java/org/codehaus/groovy/classgen/asm/AssertionWriter.java
index 2200c30..b3fd0ca 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/AssertionWriter.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/AssertionWriter.java
@@ -157,7 +157,7 @@ public class AssertionWriter {
         BooleanExpression booleanExpression = statement.getBooleanExpression();
         // push expression string onto stack
         String expressionText = booleanExpression.getText();
-        List<String> list = new ArrayList<String>();
+        List<String> list = new ArrayList<>();
         addVariableNames(booleanExpression, list);
         if (list.isEmpty()) {
             mv.visitLdcInsn(expressionText);

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/classgen/asm/BinaryExpressionMultiTypeDispatcher.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/BinaryExpressionMultiTypeDispatcher.java b/src/main/java/org/codehaus/groovy/classgen/asm/BinaryExpressionMultiTypeDispatcher.java
index 640964f..0ec09a8 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/BinaryExpressionMultiTypeDispatcher.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/BinaryExpressionMultiTypeDispatcher.java
@@ -106,7 +106,7 @@ public class BinaryExpressionMultiTypeDispatcher extends BinaryExpressionHelper
         };
     }
 
-    public static final Map<ClassNode,Integer> typeMap = new HashMap<ClassNode,Integer>(14);
+    public static final Map<ClassNode,Integer> typeMap = new HashMap<>(14);
     static {
         typeMap.put(int_TYPE,       1); typeMap.put(long_TYPE,          2);
         typeMap.put(double_TYPE,    3); typeMap.put(char_TYPE,          4);

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/classgen/asm/CallSiteWriter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/CallSiteWriter.java b/src/main/java/org/codehaus/groovy/classgen/asm/CallSiteWriter.java
index b99ffe5..24465f2 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/CallSiteWriter.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/CallSiteWriter.java
@@ -102,7 +102,7 @@ public class CallSiteWriter {
         METHOD_OO_DESC          = "(Ljava/lang/Object;)Ljava/lang/Object;",
         CREATE_CSA_METHOD       = "$createCallSiteArray";
     public static final String CONSTRUCTOR = "<$constructor$>";
-    private final List<String> callSites = new ArrayList<String>(32);
+    private final List<String> callSites = new ArrayList<>(32);
     private int callSiteArrayVarIndex = -1;
     private final WriterController controller;
 
@@ -163,7 +163,7 @@ public class CallSiteWriter {
     }
         
     private void generateCreateCallSiteArray() { 
-        List<String> callSiteInitMethods = new LinkedList<String>(); 
+        List<String> callSiteInitMethods = new LinkedList<>();
         int index = 0; 
         int methodIndex = 0; 
         final int size = callSites.size(); 

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/classgen/asm/ClosureWriter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/ClosureWriter.java b/src/main/java/org/codehaus/groovy/classgen/asm/ClosureWriter.java
index 6ca8574..3909294 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/ClosureWriter.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/ClosureWriter.java
@@ -76,7 +76,7 @@ public class ClosureWriter {
 
     public ClosureWriter(WriterController wc) {
         this.controller = wc;
-        closureClassMap = new HashMap<Expression,ClassNode>();
+        closureClassMap = new HashMap<>();
         factory = new WriterControllerFactory() {
             public WriterController makeController(final WriterController normalController) {
                 return controller;

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/classgen/asm/CompileStack.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/CompileStack.java b/src/main/java/org/codehaus/groovy/classgen/asm/CompileStack.java
index 35133bb..4fb762b 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/CompileStack.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/CompileStack.java
@@ -100,8 +100,8 @@ public class CompileStack implements Opcodes {
     // list containing finally blocks
     // such a block is created by synchronized or finally and
     // must be called for break/continue/return
-    private LinkedList<BlockRecorder> finallyBlocks = new LinkedList<BlockRecorder>();
-    private final LinkedList<BlockRecorder> visitedBlocks = new LinkedList<BlockRecorder>();
+    private LinkedList<BlockRecorder> finallyBlocks = new LinkedList<>();
+    private final LinkedList<BlockRecorder> visitedBlocks = new LinkedList<>();
 
     private Label thisStartLabel, thisEndLabel;
 
@@ -111,9 +111,9 @@ public class CompileStack implements Opcodes {
     private final LinkedList stateStack = new LinkedList();
 
     // handle different states for the implicit "this"
-    private final LinkedList<Boolean> implicitThisStack = new LinkedList<Boolean>();
+    private final LinkedList<Boolean> implicitThisStack = new LinkedList<>();
     // handle different states for being on the left hand side
-    private final LinkedList<Boolean> lhsStack = new LinkedList<Boolean>();
+    private final LinkedList<Boolean> lhsStack = new LinkedList<>();
     {
         implicitThisStack.add(false);
         lhsStack.add(false);
@@ -129,8 +129,8 @@ public class CompileStack implements Opcodes {
     // in a loop where foo is a label.
     private final Map namedLoopContinueLabel = new HashMap();
     private String className;
-    private final LinkedList<ExceptionTableEntry> typedExceptions = new LinkedList<ExceptionTableEntry>();
-    private final LinkedList<ExceptionTableEntry> untypedExceptions = new LinkedList<ExceptionTableEntry>();
+    private final LinkedList<ExceptionTableEntry> typedExceptions = new LinkedList<>();
+    private final LinkedList<ExceptionTableEntry> untypedExceptions = new LinkedList<>();
     // stores if on left-hand-side during compilation
     private boolean lhs;
     // stores if implicit or explicit this is used.
@@ -148,7 +148,7 @@ public class CompileStack implements Opcodes {
         public Runnable excludedStatement;
         public final LinkedList<LabelRange> ranges;
         public BlockRecorder() {
-            ranges = new LinkedList<LabelRange>();
+            ranges = new LinkedList<>();
         }
         public BlockRecorder(Runnable excludedStatement) {
             this();
@@ -768,7 +768,7 @@ public class CompileStack implements Opcodes {
             blocksToRemove = result.finallyBlocks;
         }
 
-        List<BlockRecorder> blocks = new LinkedList<BlockRecorder>(finallyBlocks);
+        List<BlockRecorder> blocks = new LinkedList<>(finallyBlocks);
         blocks.removeAll(blocksToRemove);
         applyBlockRecorder(blocks);
     }

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/classgen/asm/InvocationWriter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/InvocationWriter.java b/src/main/java/org/codehaus/groovy/classgen/asm/InvocationWriter.java
index 899d5cb..576c06d 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/InvocationWriter.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/InvocationWriter.java
@@ -262,7 +262,7 @@ public class InvocationWriter {
                 operandStack.doGroovyCast(para[i].getType());
             }
             // last parameters wrapped in an array
-            List<Expression> lastParams = new LinkedList<Expression>();
+            List<Expression> lastParams = new LinkedList<>();
             for (int i=para.length-1; i<argumentList.size();i++) {
                 lastParams.add(argumentList.get(i));
             }
@@ -717,7 +717,7 @@ public class InvocationWriter {
 
     private static List<ConstructorNode> sortConstructors(ConstructorCallExpression call, ClassNode callNode) {
         // sort in a new list to prevent side effects
-        List<ConstructorNode> constructors = new ArrayList<ConstructorNode>(callNode.getDeclaredConstructors());
+        List<ConstructorNode> constructors = new ArrayList<>(callNode.getDeclaredConstructors());
         Comparator comp = new Comparator() {
             public int compare(Object arg0, Object arg1) {
                 ConstructorNode c0 = (ConstructorNode) arg0;
@@ -789,7 +789,7 @@ public class InvocationWriter {
             mv.visitTypeInsn(NEW, BytecodeHelper.getClassInternalName(callNode));
         }
         mv.visitInsn(SWAP);
-        TreeMap<Integer,ConstructorNode> sortedConstructors = new TreeMap<Integer, ConstructorNode>();
+        TreeMap<Integer,ConstructorNode> sortedConstructors = new TreeMap<>();
         for (ConstructorNode constructor : constructors) {
             String typeDescriptor = BytecodeHelper.getMethodDescriptor(ClassHelper.VOID_TYPE, constructor.getParameters());
             int hash = BytecodeHelper.hashCode(typeDescriptor);

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/classgen/asm/MopWriter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/MopWriter.java b/src/main/java/org/codehaus/groovy/classgen/asm/MopWriter.java
index 8d1c429..08bcab3 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/MopWriter.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/MopWriter.java
@@ -96,7 +96,7 @@ public class MopWriter {
 
     private static Set<MopKey> buildCurrentClassSignatureSet(List<MethodNode> methods) {
         if (methods.isEmpty()) return Collections.EMPTY_SET;
-        Set<MopKey> result = new HashSet<MopKey>(methods.size());
+        Set<MopKey> result = new HashSet<>(methods.size());
         for (MethodNode mn : methods) {
             MopKey key = new MopKey(mn.getName(), mn.getParameters());
             result.add(key);
@@ -116,8 +116,8 @@ public class MopWriter {
      * @see #generateMopCalls(LinkedList, boolean)
      */
     private void visitMopMethodList(List<MethodNode> methods, boolean isThis, Set<MopKey> useOnlyIfDeclaredHereToo, List<String> orNameMentionedHere) {
-        Map<MopKey, MethodNode> mops = new HashMap<MopKey, MethodNode>();
-        LinkedList<MethodNode> mopCalls = new LinkedList<MethodNode>();
+        Map<MopKey, MethodNode> mops = new HashMap<>();
+        LinkedList<MethodNode> mopCalls = new LinkedList<>();
         for (MethodNode mn : methods) {
             // mop methods are helper for this and super calls and do direct calls
             // to the target methods. Such a method cannot be abstract or a bridge

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/classgen/asm/OperandStack.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/OperandStack.java b/src/main/java/org/codehaus/groovy/classgen/asm/OperandStack.java
index 5dc3743..7e1bbac 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/OperandStack.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/OperandStack.java
@@ -81,7 +81,7 @@ import static org.objectweb.asm.Opcodes.SWAP;
 public class OperandStack {
 
     private final WriterController controller;
-    private final List<ClassNode> stack = new ArrayList<ClassNode>();
+    private final List<ClassNode> stack = new ArrayList<>();
 
     public OperandStack(WriterController wc) {
         this.controller = wc;        

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/classgen/asm/OptimizingStatementWriter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/OptimizingStatementWriter.java b/src/main/java/org/codehaus/groovy/classgen/asm/OptimizingStatementWriter.java
index fb07f94..f3fe4da 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/OptimizingStatementWriter.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/OptimizingStatementWriter.java
@@ -482,7 +482,7 @@ public class OptimizingStatementWriter extends StatementWriter {
             private boolean[] involvedTypes = new boolean[typeMapKeyNames.length];
         }
         private OptimizeFlagsEntry current = new OptimizeFlagsEntry();
-        private final LinkedList<OptimizeFlagsEntry> olderEntries = new LinkedList<OptimizeFlagsEntry>();
+        private final LinkedList<OptimizeFlagsEntry> olderEntries = new LinkedList<>();
         public void push() {
             olderEntries.addLast(current);
             current = new OptimizeFlagsEntry();

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/classgen/asm/WriterController.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/WriterController.java b/src/main/java/org/codehaus/groovy/classgen/asm/WriterController.java
index fe7a21e..0850de3 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/WriterController.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/WriterController.java
@@ -75,7 +75,7 @@ public class WriterController {
     private int bytecodeVersion = Opcodes.V1_8;
     private int lineNumber = -1;
     private int helperMethodIndex = 0;
-    private List<String> superMethodNames = new ArrayList<String>();
+    private List<String> superMethodNames = new ArrayList<>();
 
     public void init(AsmClassGenerator asmClassGenerator, GeneratorContext gcon, ClassVisitor cv, ClassNode cn) {
         CompilerConfiguration config = cn.getCompileUnit().getConfig();

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticInvocationWriter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticInvocationWriter.java b/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticInvocationWriter.java
index 6f4d948..b2b2aaf 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticInvocationWriter.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticInvocationWriter.java
@@ -278,7 +278,7 @@ public class StaticInvocationWriter extends InvocationWriter {
 
             MethodVisitor mv = controller.getMethodVisitor();
             int argumentsToRemove = 0;
-            List<Expression> argumentList = new LinkedList<Expression>(args.getExpressions());
+            List<Expression> argumentList = new LinkedList<>(args.getExpressions());
 
             if (emn.isStaticExtension()) {
                 // it's a static extension method
@@ -448,7 +448,7 @@ public class StaticInvocationWriter extends InvocationWriter {
                 }
             }
             // last parameters wrapped in an array
-            List<Expression> lastParams = new LinkedList<Expression>();
+            List<Expression> lastParams = new LinkedList<>();
             for (int i = para.length - 1; i < argumentListSize; i++) {
                 lastParams.add(argumentList.get(i));
             }

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticTypesLambdaWriter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticTypesLambdaWriter.java b/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticTypesLambdaWriter.java
index 45cc509..0c833e1 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticTypesLambdaWriter.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticTypesLambdaWriter.java
@@ -333,7 +333,7 @@ public class StaticTypesLambdaWriter extends LambdaWriter {
         Parameter[] localVariableParameters = getLambdaSharedVariables(expression);
         removeInitialValues(localVariableParameters);
 
-        List<Parameter> methodParameterList = new LinkedList<Parameter>(Arrays.asList(parametersWithExactType));
+        List<Parameter> methodParameterList = new LinkedList<>(Arrays.asList(parametersWithExactType));
         prependEnclosingThis(methodParameterList);
 
         MethodNode methodNode =

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/classgen/asm/util/TypeUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/util/TypeUtil.java b/src/main/java/org/codehaus/groovy/classgen/asm/util/TypeUtil.java
index 9b79858..83157ab 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/util/TypeUtil.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/util/TypeUtil.java
@@ -142,7 +142,7 @@ public abstract class TypeUtil {
             dimension++;
         } while ((type = type.getComponentType()).isArray());
 
-        return new Tuple2<ClassNode, Integer>(type, dimension);
+        return new Tuple2<>(type, dimension);
     }
 
     private static final String REF_DESCRIPTION = "L";

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/control/ASTTransformationsContext.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/control/ASTTransformationsContext.java b/src/main/java/org/codehaus/groovy/control/ASTTransformationsContext.java
index ae95275..b5f7649 100644
--- a/src/main/java/org/codehaus/groovy/control/ASTTransformationsContext.java
+++ b/src/main/java/org/codehaus/groovy/control/ASTTransformationsContext.java
@@ -32,7 +32,7 @@ public class ASTTransformationsContext {
     protected final GroovyClassLoader transformLoader;  // Classloader for global and local transforms
 
     protected final CompilationUnit compilationUnit; // The compilation unit global AST transformations are applied on
-    protected final Set<String> globalTransformNames = new HashSet<String>(); // collected AST transformation names
+    protected final Set<String> globalTransformNames = new HashSet<>(); // collected AST transformation names
 
     public ASTTransformationsContext(final CompilationUnit compilationUnit, final GroovyClassLoader transformLoader) {
         this.compilationUnit = compilationUnit;

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/control/CompilationUnit.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/control/CompilationUnit.java b/src/main/java/org/codehaus/groovy/control/CompilationUnit.java
index 4a4f0ff..5f357b8 100644
--- a/src/main/java/org/codehaus/groovy/control/CompilationUnit.java
+++ b/src/main/java/org/codehaus/groovy/control/CompilationUnit.java
@@ -160,15 +160,15 @@ public class CompilationUnit extends ProcessingUnit {
         super(configuration, loader, null);
 
         this.astTransformationsContext = new ASTTransformationsContext(this, transformLoader);
-        this.names = new ArrayList<String>();
-        this.queuedSources = new LinkedList<SourceUnit>();
-        this.sources = new HashMap<String, SourceUnit>();
+        this.names = new ArrayList<>();
+        this.queuedSources = new LinkedList<>();
+        this.sources = new HashMap<>();
         this.summariesBySourceName = new HashMap();
         this.summariesByPublicClassName = new HashMap();
         this.classSourcesByPublicClassName = new HashMap();
 
         this.ast = new CompileUnit(this.classLoader, security, this.configuration);
-        this.generatedClasses = new ArrayList<GroovyClass>();
+        this.generatedClasses = new ArrayList<>();
 
         this.verifier = new Verifier();
         this.resolveVisitor = new ResolveVisitor(this);
@@ -1011,7 +1011,7 @@ public class CompilationUnit extends ProcessingUnit {
     }
 
     private List<ClassNode> getPrimaryClassNodes(boolean sort) {
-        List<ClassNode> unsorted = new ArrayList<ClassNode>();
+        List<ClassNode> unsorted = new ArrayList<>();
         for (ModuleNode module : this.ast.getModules()) {
             unsorted.addAll(module.getClasses());
         }
@@ -1042,7 +1042,7 @@ public class CompilationUnit extends ProcessingUnit {
 
     private static List<ClassNode> getSorted(int[] index, List<ClassNode> unsorted) {
         int unsortedSize = unsorted.size();
-        List<ClassNode> sorted = new ArrayList<ClassNode>(unsortedSize);
+        List<ClassNode> sorted = new ArrayList<>(unsortedSize);
         for (int i = 0; i < unsortedSize; i++) {
             int min = -1;
             for (int j = 0; j < unsortedSize; j++) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java b/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java
index 87402aa..1b398f8 100644
--- a/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java
+++ b/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java
@@ -165,7 +165,7 @@ public class CompilerConfiguration {
     /**
      * extensions used to find a groovy files
      */
-    private Set<String> scriptExtensions = new LinkedHashSet<String>();
+    private Set<String> scriptExtensions = new LinkedHashSet<>();
 
     /**
      * if set to true recompilation is enabled
@@ -192,7 +192,7 @@ public class CompilerConfiguration {
      */
     private Map<String, Boolean> optimizationOptions;
 
-    private final List<CompilationCustomizer> compilationCustomizers = new LinkedList<CompilationCustomizer>();
+    private final List<CompilationCustomizer> compilationCustomizers = new LinkedList<>();
 
     /**
      * Sets a list of global AST transformations which should not be loaded even if they are
@@ -294,7 +294,7 @@ public class CompilerConfiguration {
         setWarningLevel(configuration.getWarningLevel());
         setOutput(configuration.getOutput());
         setTargetDirectory(configuration.getTargetDirectory());
-        setClasspathList(new LinkedList<String>(configuration.getClasspath()));
+        setClasspathList(new LinkedList<>(configuration.getClasspath()));
         setVerbose(configuration.getVerbose());
         setDebug(configuration.getDebug());
         setParameters(configuration.getParameters());
@@ -308,12 +308,12 @@ public class CompilerConfiguration {
         setTargetDirectory(configuration.getTargetDirectory());
         Map<String, Object> jointCompilationOptions = configuration.getJointCompilationOptions();
         if (jointCompilationOptions != null) {
-            jointCompilationOptions = new HashMap<String, Object>(jointCompilationOptions);
+            jointCompilationOptions = new HashMap<>(jointCompilationOptions);
         }
         setJointCompilationOptions(jointCompilationOptions);
         setPluginFactory(configuration.getPluginFactory());
         setScriptExtensions(configuration.getScriptExtensions());
-        setOptimizationOptions(new HashMap<String, Boolean>(configuration.getOptimizationOptions()));
+        setOptimizationOptions(new HashMap<>(configuration.getOptimizationOptions()));
     }
 
     /**
@@ -532,7 +532,7 @@ public class CompilerConfiguration {
         text = configuration.getProperty("groovy.disabled.global.ast.transformations");
         if (text!=null) {
             String[] classNames = text.split(",\\s*}");
-            Set<String> blacklist = new HashSet<String>(Arrays.asList(classNames));
+            Set<String> blacklist = new HashSet<>(Arrays.asList(classNames));
             setDisabledGlobalASTTransformations(blacklist);
         }
     }
@@ -631,7 +631,7 @@ public class CompilerConfiguration {
      * Sets the classpath.
      */
     public void setClasspath(String classpath) {
-        this.classpath = new LinkedList<String>();
+        this.classpath = new LinkedList<>();
         StringTokenizer tokenizer = new StringTokenizer(classpath, File.pathSeparator);
         while (tokenizer.hasMoreTokens()) {
             this.classpath.add(tokenizer.nextToken());
@@ -643,7 +643,7 @@ public class CompilerConfiguration {
      * @param parts list of strings containing the classpath parts
      */
     public void setClasspathList(List<String> parts) {
-        this.classpath = new LinkedList<String>(parts);
+        this.classpath = new LinkedList<>(parts);
     }
 
     /**
@@ -734,7 +734,7 @@ public class CompilerConfiguration {
     }
 
     public void setScriptExtensions(Set<String> scriptExtensions) {
-        if(scriptExtensions == null) scriptExtensions = new LinkedHashSet<String>();
+        if(scriptExtensions == null) scriptExtensions = new LinkedHashSet<>();
         this.scriptExtensions = scriptExtensions;
     }
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/control/LabelVerifier.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/control/LabelVerifier.java b/src/main/java/org/codehaus/groovy/control/LabelVerifier.java
index 1aea0be..db4498c 100644
--- a/src/main/java/org/codehaus/groovy/control/LabelVerifier.java
+++ b/src/main/java/org/codehaus/groovy/control/LabelVerifier.java
@@ -54,9 +54,9 @@ public class LabelVerifier extends ClassCodeVisitorSupport {
     }
 
     private void init() {
-        visitedLabels = new LinkedList<String>();
-        continueLabels = new LinkedList<ContinueStatement>();
-        breakLabels = new LinkedList<BreakStatement>();
+        visitedLabels = new LinkedList<>();
+        continueLabels = new LinkedList<>();
+        breakLabels = new LinkedList<>();
         inLoop = false;
         inSwitch = false;
     }

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/control/OptimizerVisitor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/control/OptimizerVisitor.java b/src/main/java/org/codehaus/groovy/control/OptimizerVisitor.java
index b7fa503..5e7c57b 100644
--- a/src/main/java/org/codehaus/groovy/control/OptimizerVisitor.java
+++ b/src/main/java/org/codehaus/groovy/control/OptimizerVisitor.java
@@ -47,10 +47,10 @@ public class OptimizerVisitor extends ClassCodeExpressionTransformer {
     private SourceUnit source;
 
     // TODO make @CS lookup smarter so that we don't need both these maps
-    private final Map<Object, FieldNode> const2Objects = new HashMap<Object, FieldNode>();
-    private final Map<Object, FieldNode> const2Prims = new HashMap<Object, FieldNode>();
+    private final Map<Object, FieldNode> const2Objects = new HashMap<>();
+    private final Map<Object, FieldNode> const2Prims = new HashMap<>();
     private int index;
-    private final List<FieldNode> missingFields = new LinkedList<FieldNode>();
+    private final List<FieldNode> missingFields = new LinkedList<>();
 
     public OptimizerVisitor(CompilationUnit cu) {
     }
@@ -80,7 +80,7 @@ public class OptimizerVisitor extends ClassCodeExpressionTransformer {
                 }
             }
             if (needsFix) {
-                List<ClassNode> newInterfaces = new ArrayList<ClassNode>(interfaces.length);
+                List<ClassNode> newInterfaces = new ArrayList<>(interfaces.length);
                 for (ClassNode classNode : interfaces) {
                     if (!classNode.equals(ClassHelper.GROOVY_OBJECT_TYPE)) {
                         newInterfaces.add(classNode);

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java b/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
index 99e9cd6..4c20884 100644
--- a/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
+++ b/src/main/java/org/codehaus/groovy/control/ResolveVisitor.java
@@ -106,8 +106,8 @@ public class ResolveVisitor extends ClassCodeExpressionTransformer {
     private boolean inPropertyExpression = false;
     private boolean inClosure = false;
 
-    private Map<GenericsTypeName, GenericsType> genericParameterNames = new HashMap<GenericsTypeName, GenericsType>();
-    private final Set<FieldNode> fieldTypesChecked = new HashSet<FieldNode>();
+    private Map<GenericsTypeName, GenericsType> genericParameterNames = new HashMap<>();
+    private final Set<FieldNode> fieldTypesChecked = new HashSet<>();
     private boolean checkingVariableTypeInDeclaration = false;
     private ImportNode currImportNode = null;
     private MethodNode currentMethod;
@@ -230,8 +230,8 @@ public class ResolveVisitor extends ClassCodeExpressionTransformer {
         currentScope = node.getVariableScope();
         Map<GenericsTypeName, GenericsType> oldPNames = genericParameterNames;
         genericParameterNames = node.isStatic()
-                ? new HashMap<GenericsTypeName, GenericsType>()
-                : new HashMap<GenericsTypeName, GenericsType>(genericParameterNames);
+                ? new HashMap<>()
+                : new HashMap<>(genericParameterNames);
 
         resolveGenericsHeader(node.getGenericsTypes());
 
@@ -267,7 +267,7 @@ public class ResolveVisitor extends ClassCodeExpressionTransformer {
     public void visitProperty(PropertyNode node) {
         Map<GenericsTypeName, GenericsType> oldPNames = genericParameterNames;
         if (node.isStatic()) {
-            genericParameterNames = new HashMap<GenericsTypeName, GenericsType>();
+            genericParameterNames = new HashMap<>();
         }
 
         ClassNode t = node.getType();
@@ -400,7 +400,7 @@ public class ResolveVisitor extends ClassCodeExpressionTransformer {
         // to access that class directly, so A becomes a valid
         // name in X.
         // GROOVY-4043: Do this check up the hierarchy, if needed
-        Map<String, ClassNode> hierClasses = new LinkedHashMap<String, ClassNode>();
+        Map<String, ClassNode> hierClasses = new LinkedHashMap<>();
         for(ClassNode classToCheck = currentClass; classToCheck != ClassHelper.OBJECT_TYPE;
             classToCheck = classToCheck.getSuperClass()) {
             if(classToCheck == null || hierClasses.containsKey(classToCheck.getName())) break;
@@ -428,7 +428,7 @@ public class ResolveVisitor extends ClassCodeExpressionTransformer {
         // A.B.C.D.E.F and accessing E from F we test A$E=failed, 
         // A$B$E=failed, A$B$C$E=fail, A$B$C$D$E=success
         
-        LinkedList<ClassNode> outerClasses = new LinkedList<ClassNode>();
+        LinkedList<ClassNode> outerClasses = new LinkedList<>();
         ClassNode outer = currentClass.getOuterClass();
         while (outer!=null) {
             outerClasses.addFirst(outer);
@@ -866,7 +866,7 @@ public class ResolveVisitor extends ClassCodeExpressionTransformer {
             name.insert(0, varName + ".");
         }
 
-        return new Tuple2<StringBuilder, Boolean>(name, doInitialClassTest);
+        return new Tuple2<>(name, doInitialClassTest);
     }
 
     // iterate from the inner most to the outer and check for classes
@@ -874,7 +874,7 @@ public class ResolveVisitor extends ClassCodeExpressionTransformer {
     // a PropertyExpression with the ClassExpression of Integer as objectExpression
     // and class as property
     private static Expression correctClassClassChain(PropertyExpression pe) {
-        LinkedList<Expression> stack = new LinkedList<Expression>();
+        LinkedList<Expression> stack = new LinkedList<>();
         ClassExpression found = null;
         for (Expression it = pe; it != null; it = ((PropertyExpression) it).getObjectExpression()) {
             if (it instanceof ClassExpression) {
@@ -1234,7 +1234,7 @@ public class ResolveVisitor extends ClassCodeExpressionTransformer {
     public void visitAnnotations(AnnotatedNode node) {
         List<AnnotationNode> annotations = node.getAnnotations();
         if (annotations.isEmpty()) return;
-        Map<String, AnnotationNode> tmpAnnotations = new HashMap<String, AnnotationNode>();
+        Map<String, AnnotationNode> tmpAnnotations = new HashMap<>();
         ClassNode annType;
         for (AnnotationNode an : annotations) {
             // skip built-in properties
@@ -1331,7 +1331,7 @@ public class ResolveVisitor extends ClassCodeExpressionTransformer {
 
         if (node instanceof InnerClassNode) {
             if (Modifier.isStatic(node.getModifiers())) {
-                genericParameterNames = new HashMap<GenericsTypeName, GenericsType>();
+                genericParameterNames = new HashMap<>();
             }
 
             InnerClassNode innerClassNode = (InnerClassNode) node;
@@ -1342,7 +1342,7 @@ public class ResolveVisitor extends ClassCodeExpressionTransformer {
                 }
             }
         } else {
-            genericParameterNames = new HashMap<GenericsTypeName, GenericsType>();
+            genericParameterNames = new HashMap<>();
         }
 
         resolveGenericsHeader(node.getGenericsTypes());

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/control/SourceExtensionHandler.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/control/SourceExtensionHandler.java b/src/main/java/org/codehaus/groovy/control/SourceExtensionHandler.java
index 0ca38f5..ef31592 100644
--- a/src/main/java/org/codehaus/groovy/control/SourceExtensionHandler.java
+++ b/src/main/java/org/codehaus/groovy/control/SourceExtensionHandler.java
@@ -35,7 +35,7 @@ import java.util.Set;
 public class SourceExtensionHandler {
 
     public static Set<String> getRegisteredExtensions(ClassLoader loader) {
-        Set<String> extensions = new LinkedHashSet<String>();
+        Set<String> extensions = new LinkedHashSet<>();
         extensions.add("groovy");
         try {
             Enumeration<URL> globalServices = loader.getResources("META-INF/groovy/org.codehaus.groovy.source.Extensions");

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/control/StaticImportVisitor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/control/StaticImportVisitor.java b/src/main/java/org/codehaus/groovy/control/StaticImportVisitor.java
index 93f5929..dca41dc 100644
--- a/src/main/java/org/codehaus/groovy/control/StaticImportVisitor.java
+++ b/src/main/java/org/codehaus/groovy/control/StaticImportVisitor.java
@@ -582,7 +582,7 @@ public class StaticImportVisitor extends ClassCodeExpressionTransformer {
 
     private static FieldNode getField(ClassNode classNode, String fieldName) {
         ClassNode node = classNode;
-        Set<String> visited = new HashSet<String>();
+        Set<String> visited = new HashSet<>();
         while (node != null) {
             FieldNode fn = node.getDeclaredField(fieldName);
             if (fn != null) return fn;

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/control/StaticVerifier.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/control/StaticVerifier.java b/src/main/java/org/codehaus/groovy/control/StaticVerifier.java
index 6bf3908..fbc34c4 100644
--- a/src/main/java/org/codehaus/groovy/control/StaticVerifier.java
+++ b/src/main/java/org/codehaus/groovy/control/StaticVerifier.java
@@ -86,7 +86,7 @@ public class StaticVerifier extends ClassCodeVisitorSupport {
         currentMethod = node;
         super.visitConstructorOrMethod(node, isConstructor);
         if (isConstructor) {
-            final Set<String> exceptions = new HashSet<String>();
+            final Set<String> exceptions = new HashSet<>();
             for (final Parameter param : node.getParameters()) {
                 exceptions.add(param.getName());
                 if (param.hasInitialExpression()) {
@@ -189,7 +189,7 @@ public class StaticVerifier extends ClassCodeVisitorSupport {
         while (node != null) {
             FieldNode fn = node.getDeclaredField(fieldName);
             if (fn != null) return fn;
-            List<ClassNode> interfacesToCheck = new ArrayList<ClassNode>(Arrays.asList(node.getInterfaces()));
+            List<ClassNode> interfacesToCheck = new ArrayList<>(Arrays.asList(node.getInterfaces()));
             while (!interfacesToCheck.isEmpty()) {
                 ClassNode nextInterface = interfacesToCheck.remove(0);
                 fn = nextInterface.getDeclaredField(fieldName);

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/control/customizers/ImportCustomizer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/control/customizers/ImportCustomizer.java b/src/main/java/org/codehaus/groovy/control/customizers/ImportCustomizer.java
index 780b554..760fae4 100644
--- a/src/main/java/org/codehaus/groovy/control/customizers/ImportCustomizer.java
+++ b/src/main/java/org/codehaus/groovy/control/customizers/ImportCustomizer.java
@@ -45,7 +45,7 @@ import java.util.List;
  */
 public class ImportCustomizer extends CompilationCustomizer {
 
-    private final List<Import> imports = new LinkedList<Import>();
+    private final List<Import> imports = new LinkedList<>();
 
     public ImportCustomizer() {
         super(CompilePhase.CONVERSION);

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/control/customizers/SecureASTCustomizer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/control/customizers/SecureASTCustomizer.java b/src/main/java/org/codehaus/groovy/control/customizers/SecureASTCustomizer.java
index 9245ae5..52e62a3 100644
--- a/src/main/java/org/codehaus/groovy/control/customizers/SecureASTCustomizer.java
+++ b/src/main/java/org/codehaus/groovy/control/customizers/SecureASTCustomizer.java
@@ -211,12 +211,12 @@ public class SecureASTCustomizer extends CompilationCustomizer {
     // statements
     private List<Class<? extends Statement>> statementsWhitelist;
     private List<Class<? extends Statement>> statementsBlacklist;
-    private final List<StatementChecker> statementCheckers = new LinkedList<StatementChecker>();
+    private final List<StatementChecker> statementCheckers = new LinkedList<>();
 
     // expressions
     private List<Class<? extends Expression>> expressionsWhitelist;
     private List<Class<? extends Expression>> expressionsBlacklist;
-    private final List<ExpressionChecker> expressionCheckers = new LinkedList<ExpressionChecker>();
+    private final List<ExpressionChecker> expressionCheckers = new LinkedList<>();
 
     // tokens from Types
     private List<Integer> tokensWhitelist;
@@ -308,7 +308,7 @@ public class SecureASTCustomizer extends CompilationCustomizer {
      * Ensures that every star import ends with .* as this is the expected syntax in import checks.
      */
     private static List<String> normalizeStarImports(List<String> starImports) {
-        List<String> result = new ArrayList<String>(starImports.size());
+        List<String> result = new ArrayList<>(starImports.size());
         for (String starImport : starImports) {
             if (starImport.endsWith(".*")) {
                 result.add(starImport);
@@ -494,7 +494,7 @@ public class SecureASTCustomizer extends CompilationCustomizer {
      * @param constantTypesWhiteList a list of classes.
      */
     public void setConstantTypesClassesWhiteList(final List<Class> constantTypesWhiteList) {
-        List<String> values = new LinkedList<String>();
+        List<String> values = new LinkedList<>();
         for (Class aClass : constantTypesWhiteList) {
             values.add(aClass.getName());
         }
@@ -507,7 +507,7 @@ public class SecureASTCustomizer extends CompilationCustomizer {
      * @param constantTypesBlackList a list of classes.
      */
     public void setConstantTypesClassesBlackList(final List<Class> constantTypesBlackList) {
-        List<String> values = new LinkedList<String>();
+        List<String> values = new LinkedList<>();
         for (Class aClass : constantTypesBlackList) {
             values.add(aClass.getName());
         }
@@ -544,7 +544,7 @@ public class SecureASTCustomizer extends CompilationCustomizer {
      * @param receiversBlacklist a list of classes.
      */
     public void setReceiversClassesBlackList(final List<Class> receiversBlacklist) {
-        List<String> values = new LinkedList<String>();
+        List<String> values = new LinkedList<>();
         for (Class aClass : receiversBlacklist) {
             values.add(aClass.getName());
         }
@@ -573,7 +573,7 @@ public class SecureASTCustomizer extends CompilationCustomizer {
      * @param receiversWhitelist a list of classes.
      */
     public void setReceiversClassesWhiteList(final List<Class> receiversWhitelist) {
-        List<String> values = new LinkedList<String>();
+        List<String> values = new LinkedList<>();
         for (Class aClass : receiversWhitelist) {
             values.add(aClass.getName());
         }
@@ -640,7 +640,7 @@ public class SecureASTCustomizer extends CompilationCustomizer {
     }
     
     private static List<MethodNode> filterMethods(ClassNode owner) {
-        List<MethodNode> result = new LinkedList<MethodNode>();
+        List<MethodNode> result = new LinkedList<>();
         List<MethodNode> methods = owner.getMethods();
         for (MethodNode method : methods) {
             if (method.getDeclaringClass() == owner && !method.isSynthetic()) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/control/customizers/builder/SourceAwareCustomizerFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/control/customizers/builder/SourceAwareCustomizerFactory.java b/src/main/java/org/codehaus/groovy/control/customizers/builder/SourceAwareCustomizerFactory.java
index 1edf636..94c9fd0 100644
--- a/src/main/java/org/codehaus/groovy/control/customizers/builder/SourceAwareCustomizerFactory.java
+++ b/src/main/java/org/codehaus/groovy/control/customizers/builder/SourceAwareCustomizerFactory.java
@@ -110,7 +110,7 @@ public class SourceAwareCustomizerFactory extends AbstractFactory implements Pos
     }
 
     private static void addExtensionValidator(final SourceAwareCustomizer sourceAwareCustomizer, final SourceOptions data) {
-        final List<String> extensions = data.extensions!=null?data.extensions : new LinkedList<String>();
+        final List<String> extensions = data.extensions!=null?data.extensions : new LinkedList<>();
         if (data.extension!=null) extensions.add(data.extension);
         Closure<Boolean> extensionValidator = data.extensionValidator;
         if (extensionValidator==null && !extensions.isEmpty()) {
@@ -128,7 +128,7 @@ public class SourceAwareCustomizerFactory extends AbstractFactory implements Pos
     }
 
     private static void addBasenameValidator(final SourceAwareCustomizer sourceAwareCustomizer, final SourceOptions data) {
-        final List<String> basenames = data.basenames!=null?data.basenames : new LinkedList<String>();
+        final List<String> basenames = data.basenames!=null?data.basenames : new LinkedList<>();
         if (data.basename!=null) basenames.add(data.basename);
         Closure<Boolean> basenameValidator = data.basenameValidator;
         if (basenameValidator==null && !basenames.isEmpty()) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/reflection/CachedClass.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/reflection/CachedClass.java b/src/main/java/org/codehaus/groovy/reflection/CachedClass.java
index 7790930..db3e500 100644
--- a/src/main/java/org/codehaus/groovy/reflection/CachedClass.java
+++ b/src/main/java/org/codehaus/groovy/reflection/CachedClass.java
@@ -133,8 +133,8 @@ public class CachedClass {
                        }
                    }
                });
-            List<CachedMethod> methods = new ArrayList<CachedMethod>(declaredMethods.length);
-            List<CachedMethod> mopMethods = new ArrayList<CachedMethod>(declaredMethods.length);
+            List<CachedMethod> methods = new ArrayList<>(declaredMethods.length);
+            List<CachedMethod> mopMethods = new ArrayList<>(declaredMethods.length);
             for (int i = 0; i != declaredMethods.length; ++i) {
                 final CachedMethod cachedMethod = new CachedMethod(CachedClass.this, declaredMethods[i]);
                 final String name = cachedMethod.getName();
@@ -198,7 +198,7 @@ public class CachedClass {
         private static final long serialVersionUID = 7166687623678851596L;
 
         public LinkedList<ClassInfo> initValue() {
-            Set<ClassInfo> res = new LinkedHashSet<ClassInfo> ();
+            Set<ClassInfo> res = new LinkedHashSet<>();
 
             res.add(classInfo);
 
@@ -212,7 +212,7 @@ public class CachedClass {
             if (isInterface)
               res.add(ReflectionCache.OBJECT_CLASS.classInfo);
 
-            return new LinkedList<ClassInfo> (res);
+            return new LinkedList<>(res);
         }
     };
 
@@ -227,7 +227,7 @@ public class CachedClass {
         private static final long serialVersionUID = 2139190436931329873L;
 
         public Set<CachedClass> initValue() {
-            Set<CachedClass> res = new HashSet<CachedClass> (0);
+            Set<CachedClass> res = new HashSet<>(0);
 
             Class[] classes = getTheClass().getInterfaces();
             for (Class cls : classes) {
@@ -241,7 +241,7 @@ public class CachedClass {
         private static final long serialVersionUID = 4060471819464086940L;
 
         public Set<CachedClass> initValue() {
-            Set<CachedClass> res = new HashSet<CachedClass> (0);
+            Set<CachedClass> res = new HashSet<>(0);
 
             if (getTheClass().isInterface())
               res.add(CachedClass.this);
@@ -377,7 +377,7 @@ public class CachedClass {
     }
 
     public MetaMethod[] getNewMetaMethods() {
-        List<MetaMethod> arr = new ArrayList<MetaMethod>(Arrays.asList(classInfo.newMetaMethods));
+        List<MetaMethod> arr = new ArrayList<>(Arrays.asList(classInfo.newMetaMethods));
 
         final MetaClass metaClass = classInfo.getStrongMetaClass();
         if (metaClass instanceof ExpandoMetaClass) {
@@ -465,7 +465,7 @@ public class CachedClass {
         if (metaClass != null) {
           if (metaClass.getClass() == MetaClassImpl.class) {
               classInfo.setStrongMetaClass(null);
-              List<MetaMethod> res = new ArrayList<MetaMethod>();
+              List<MetaMethod> res = new ArrayList<>();
               Collections.addAll(res, classInfo.newMetaMethods);
               res.addAll(arr);
               updateSetNewMopMethods(res);
@@ -497,7 +497,7 @@ public class CachedClass {
     }
 
     private void updateAddNewMopMethods(List<MetaMethod> arr) {
-        List<MetaMethod> res = new ArrayList<MetaMethod>();
+        List<MetaMethod> res = new ArrayList<>();
         res.addAll(Arrays.asList(classInfo.newMetaMethods));
         res.addAll(arr);
         classInfo.newMetaMethods = res.toArray(MetaMethod.EMPTY_ARRAY);

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/reflection/CachedMethod.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/reflection/CachedMethod.java b/src/main/java/org/codehaus/groovy/reflection/CachedMethod.java
index 1c8f3b3..ae70f10 100644
--- a/src/main/java/org/codehaus/groovy/reflection/CachedMethod.java
+++ b/src/main/java/org/codehaus/groovy/reflection/CachedMethod.java
@@ -243,7 +243,7 @@ public class CachedMethod extends MetaMethod implements Comparable {
                   constr = CallSiteGenerator.compilePogoMethod(this);
                 }
                 if (constr != null) {
-                     pogoCallSiteConstructor = new SoftReference<Constructor> (constr);
+                     pogoCallSiteConstructor = new SoftReference<>(constr);
                 } else {
                     skipCompiled = true;
                 }
@@ -272,7 +272,7 @@ public class CachedMethod extends MetaMethod implements Comparable {
                   constr = CallSiteGenerator.compilePojoMethod(this);
                 }
                 if (constr != null) {
-                    pojoCallSiteConstructor = new SoftReference<Constructor> (constr);
+                    pojoCallSiteConstructor = new SoftReference<>(constr);
                 } else {
                     skipCompiled = true;
                 }
@@ -300,7 +300,7 @@ public class CachedMethod extends MetaMethod implements Comparable {
                   constr = CallSiteGenerator.compileStaticMethod(this);
                 }
                 if (constr != null) {
-                    staticCallSiteConstructor = new SoftReference<Constructor> (constr);
+                    staticCallSiteConstructor = new SoftReference<>(constr);
                 } else {
                     skipCompiled = true;
                 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/reflection/ClassInfo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/reflection/ClassInfo.java b/src/main/java/org/codehaus/groovy/reflection/ClassInfo.java
index 1067e4b..0ba53d3 100644
--- a/src/main/java/org/codehaus/groovy/reflection/ClassInfo.java
+++ b/src/main/java/org/codehaus/groovy/reflection/ClassInfo.java
@@ -104,7 +104,7 @@ public class ClassInfo implements Finalizable {
     private static final ReferenceBundle weakBundle = ReferenceBundle.getWeakBundle();
     
     private static final ManagedConcurrentLinkedQueue<ClassInfo> modifiedExpandos =
-            new ManagedConcurrentLinkedQueue<ClassInfo>(weakBundle);
+            new ManagedConcurrentLinkedQueue<>(weakBundle);
 
     private static final GroovyClassValue<ClassInfo> globalClassValue = GroovyClassValueFactory.createGroovyClassValue(new ComputeValue<ClassInfo>(){
 		@Override
@@ -246,7 +246,7 @@ public class ClassInfo implements Finalizable {
         strongMetaClass = null;
         ManagedReference<MetaClass> newRef = null;
         if (answer != null) {
-            newRef = new ManagedReference<MetaClass> (softBundle,answer);
+            newRef = new ManagedReference<>(softBundle, answer);
         }
         replaceWeakMetaClassRef(newRef);
     }
@@ -425,7 +425,7 @@ public class ClassInfo implements Finalizable {
 
         if (metaClass != null) {
             if (perInstanceMetaClassMap == null)
-              perInstanceMetaClassMap = new ManagedConcurrentMap<Object, MetaClass>(ReferenceBundle.getWeakBundle()); 
+              perInstanceMetaClassMap = new ManagedConcurrentMap<>(ReferenceBundle.getWeakBundle());
 
             perInstanceMetaClassMap.put(obj, metaClass);
         }
@@ -481,7 +481,7 @@ public class ClassInfo implements Finalizable {
 
     private static class GlobalClassSet {
     	
-    	private final ManagedConcurrentLinkedQueue<ClassInfo> items = new ManagedConcurrentLinkedQueue<ClassInfo>(weakBundle);
+    	private final ManagedConcurrentLinkedQueue<ClassInfo> items = new ManagedConcurrentLinkedQueue<>(weakBundle);
     	
     	public int size(){
 		    return values().size();

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/reflection/ClassLoaderForClassArtifacts.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/reflection/ClassLoaderForClassArtifacts.java b/src/main/java/org/codehaus/groovy/reflection/ClassLoaderForClassArtifacts.java
index ba24a6d..7549824 100644
--- a/src/main/java/org/codehaus/groovy/reflection/ClassLoaderForClassArtifacts.java
+++ b/src/main/java/org/codehaus/groovy/reflection/ClassLoaderForClassArtifacts.java
@@ -36,7 +36,7 @@ public class ClassLoaderForClassArtifacts extends ClassLoader {
 
     public ClassLoaderForClassArtifacts(Class klazz) {
         super(klazz.getClassLoader());
-        this.klazz = new SoftReference<Class> (klazz);
+        this.klazz = new SoftReference<>(klazz);
     }
 
     public Class define (String name, byte [] bytes) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/reflection/GeneratedMetaMethod.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/reflection/GeneratedMetaMethod.java b/src/main/java/org/codehaus/groovy/reflection/GeneratedMetaMethod.java
index 23a0db7..552a6cb 100644
--- a/src/main/java/org/codehaus/groovy/reflection/GeneratedMetaMethod.java
+++ b/src/main/java/org/codehaus/groovy/reflection/GeneratedMetaMethod.java
@@ -130,7 +130,7 @@ public abstract class GeneratedMetaMethod extends MetaMethod {
                          new DataOutputStream(
                                  new BufferedOutputStream(
                                          new FileOutputStream(file)))) {
-                Map<String, Integer> classes = new LinkedHashMap<String, Integer>();
+                Map<String, Integer> classes = new LinkedHashMap<>();
 
                 int nextClassId = 0;
                 for (Class primitive : PRIMITIVE_CLASSES) {
@@ -184,7 +184,7 @@ public abstract class GeneratedMetaMethod extends MetaMethod {
                                  new BufferedInputStream(
                                          loader.getResourceAsStream("META-INF/dgminfo")))) {
 
-                Map<Integer, Class> classes = new HashMap<Integer, Class>();
+                Map<Integer, Class> classes = new HashMap<>();
                 for (int i = 0; i < PRIMITIVE_CLASSES.length; i++) {
                     classes.put(i, PRIMITIVE_CLASSES[i]);
                 }
@@ -212,7 +212,7 @@ public abstract class GeneratedMetaMethod extends MetaMethod {
                 }
 
                 int size = in.readInt();
-                List<DgmMethodRecord> res = new ArrayList<DgmMethodRecord>(size);
+                List<DgmMethodRecord> res = new ArrayList<>(size);
                 for (int i = 0; i != size; ++i) {
                     boolean skipRecord = false;
                     DgmMethodRecord record = new DgmMethodRecord();

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/reflection/MixinInMetaClass.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/reflection/MixinInMetaClass.java b/src/main/java/org/codehaus/groovy/reflection/MixinInMetaClass.java
index 4dfa083..97d1863 100644
--- a/src/main/java/org/codehaus/groovy/reflection/MixinInMetaClass.java
+++ b/src/main/java/org/codehaus/groovy/reflection/MixinInMetaClass.java
@@ -110,7 +110,7 @@ public class MixinInMetaClass extends ManagedConcurrentMap {
 
         ExpandoMetaClass mc = (ExpandoMetaClass) self;
 
-        List<MetaMethod> arr = new ArrayList<MetaMethod>();
+        List<MetaMethod> arr = new ArrayList<>();
         for (Class categoryClass : categoryClasses) {
 
             final CachedClass cachedCategoryClass = ReflectionCache.getCachedClass(categoryClass);

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/reflection/ReflectionUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/reflection/ReflectionUtils.java b/src/main/java/org/codehaus/groovy/reflection/ReflectionUtils.java
index e621729..5be7bc6 100644
--- a/src/main/java/org/codehaus/groovy/reflection/ReflectionUtils.java
+++ b/src/main/java/org/codehaus/groovy/reflection/ReflectionUtils.java
@@ -31,7 +31,7 @@ import java.util.Set;
 public class ReflectionUtils {
 
     // these are packages in the call stack that are only part of the groovy MOP
-    private static final Set<String> IGNORED_PACKAGES = new HashSet<String>();
+    private static final Set<String> IGNORED_PACKAGES = new HashSet<>();
 
     static {
         //IGNORED_PACKAGES.add("java.lang.reflect");

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/reflection/SunClassLoader.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/reflection/SunClassLoader.java b/src/main/java/org/codehaus/groovy/reflection/SunClassLoader.java
index 0a6a082..88c1ea1 100644
--- a/src/main/java/org/codehaus/groovy/reflection/SunClassLoader.java
+++ b/src/main/java/org/codehaus/groovy/reflection/SunClassLoader.java
@@ -34,7 +34,7 @@ import java.util.Map;
  * Special class loader, which when running on Sun VM allows to generate accessor classes for any method
  */
 public class SunClassLoader extends ClassLoader implements Opcodes {
-    protected final Map<String,Class> knownClasses = new HashMap<String,Class>();
+    protected final Map<String,Class> knownClasses = new HashMap<>();
 
     protected static final SunClassLoader sunVM;
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/reflection/stdclasses/CachedSAMClass.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/reflection/stdclasses/CachedSAMClass.java b/src/main/java/org/codehaus/groovy/reflection/stdclasses/CachedSAMClass.java
index 7c3291c..7f5460a 100644
--- a/src/main/java/org/codehaus/groovy/reflection/stdclasses/CachedSAMClass.java
+++ b/src/main/java/org/codehaus/groovy/reflection/stdclasses/CachedSAMClass.java
@@ -84,7 +84,7 @@ public class CachedSAMClass extends CachedClass {
                     new Class[]{clazz},
                     new ConvertedClosure(argument));
         } else {
-            Map<String, Object> m = new HashMap<String,Object>();
+            Map<String, Object> m = new HashMap<>();
             m.put(method.getName(), argument);
             return ProxyGenerator.INSTANCE.
                     instantiateAggregateFromBaseClass(m, clazz);

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/runtime/ComposedClosure.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/runtime/ComposedClosure.java b/src/main/java/org/codehaus/groovy/runtime/ComposedClosure.java
index 52f52cb..e2767d4 100644
--- a/src/main/java/org/codehaus/groovy/runtime/ComposedClosure.java
+++ b/src/main/java/org/codehaus/groovy/runtime/ComposedClosure.java
@@ -87,7 +87,7 @@ public final class ComposedClosure<V> extends Closure<V> {
     }
 
     public Object clone() {
-        return new ComposedClosure<V>(first, second);
+        return new ComposedClosure<>(first, second);
     }
 
     public Class[] getParameterTypes() {

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/runtime/ConversionHandler.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/runtime/ConversionHandler.java b/src/main/java/org/codehaus/groovy/runtime/ConversionHandler.java
index 6ea07b2..09966cb 100644
--- a/src/main/java/org/codehaus/groovy/runtime/ConversionHandler.java
+++ b/src/main/java/org/codehaus/groovy/runtime/ConversionHandler.java
@@ -45,7 +45,7 @@ public abstract class ConversionHandler implements InvocationHandler, Serializab
     private final ConcurrentHashMap<Method, Object> handleCache;
     {
         if (VMPluginFactory.getPlugin().getVersion() >= 7) {
-            handleCache = new ConcurrentHashMap<Method, Object>(16, 0.9f, 2);
+            handleCache = new ConcurrentHashMap<>(16, 0.9f, 2);
         } else {
             handleCache = null;
         }

http://git-wip-us.apache.org/repos/asf/groovy/blob/72fd4078/src/main/java/org/codehaus/groovy/runtime/CurriedClosure.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/runtime/CurriedClosure.java b/src/main/java/org/codehaus/groovy/runtime/CurriedClosure.java
index e9365be..b9f245a 100644
--- a/src/main/java/org/codehaus/groovy/runtime/CurriedClosure.java
+++ b/src/main/java/org/codehaus/groovy/runtime/CurriedClosure.java
@@ -146,7 +146,7 @@ public final class CurriedClosure<V> extends Closure<V> {
     @SuppressWarnings("unchecked")
     public Object clone() {
         Closure<V> uncurriedClosure = (Closure<V>) ((Closure) getOwner()).clone();
-        return new CurriedClosure<V>(index, uncurriedClosure, curriedParams);
+        return new CurriedClosure<>(index, uncurriedClosure, curriedParams);
     }
 
     public Class[] getParameterTypes() {


Mime
View raw message