groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject groovy git commit: Fixing squid:S1155 - Collection.isEmpty() should be used to test for emptiness
Date Tue, 05 Jan 2016 00:19:15 GMT
Repository: groovy
Updated Branches:
  refs/heads/master 7a498d7a7 -> 61e898c63


Fixing squid:S1155 - Collection.isEmpty() should be used to test for emptiness


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/61e898c6
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/61e898c6
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/61e898c6

Branch: refs/heads/master
Commit: 61e898c630aeb805616099c3b7b5abc18ff0e92e
Parents: 7a498d7
Author: Kirill Vlasov <kirill.vlasov@devfactory.com>
Authored: Wed Dec 30 10:50:17 2015 +0500
Committer: paulk <paulk@asert.com.au>
Committed: Tue Jan 5 10:18:35 2016 +1000

----------------------------------------------------------------------
 src/main/groovy/grape/GrabAnnotationTransformation.java |  2 +-
 src/main/groovy/lang/MetaClassImpl.java                 |  4 ++--
 src/main/groovy/time/BaseDuration.java                  |  2 +-
 src/main/groovy/util/ConfigObject.java                  |  2 +-
 src/main/groovy/util/FactoryBuilderSupport.java         |  6 +++---
 src/main/groovy/util/GroovyCollections.java             |  2 +-
 src/main/groovy/util/ObservableList.java                |  4 ++--
 src/main/groovy/util/ObservableMap.java                 |  2 +-
 src/main/groovy/util/ObservableSet.java                 |  2 +-
 .../org/codehaus/groovy/antlr/AntlrParserPlugin.java    | 10 +++++-----
 .../groovy/antlr/treewalker/SourceCodeTraversal.java    |  2 +-
 src/main/org/codehaus/groovy/ast/VariableScope.java     |  6 +++---
 .../codehaus/groovy/ast/expr/DeclarationExpression.java |  2 +-
 .../org/codehaus/groovy/ast/expr/GStringExpression.java |  2 +-
 .../org/codehaus/groovy/classgen/AnnotationVisitor.java |  2 +-
 .../codehaus/groovy/classgen/EnumCompletionVisitor.java |  4 ++--
 src/main/org/codehaus/groovy/classgen/EnumVisitor.java  |  2 +-
 src/main/org/codehaus/groovy/classgen/Verifier.java     |  2 +-
 .../org/codehaus/groovy/classgen/asm/CompileStack.java  |  4 ++--
 .../org/codehaus/groovy/classgen/asm/MopWriter.java     |  2 +-
 .../groovy/classgen/asm/sc/StaticInvocationWriter.java  |  2 +-
 .../org/codehaus/groovy/control/ErrorCollector.java     |  2 +-
 .../codehaus/groovy/runtime/DefaultGroovyMethods.java   | 12 ++++++------
 .../groovy/runtime/DefaultGroovyMethodsSupport.java     |  2 +-
 .../groovy/tools/javac/JavaAwareCompilationUnit.java    |  6 +++---
 .../codehaus/groovy/tools/javac/JavaStubGenerator.java  |  4 ++--
 .../groovy/transform/AbstractASTTransformation.java     |  2 +-
 .../groovy/transform/AnnotationCollectorTransform.java  |  6 +++---
 .../groovy/transform/AutoCloneASTTransformation.java    |  4 ++--
 .../groovy/transform/ImmutableASTTransformation.java    |  6 +++---
 .../groovy/transform/SingletonASTTransformation.java    |  2 +-
 .../transform/TupleConstructorASTTransformation.java    |  2 +-
 .../groovy/transform/stc/StaticTypeCheckingVisitor.java |  2 +-
 .../codehaus/groovy/transform/trait/TraitComposer.java  |  2 +-
 .../main/java/org/codehaus/groovy/ant/FileScanner.java  |  2 +-
 .../main/java/org/codehaus/groovy/ant/Groovydoc.java    |  2 +-
 .../src/main/groovy/groovy/ui/text/TextUndoManager.java |  2 +-
 .../groovy/tools/groovydoc/SimpleGroovyClassDoc.java    |  2 +-
 .../groovy-sql/src/main/java/groovy/sql/DataSet.java    |  4 ++--
 .../groovy/groovy/text/StreamingTemplateEngine.java     |  2 +-
 .../transform/NotYetImplementedASTTransformation.java   |  2 +-
 41 files changed, 67 insertions(+), 67 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/groovy/grape/GrabAnnotationTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/grape/GrabAnnotationTransformation.java b/src/main/groovy/grape/GrabAnnotationTransformation.java
index b6d9f3d..5c5dd6a 100644
--- a/src/main/groovy/grape/GrabAnnotationTransformation.java
+++ b/src/main/groovy/grape/GrabAnnotationTransformation.java
@@ -423,7 +423,7 @@ public class GrabAnnotationTransformation extends ClassCodeVisitorSupport implem
 
         List<Expression> argList = new ArrayList<Expression>();
         argList.add(basicArgs);
-        if (grabMapsInit.size() == 0) return;
+        if (grabMapsInit.isEmpty()) return;
         for (Map<String, Object> grabMap : grabMapsInit) {
             // add Grape.grab(excludeArgs, [group:group, module:module, version:version, classifier:classifier])
             // or Grape.grab([group:group, module:module, version:version, classifier:classifier])

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/groovy/lang/MetaClassImpl.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/lang/MetaClassImpl.java b/src/main/groovy/lang/MetaClassImpl.java
index a858161..f0c8fe5 100644
--- a/src/main/groovy/lang/MetaClassImpl.java
+++ b/src/main/groovy/lang/MetaClassImpl.java
@@ -3203,7 +3203,7 @@ public class MetaClassImpl implements MetaClass, MutableMetaClass {
             ParameterTypes paramTypes = (ParameterTypes) method;
             long dist = MetaClassHelper.calculateParameterDistance(arguments, paramTypes);
             if (dist == 0) return method;
-            if (matches.size() == 0) {
+            if (matches.isEmpty()) {
                 matches.add(method);
                 matchesDistance = dist;
             } else if (dist < matchesDistance) {
@@ -3218,7 +3218,7 @@ public class MetaClassImpl implements MetaClass, MutableMetaClass {
         if (matches.size() == 1) {
             return matches.getFirst();
         }
-        if (matches.size() == 0) {
+        if (matches.isEmpty()) {
             return null;
         }
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/groovy/time/BaseDuration.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/time/BaseDuration.java b/src/main/groovy/time/BaseDuration.java
index 12c0a6e..73a5434 100644
--- a/src/main/groovy/time/BaseDuration.java
+++ b/src/main/groovy/time/BaseDuration.java
@@ -113,7 +113,7 @@ public abstract class BaseDuration implements Comparable<BaseDuration> {
             buffer.add((norm_seconds == 0 ? (norm_millis < 0 ? "-0" : "0") : norm_seconds) + "." + StringGroovyMethods.padLeft("" + Math.abs(norm_millis), 3, "0") + " seconds");
         }
 
-        if (buffer.size() != 0) {
+        if (!buffer.isEmpty()) {
             return DefaultGroovyMethods.join(buffer.iterator(), ", ");
         } else {
             return "0";

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/groovy/util/ConfigObject.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/ConfigObject.java b/src/main/groovy/util/ConfigObject.java
index 64f678a..24220cd 100644
--- a/src/main/groovy/util/ConfigObject.java
+++ b/src/main/groovy/util/ConfigObject.java
@@ -181,7 +181,7 @@ public class ConfigObject extends GroovyObjectSupport implements Writable, Map,
 
                 continue;
             } else {
-                if (configEntry instanceof Map && ((Map)configEntry).size() > 0 && value instanceof Map) {
+                if (configEntry instanceof Map && !((Map) configEntry).isEmpty() && value instanceof Map) {
                     // recur
                     doMerge((Map) configEntry, (Map) value);
                 } else {

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/groovy/util/FactoryBuilderSupport.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/FactoryBuilderSupport.java b/src/main/groovy/util/FactoryBuilderSupport.java
index 543b7dd..89da1be 100644
--- a/src/main/groovy/util/FactoryBuilderSupport.java
+++ b/src/main/groovy/util/FactoryBuilderSupport.java
@@ -836,18 +836,18 @@ public abstract class FactoryBuilderSupport extends Binding {
             // the builder and there is nothing we can really do to prevent
             // that
 
-            if ((list.size() > 0)
+            if ((!list.isEmpty())
                     && (list.get(0) instanceof LinkedHashMap)) {
                 namedArgs = (Map) list.get(0);
                 list = list.subList(1, list.size());
             }
-            if ((list.size() > 0)
+            if ((!list.isEmpty())
                     && (list.get(list.size() - 1) instanceof Closure)) {
                 closure = (Closure) list.get(list.size() - 1);
                 list = list.subList(0, list.size() - 1);
             }
             Object arg;
-            if (list.size() == 0) {
+            if (list.isEmpty()) {
                 arg = null;
             } else if (list.size() == 1) {
                 arg = list.get(0);

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/groovy/util/GroovyCollections.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/GroovyCollections.java b/src/main/groovy/util/GroovyCollections.java
index ef0e3df..86b9ca2 100644
--- a/src/main/groovy/util/GroovyCollections.java
+++ b/src/main/groovy/util/GroovyCollections.java
@@ -160,7 +160,7 @@ public class GroovyCollections {
      */
     public static List transpose(List lists) {
         List result = new ArrayList();
-        if (lists.isEmpty() || lists.size() == 0) return result;
+        if (lists.isEmpty() || lists.isEmpty()) return result;
         int minSize = Integer.MAX_VALUE;
         for (Object listLike : lists) {
             List list = (List) DefaultTypeTransformation.castToType(listLike, List.class);

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/groovy/util/ObservableList.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/ObservableList.java b/src/main/groovy/util/ObservableList.java
index 3429952..981735d 100644
--- a/src/main/groovy/util/ObservableList.java
+++ b/src/main/groovy/util/ObservableList.java
@@ -185,7 +185,7 @@ public class ObservableList implements List {
                     values.add(element);
                 }
             }
-            if (values.size() > 0) {
+            if (!values.isEmpty()) {
                 fireMultiElementAddedEvent(index, values);
                 fireSizeChangedEvent(oldSize, size());
             }
@@ -210,7 +210,7 @@ public class ObservableList implements List {
                     values.add(element);
                 }
             }
-            if (values.size() > 0) {
+            if (!values.isEmpty()) {
                 fireMultiElementAddedEvent(index, values);
                 fireSizeChangedEvent(oldSize, size());
             }

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/groovy/util/ObservableMap.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/ObservableMap.java b/src/main/groovy/util/ObservableMap.java
index d68d36a..72c9e89 100644
--- a/src/main/groovy/util/ObservableMap.java
+++ b/src/main/groovy/util/ObservableMap.java
@@ -240,7 +240,7 @@ public class ObservableMap implements Map {
                     }
                 }
             }
-            if (events.size() > 0) {
+            if (!events.isEmpty()) {
                 fireMultiPropertyEvent(events);
                 fireSizeChangedEvent(oldSize, size());
             }

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/groovy/util/ObservableSet.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/ObservableSet.java b/src/main/groovy/util/ObservableSet.java
index a807b99..0eed4a6 100644
--- a/src/main/groovy/util/ObservableSet.java
+++ b/src/main/groovy/util/ObservableSet.java
@@ -236,7 +236,7 @@ public class ObservableSet<E> implements Set<E> {
                     values.add(element);
                 }
             }
-            if (values.size() > 0) {
+            if (!values.isEmpty()) {
                 fireMultiElementAddedEvent(values);
                 fireSizeChangedEvent(oldSize, size());
             }

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/antlr/AntlrParserPlugin.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/antlr/AntlrParserPlugin.java b/src/main/org/codehaus/groovy/antlr/AntlrParserPlugin.java
index c3d2da7..8e8751d 100644
--- a/src/main/org/codehaus/groovy/antlr/AntlrParserPlugin.java
+++ b/src/main/org/codehaus/groovy/antlr/AntlrParserPlugin.java
@@ -290,7 +290,7 @@ public class AntlrParserPlugin extends ASTHelper implements ParserPlugin, Groovy
             ClassNode scriptClassNode = output.getScriptClassDummy();
             if (scriptClassNode != null) {
                 List<Statement> statements = output.getStatementBlock().getStatements();
-                if (statements.size() > 0) {
+                if (!statements.isEmpty()) {
                     Statement firstStatement = statements.get(0);
                     Statement lastStatement = statements.get(statements.size() - 1);
 
@@ -1674,7 +1674,7 @@ public class AntlrParserPlugin extends ASTHelper implements ParserPlugin, Groovy
             node = node.getNextSibling();
         }
 
-        if (finallyStatement instanceof EmptyStatement && catches.size() == 0) {
+        if (finallyStatement instanceof EmptyStatement && catches.isEmpty()) {
             throw new ASTRuntimeException(tryStatementNode, "A try statement must have at least one catch or finally block.");
         }
 
@@ -2558,7 +2558,7 @@ public class AntlrParserPlugin extends ASTHelper implements ParserPlugin, Groovy
 
     private void setTypeArgumentsOnMethodCallExpression(MethodCallExpression expression,
                                                         List<GenericsType> typeArgumentList) {
-        if (typeArgumentList != null && typeArgumentList.size() > 0) {
+        if (typeArgumentList != null && !typeArgumentList.isEmpty()) {
             expression.setGenericsTypes(typeArgumentList.toArray(new GenericsType[typeArgumentList.size()]));
         }
     }
@@ -2607,7 +2607,7 @@ public class AntlrParserPlugin extends ASTHelper implements ParserPlugin, Groovy
         if (arguments instanceof TupleExpression) {
             TupleExpression te = (TupleExpression) arguments;
             List<Expression> expressions = te.getExpressions();
-            if (expressions.size() == 0) return null;
+            if (expressions.isEmpty()) return null;
             Expression last = expressions.remove(expressions.size() - 1);
             if (last instanceof AnonymousInnerClassCarrier) {
                 AnonymousInnerClassCarrier carrier = (AnonymousInnerClassCarrier) last;
@@ -3011,7 +3011,7 @@ public class AntlrParserPlugin extends ASTHelper implements ParserPlugin, Groovy
             configureAST(bound, boundsNode);
             bounds.add(bound);
         }
-        if (bounds.size() == 0) return null;
+        if (bounds.isEmpty()) return null;
         return (ClassNode[]) bounds.toArray(new ClassNode[bounds.size()]);
     }
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/antlr/treewalker/SourceCodeTraversal.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/antlr/treewalker/SourceCodeTraversal.java b/src/main/org/codehaus/groovy/antlr/treewalker/SourceCodeTraversal.java
index 167f8c9..d65f055 100644
--- a/src/main/org/codehaus/groovy/antlr/treewalker/SourceCodeTraversal.java
+++ b/src/main/org/codehaus/groovy/antlr/treewalker/SourceCodeTraversal.java
@@ -73,7 +73,7 @@ public class SourceCodeTraversal extends TraversalHelper {
     }
 
     protected void accept(GroovySourceAST currentNode) {
-        if (currentNode != null && unvisitedNodes != null && unvisitedNodes.size() > 0) {
+        if (currentNode != null && unvisitedNodes != null && !unvisitedNodes.isEmpty()) {
             GroovySourceAST t = currentNode;
 
             if (!(unvisitedNodes.contains(currentNode))) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/ast/VariableScope.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/ast/VariableScope.java b/src/main/org/codehaus/groovy/ast/VariableScope.java
index dde57db..b96617e 100644
--- a/src/main/org/codehaus/groovy/ast/VariableScope.java
+++ b/src/main/org/codehaus/groovy/ast/VariableScope.java
@@ -98,17 +98,17 @@ public class VariableScope  {
     public VariableScope copy() {
         VariableScope copy = new VariableScope();
         copy.clazzScope = clazzScope;
-        if (declaredVariables.size() > 0) {
+        if (!declaredVariables.isEmpty()) {
           copy.declaredVariables = new HashMap<String, Variable>();
           copy.declaredVariables.putAll(declaredVariables);
         }
         copy.inStaticContext = inStaticContext;
         copy.parent = parent;
-        if (referencedClassVariables.size() > 0) {
+        if (!referencedClassVariables.isEmpty()) {
             copy.referencedClassVariables = new HashMap<String, Variable>();
             copy.referencedClassVariables.putAll(referencedClassVariables);
         }
-        if (referencedLocalVariables.size() > 0) {
+        if (!referencedLocalVariables.isEmpty()) {
             copy.referencedLocalVariables = new HashMap<String, Variable>();
             copy.referencedLocalVariables.putAll(referencedLocalVariables);
         }

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/ast/expr/DeclarationExpression.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/ast/expr/DeclarationExpression.java b/src/main/org/codehaus/groovy/ast/expr/DeclarationExpression.java
index 00ad8d8..4b1fb12 100644
--- a/src/main/org/codehaus/groovy/ast/expr/DeclarationExpression.java
+++ b/src/main/org/codehaus/groovy/ast/expr/DeclarationExpression.java
@@ -79,7 +79,7 @@ public class DeclarationExpression extends BinaryExpression {
             //nothing
         } else if (left instanceof TupleExpression) {
             TupleExpression tuple = (TupleExpression) left;
-            if (tuple.getExpressions().size()==0) throw new GroovyBugError("one element required for left side");
+            if (tuple.getExpressions().isEmpty()) throw new GroovyBugError("one element required for left side");
         } else {
             throw new GroovyBugError("illegal left expression for declaration: "+left);
         }

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/ast/expr/GStringExpression.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/ast/expr/GStringExpression.java b/src/main/org/codehaus/groovy/ast/expr/GStringExpression.java
index 35a7f91..3b769f9 100644
--- a/src/main/org/codehaus/groovy/ast/expr/GStringExpression.java
+++ b/src/main/org/codehaus/groovy/ast/expr/GStringExpression.java
@@ -88,7 +88,7 @@ public class GStringExpression extends Expression {
     public void addValue(Expression value) {
         // If the first thing is an value, then we need a dummy empty string in front of it so that when we
         // toString it they come out in the correct order.
-        if (strings.size() == 0)
+        if (strings.isEmpty())
             strings.add(ConstantExpression.EMPTY_STRING);
         values.add(value);
     }

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/classgen/AnnotationVisitor.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/classgen/AnnotationVisitor.java b/src/main/org/codehaus/groovy/classgen/AnnotationVisitor.java
index 71e89e5..82276f6 100644
--- a/src/main/org/codehaus/groovy/classgen/AnnotationVisitor.java
+++ b/src/main/org/codehaus/groovy/classgen/AnnotationVisitor.java
@@ -169,7 +169,7 @@ public class AnnotationVisitor {
         // if size is >1, then the method was overwritten or something, we ignore that
         // if it is an error, we have to test it at another place. But size==0 is
         // an error, because it means that no such attribute exists.
-        if (methods.size() == 0) {
+        if (methods.isEmpty()) {
             addError("'" + attrName + "'is not part of the annotation " + classNode, node);
             return ClassHelper.OBJECT_TYPE;
         }

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/classgen/EnumCompletionVisitor.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/classgen/EnumCompletionVisitor.java b/src/main/org/codehaus/groovy/classgen/EnumCompletionVisitor.java
index 51b17c0..d3f8f12 100644
--- a/src/main/org/codehaus/groovy/classgen/EnumCompletionVisitor.java
+++ b/src/main/org/codehaus/groovy/classgen/EnumCompletionVisitor.java
@@ -58,7 +58,7 @@ public class EnumCompletionVisitor extends ClassCodeVisitorSupport {
 
     private void completeEnum(ClassNode enumClass) {
         boolean isAic = isAnonymousInnerClass(enumClass);
-        if (enumClass.getDeclaredConstructors().size() == 0) {
+        if (enumClass.getDeclaredConstructors().isEmpty()) {
             addImplicitConstructors(enumClass, isAic);
         }
 
@@ -74,7 +74,7 @@ public class EnumCompletionVisitor extends ClassCodeVisitorSupport {
         if (aic) {
             ClassNode sn = enumClass.getSuperClass();
             List<ConstructorNode> sctors = new ArrayList<ConstructorNode>(sn.getDeclaredConstructors());
-            if (sctors.size() == 0) {
+            if (sctors.isEmpty()) {
                 addMapConstructors(enumClass, false);
             } else {
                 for (ConstructorNode constructorNode : sctors) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/classgen/EnumVisitor.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/classgen/EnumVisitor.java b/src/main/org/codehaus/groovy/classgen/EnumVisitor.java
index 92a268f..34fafb9 100644
--- a/src/main/org/codehaus/groovy/classgen/EnumVisitor.java
+++ b/src/main/org/codehaus/groovy/classgen/EnumVisitor.java
@@ -361,7 +361,7 @@ public class EnumVisitor extends ClassCodeVisitorSupport {
                     }
                     args.addExpression(exp);
                 }
-                if (savedMapEntries.size() > 0) {
+                if (!savedMapEntries.isEmpty()) {
                     args.getExpressions().add(2, new MapExpression(savedMapEntries));
                 }
             }

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/classgen/Verifier.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/classgen/Verifier.java b/src/main/org/codehaus/groovy/classgen/Verifier.java
index 0c5f1fb..9ef2dda 100644
--- a/src/main/org/codehaus/groovy/classgen/Verifier.java
+++ b/src/main/org/codehaus/groovy/classgen/Verifier.java
@@ -1210,7 +1210,7 @@ public class Verifier implements GroovyClassVisitor, Opcodes {
         addCovariantMethods(classNode, declaredMethods, abstractMethods, methodsToAdd, genericsSpec);
 
         Map<String, MethodNode> declaredMethodsMap = new HashMap<String, MethodNode>();
-        if (methodsToAdd.size() > 0) {
+        if (!methodsToAdd.isEmpty()) {
             for (MethodNode mn : declaredMethods) {
                 declaredMethodsMap.put(mn.getTypeDescriptor(), mn);
             }

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/classgen/asm/CompileStack.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/classgen/asm/CompileStack.java b/src/main/org/codehaus/groovy/classgen/asm/CompileStack.java
index ac9b7a9..bae9a51 100644
--- a/src/main/org/codehaus/groovy/classgen/asm/CompileStack.java
+++ b/src/main/org/codehaus/groovy/classgen/asm/CompileStack.java
@@ -195,7 +195,7 @@ public class CompileStack implements Opcodes {
     }
 
     private void popState() {
-        if (stateStack.size()==0) {
+        if (stateStack.isEmpty()) {
              throw new GroovyBugError("Tried to do a pop on the compile stack without push.");
         }
         StateStackElement element = (StateStackElement) stateStack.removeLast();
@@ -762,7 +762,7 @@ public class CompileStack implements Opcodes {
     }
 
     private void applyBlockRecorder(List<BlockRecorder> blocks) {
-        if (blocks.size()==0 || blocks.size()==visitedBlocks.size()) return;
+        if (blocks.isEmpty() || blocks.size()==visitedBlocks.size()) return;
 
         MethodVisitor mv = controller.getMethodVisitor();
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/classgen/asm/MopWriter.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/classgen/asm/MopWriter.java b/src/main/org/codehaus/groovy/classgen/asm/MopWriter.java
index cf1e722..98d5f33 100644
--- a/src/main/org/codehaus/groovy/classgen/asm/MopWriter.java
+++ b/src/main/org/codehaus/groovy/classgen/asm/MopWriter.java
@@ -84,7 +84,7 @@ public class MopWriter {
     }
 
     private Set<MopKey> buildCurrentClassSignatureSet(List<MethodNode> methods) {
-        if (methods.size()==0) return Collections.EMPTY_SET;
+        if (methods.isEmpty()) return Collections.EMPTY_SET;
         HashSet<MopKey> result = new HashSet<MopKey>(methods.size());
         for (MethodNode mn : methods) {
             MopKey key = new MopKey(mn.getName(), mn.getParameters());

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/classgen/asm/sc/StaticInvocationWriter.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/classgen/asm/sc/StaticInvocationWriter.java b/src/main/org/codehaus/groovy/classgen/asm/sc/StaticInvocationWriter.java
index 963ba74..6b824fd 100644
--- a/src/main/org/codehaus/groovy/classgen/asm/sc/StaticInvocationWriter.java
+++ b/src/main/org/codehaus/groovy/classgen/asm/sc/StaticInvocationWriter.java
@@ -333,7 +333,7 @@ public class StaticInvocationWriter extends InvocationWriter {
         AsmClassGenerator acg = controller.getAcg();
         TypeChooser typeChooser = controller.getTypeChooser();
         OperandStack operandStack = controller.getOperandStack();
-        ClassNode lastArgType = argumentList.size()>0?
+        ClassNode lastArgType = !argumentList.isEmpty() ?
                 typeChooser.resolveType(argumentList.get(argumentList.size()-1), controller.getClassNode()):null;
         if (lastParaType.isArray()
                 && ((argumentList.size() > para.length)

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/control/ErrorCollector.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/control/ErrorCollector.java b/src/main/org/codehaus/groovy/control/ErrorCollector.java
index 8a682d6..4777d34 100644
--- a/src/main/org/codehaus/groovy/control/ErrorCollector.java
+++ b/src/main/org/codehaus/groovy/control/ErrorCollector.java
@@ -316,7 +316,7 @@ public class ErrorCollector {
 
 
     private void write(PrintWriter writer, Janitor janitor, List messages, String txt) {
-        if (messages==null || messages.size()==0) return;
+        if (messages==null || messages.isEmpty()) return;
         Iterator iterator = messages.iterator();
         while (iterator.hasNext()) {
             Message message = (Message) iterator.next();

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java b/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
index b343211..3efefc4 100644
--- a/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
+++ b/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
@@ -3052,7 +3052,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
     public static <T> List<List<T>> collate(Iterable<T> self, int size, int step, boolean keepRemainder) {
         List<T> selfList = asList(self);
         List<List<T>> answer = new ArrayList<List<T>>();
-        if (size <= 0 || selfList.size() == 0) {
+        if (size <= 0 || selfList.isEmpty()) {
             answer.add(selfList);
         } else {
             for (int pos = 0; pos < selfList.size() && pos > -1; pos += step) {
@@ -3786,7 +3786,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
         } else if (newEntry instanceof List) {
             List list = (List) newEntry;
             // def (key, value) == list
-            Object key = list.size() == 0 ? null : list.get(0);
+            Object key = list.isEmpty() ? null : list.get(0);
             Object value = list.size() <= 1 ? null : list.get(1);
             leftShift(result, new MapEntry(key, value));
         } else if (newEntry.getClass().isArray()) {
@@ -11414,7 +11414,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      */
     public static <K,V> Map<K,V> intersect(Map<K,V> left, Map<K,V> right) {
         final Map<K,V> ansMap = createSimilarMap(left);
-        if (right != null && right.size() > 0) {
+        if (right != null && !right.isEmpty()) {
             for (Map.Entry<K, V> e1 : left.entrySet()) {
                 for (Map.Entry<K, V> e2 : right.entrySet()) {
                     if (DefaultTypeTransformation.compareEqual(e1, e2)) {
@@ -11649,7 +11649,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
             if (!found) return false;
             otherItems.remove(foundItem);
         }
-        return otherItems.size() == 0;
+        return otherItems.isEmpty();
     }
 
     /**
@@ -11836,7 +11836,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      */
     public static <T> Collection<T> minus(Collection<T> self, Collection<?> removeMe) {
         Collection<T> ansCollection = createSimilarCollection(self);
-        if (self.size() == 0)
+        if (self.isEmpty())
             return ansCollection;
         T head = self.iterator().next();
 
@@ -11987,7 +11987,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
     public static <K,V> Map<K,V> minus(Map<K,V> self, Map removeMe) {
         final Map<K,V> ansMap = createSimilarMap(self);
         ansMap.putAll(self);
-        if (removeMe != null && removeMe.size() > 0) {
+        if (removeMe != null && !removeMe.isEmpty()) {
             for (Map.Entry<K, V> e1 : self.entrySet()) {
                 for (Object e2 : removeMe.entrySet()) {
                     if (DefaultTypeTransformation.compareEqual(e1, e2)) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethodsSupport.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethodsSupport.java b/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethodsSupport.java
index 4469877..a81f292 100644
--- a/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethodsSupport.java
+++ b/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethodsSupport.java
@@ -306,7 +306,7 @@ public class DefaultGroovyMethodsSupport {
         for (Collection col : cols) {
             all.addAll(col);
         }
-        if (all.size() == 0)
+        if (all.isEmpty())
             return true;
 
         Object first = all.get(0);

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/tools/javac/JavaAwareCompilationUnit.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/tools/javac/JavaAwareCompilationUnit.java b/src/main/org/codehaus/groovy/tools/javac/JavaAwareCompilationUnit.java
index 0308af9..cb4f135 100644
--- a/src/main/org/codehaus/groovy/tools/javac/JavaAwareCompilationUnit.java
+++ b/src/main/org/codehaus/groovy/tools/javac/JavaAwareCompilationUnit.java
@@ -65,7 +65,7 @@ public class JavaAwareCompilationUnit extends CompilationUnit {
 
         addPhaseOperation(new PrimaryClassNodeOperation() {
             public void call(SourceUnit source, GeneratorContext context, ClassNode node) throws CompilationFailedException {
-                if (javaSources.size() != 0) {
+                if (!javaSources.isEmpty()) {
                     VariableScopeVisitor scopeVisitor = new VariableScopeVisitor(source);
                     scopeVisitor.visitClass(node);
                     new JavaAwareResolveVisitor(JavaAwareCompilationUnit.this).startResolving(node, source);
@@ -85,7 +85,7 @@ public class JavaAwareCompilationUnit extends CompilationUnit {
         addPhaseOperation(new PrimaryClassNodeOperation() {
             public void call(SourceUnit source, GeneratorContext context, ClassNode classNode) throws CompilationFailedException {
                 try {
-                    if (javaSources.size() != 0) stubGenerator.generateClass(classNode);
+                    if (!javaSources.isEmpty()) stubGenerator.generateClass(classNode);
                 } catch (FileNotFoundException fnfe) {
                     source.addException(fnfe);
                 }
@@ -96,7 +96,7 @@ public class JavaAwareCompilationUnit extends CompilationUnit {
     public void gotoPhase(int phase) throws CompilationFailedException {
         super.gotoPhase(phase);
         // compile Java and clean up
-        if (phase == Phases.SEMANTIC_ANALYSIS && javaSources.size() > 0) {
+        if (phase == Phases.SEMANTIC_ANALYSIS && !javaSources.isEmpty()) {
             for (ModuleNode module : getAST().getModules()) {
                 module.setImportsResolved(false);
             }

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/tools/javac/JavaStubGenerator.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/tools/javac/JavaStubGenerator.java b/src/main/org/codehaus/groovy/tools/javac/JavaStubGenerator.java
index 6770a57..198052d 100644
--- a/src/main/org/codehaus/groovy/tools/javac/JavaStubGenerator.java
+++ b/src/main/org/codehaus/groovy/tools/javac/JavaStubGenerator.java
@@ -368,7 +368,7 @@ public class JavaStubGenerator {
     }
 
     private void printEnumFields(PrintWriter out, List<FieldNode> fields) {
-        if (fields.size() != 0) {
+        if (!fields.isEmpty()) {
             boolean first = true;
             for (FieldNode field : fields) {
                 if (!first) {
@@ -442,7 +442,7 @@ public class JavaStubGenerator {
 
         BlockStatement block = (BlockStatement) code;
         List stats = block.getStatements();
-        if (stats == null || stats.size() == 0)
+        if (stats == null || stats.isEmpty())
             return null;
 
         Statement stat = (Statement) stats.get(0);

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/transform/AbstractASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/transform/AbstractASTTransformation.java b/src/main/org/codehaus/groovy/transform/AbstractASTTransformation.java
index 1a65fae..d233a86 100644
--- a/src/main/org/codehaus/groovy/transform/AbstractASTTransformation.java
+++ b/src/main/org/codehaus/groovy/transform/AbstractASTTransformation.java
@@ -248,7 +248,7 @@ public abstract class AbstractASTTransformation implements Opcodes, ASTTransform
 
     public boolean hasAnnotation(ClassNode cNode, ClassNode annotation) {
         List annots = cNode.getAnnotations(annotation);
-        return (annots != null && annots.size() > 0);
+        return (annots != null && !annots.isEmpty());
     }
 
     public static List<String> tokenize(String rawExcludes) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/transform/AnnotationCollectorTransform.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/transform/AnnotationCollectorTransform.java b/src/main/org/codehaus/groovy/transform/AnnotationCollectorTransform.java
index b313835..3c5f147 100644
--- a/src/main/org/codehaus/groovy/transform/AnnotationCollectorTransform.java
+++ b/src/main/org/codehaus/groovy/transform/AnnotationCollectorTransform.java
@@ -167,7 +167,7 @@ public class AnnotationCollectorTransform {
         }
         ListExpression memberListExp = (ListExpression) memberValue;
         List<Expression> memberList = memberListExp.getExpressions();
-        if (memberList.size()==0) return Collections.EMPTY_LIST;
+        if (memberList.isEmpty()) return Collections.EMPTY_LIST;
         List<AnnotationNode> ret = new ArrayList<AnnotationNode>();
         for (Expression e : memberList) {
             AnnotationNode toAdd = new AnnotationNode(e.getType());
@@ -233,7 +233,7 @@ public class AnnotationCollectorTransform {
 
             @SuppressWarnings("unchecked")
             Map<String,Object> member = (Map<String, Object>) inner[1];
-            if (member.size()==0) continue;
+            if (member.isEmpty()) continue;
             Map<String, Expression> generated = new HashMap<String, Expression>(member.size());
             for (String name : member.keySet()) {
                 Object val = member.get(name);
@@ -312,7 +312,7 @@ public class AnnotationCollectorTransform {
             }
         }
 
-        if (unusedNames.size()>0) {
+        if (!unusedNames.isEmpty()) {
             String message = "Annotation collector got unmapped names "+unusedNames.toString()+".";
             addError(message, aliasAnnotationUsage, source);
         }

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/transform/AutoCloneASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/transform/AutoCloneASTTransformation.java b/src/main/org/codehaus/groovy/transform/AutoCloneASTTransformation.java
index f486a9e..62f0e69 100644
--- a/src/main/org/codehaus/groovy/transform/AutoCloneASTTransformation.java
+++ b/src/main/org/codehaus/groovy/transform/AutoCloneASTTransformation.java
@@ -138,7 +138,7 @@ public class AutoCloneASTTransformation extends AbstractASTTransformation {
     }
 
     private void createCloneCopyConstructor(ClassNode cNode, List<FieldNode> list, List<String> excludes) {
-        if (cNode.getDeclaredConstructors().size() == 0) {
+        if (cNode.getDeclaredConstructors().isEmpty()) {
             // add no-arg constructor
             BlockStatement noArgBody = new BlockStatement();
             noArgBody.addStatement(EmptyStatement.INSTANCE);
@@ -199,7 +199,7 @@ public class AutoCloneASTTransformation extends AbstractASTTransformation {
     }
 
     private void createSimpleClone(ClassNode cNode, List<FieldNode> fieldNodes, List<String> excludes) {
-        if (cNode.getDeclaredConstructors().size() == 0) {
+        if (cNode.getDeclaredConstructors().isEmpty()) {
             // add no-arg constructor
             cNode.addConstructor(ACC_PUBLIC, Parameter.EMPTY_ARRAY, ClassNode.EMPTY_ARRAY, block(EmptyStatement.INSTANCE));
         }

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/transform/ImmutableASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/transform/ImmutableASTTransformation.java b/src/main/org/codehaus/groovy/transform/ImmutableASTTransformation.java
index f74f11c..a0f9ccf 100644
--- a/src/main/org/codehaus/groovy/transform/ImmutableASTTransformation.java
+++ b/src/main/org/codehaus/groovy/transform/ImmutableASTTransformation.java
@@ -182,7 +182,7 @@ public class ImmutableASTTransformation extends AbstractASTTransformation {
                 createToString(cNode, false, false, null, null, false, true);
             }
             if( memberHasValue(node, MEMBER_ADD_COPY_WITH, true) &&
-                pList.size() > 0 &&
+                    !pList.isEmpty() &&
                 !hasDeclaredMethod(cNode, COPY_WITH_METHOD, 1) ) {
                 createCopyWith( cNode, pList ) ;
             }
@@ -367,7 +367,7 @@ public class ImmutableASTTransformation extends AbstractASTTransformation {
         // check for missing properties
         body.addStatement(stmt(callX(SELF_TYPE, "checkPropNames", args("this", "args"))));
         createConstructorMapCommon(cNode, body);
-        if (list.size() > 0) {
+        if (!list.isEmpty()) {
             createNoArgConstructor(cNode);
         }
     }
@@ -530,7 +530,7 @@ public class ImmutableASTTransformation extends AbstractASTTransformation {
             return false;
         return fieldType.isEnum() ||
                 ClassHelper.isPrimitiveType(fieldType) ||
-                fieldType.getAnnotations(MY_TYPE).size() != 0;
+                !fieldType.getAnnotations(MY_TYPE).isEmpty();
     }
 
     private boolean isKnownImmutable(String fieldName, List<String> knownImmutables) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/transform/SingletonASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/transform/SingletonASTTransformation.java b/src/main/org/codehaus/groovy/transform/SingletonASTTransformation.java
index 2c23b7e..e51bc87 100644
--- a/src/main/org/codehaus/groovy/transform/SingletonASTTransformation.java
+++ b/src/main/org/codehaus/groovy/transform/SingletonASTTransformation.java
@@ -116,7 +116,7 @@ public class SingletonASTTransformation extends AbstractASTTransformation {
             }
         }
 
-        if (isStrict && cNodes.size() != 0) {
+        if (isStrict && !cNodes.isEmpty()) {
             for (ConstructorNode cNode : cNodes) {
                 addError("@Singleton didn't expect to find one or more additional constructors: remove constructor(s) or set strict=false", cNode);
             }

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/transform/TupleConstructorASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/transform/TupleConstructorASTTransformation.java b/src/main/org/codehaus/groovy/transform/TupleConstructorASTTransformation.java
index 7554ea7..c5478ba 100644
--- a/src/main/org/codehaus/groovy/transform/TupleConstructorASTTransformation.java
+++ b/src/main/org/codehaus/groovy/transform/TupleConstructorASTTransformation.java
@@ -181,7 +181,7 @@ public class TupleConstructorASTTransformation extends AbstractASTTransformation
         cNode.addConstructor(new ConstructorNode(ACC_PUBLIC, params.toArray(new Parameter[params.size()]), ClassNode.EMPTY_ARRAY, body));
         // add map constructor if needed, don't do it for LinkedHashMap for now (would lead to duplicate signature)
         // or if there is only one Map property (for backwards compatibility)
-        if (params.size() > 0 && defaults) {
+        if (!params.isEmpty() && defaults) {
             ClassNode firstParam = params.get(0).getType();
             if (params.size() > 1 || firstParam.equals(ClassHelper.OBJECT_TYPE)) {
                 String message = "The class " + cNode.getName() + " was incorrectly initialized via the map constructor with null.";

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java b/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
index bf428af..19077e2 100644
--- a/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
+++ b/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
@@ -4429,7 +4429,7 @@ public class StaticTypeCheckingVisitor extends ClassCodeVisitorSupport {
         if (arguments instanceof ArgumentListExpression) {
             ArgumentListExpression al = (ArgumentListExpression) arguments;
             List<Expression> list = al.getExpressions();
-            if (list.size()==0) return declaringClass;
+            if (list.isEmpty()) return declaringClass;
             Expression exp = list.get(0);
             ClassNode cn = exp.getNodeMetaData(ExtensionMethodDeclaringClass.class);
             if (cn!=null) return cn;

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/src/main/org/codehaus/groovy/transform/trait/TraitComposer.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/transform/trait/TraitComposer.java b/src/main/org/codehaus/groovy/transform/trait/TraitComposer.java
index 81a5b57..3855685 100644
--- a/src/main/org/codehaus/groovy/transform/trait/TraitComposer.java
+++ b/src/main/org/codehaus/groovy/transform/trait/TraitComposer.java
@@ -352,7 +352,7 @@ public abstract class TraitComposer {
             }
         }
         if (!modified) return oldTypes;
-        if (l.size()==0) return null;
+        if (l.isEmpty()) return null;
         return l.toArray(new GenericsType[l.size()]);
     }
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/FileScanner.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/FileScanner.java b/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/FileScanner.java
index 2d552d8..9774e47 100644
--- a/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/FileScanner.java
+++ b/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/FileScanner.java
@@ -54,7 +54,7 @@ public class FileScanner extends Task {
     }
 
     public boolean hasFiles() {
-        return filesets.size() > 0;
+        return !filesets.isEmpty();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovydoc.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovydoc.java b/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovydoc.java
index 2710cbd..682f175 100644
--- a/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovydoc.java
+++ b/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovydoc.java
@@ -341,7 +341,7 @@ public class Groovydoc extends Task {
         // and nested excludepackage elements
         if (this.sourcePath != null) {
             PatternSet ps = new PatternSet();
-            if (packageNames.size() > 0) {
+            if (!packageNames.isEmpty()) {
                 for (String pn : packageNames) {
                     String pkg = pn.replace('.', '/');
                     if (pkg.endsWith("*")) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/subprojects/groovy-console/src/main/groovy/groovy/ui/text/TextUndoManager.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/ui/text/TextUndoManager.java b/subprojects/groovy-console/src/main/groovy/groovy/ui/text/TextUndoManager.java
index eaf2651..72bf5d3 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/ui/text/TextUndoManager.java
+++ b/subprojects/groovy-console/src/main/groovy/groovy/ui/text/TextUndoManager.java
@@ -189,7 +189,7 @@ public class TextUndoManager extends UndoManager {
         }
 
         public boolean canUndo() {
-            return edits.size() > 0;
+            return !edits.isEmpty();
         }
 
         protected long editedTime() {

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/SimpleGroovyClassDoc.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/SimpleGroovyClassDoc.java b/subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/SimpleGroovyClassDoc.java
index 2201b5c..2ecc866 100644
--- a/subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/SimpleGroovyClassDoc.java
+++ b/subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/SimpleGroovyClassDoc.java
@@ -253,7 +253,7 @@ public class SimpleGroovyClassDoc extends SimpleGroovyAbstractableElementDoc imp
         result.add(this);
         Set<GroovyClassDoc> next = new HashSet<GroovyClassDoc>();
         next.addAll(Arrays.asList(this.interfaces()));
-        while (next.size() > 0) {
+        while (!next.isEmpty()) {
             Set<GroovyClassDoc> temp = next;
             next = new HashSet<GroovyClassDoc>();
             for (GroovyClassDoc t : temp) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/subprojects/groovy-sql/src/main/java/groovy/sql/DataSet.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-sql/src/main/java/groovy/sql/DataSet.java b/subprojects/groovy-sql/src/main/java/groovy/sql/DataSet.java
index e05eade..e4fe883 100644
--- a/subprojects/groovy-sql/src/main/java/groovy/sql/DataSet.java
+++ b/subprojects/groovy-sql/src/main/java/groovy/sql/DataSet.java
@@ -211,7 +211,7 @@ public class DataSet extends Sql {
         withinDataSetBatch = true;
         closure.call(this);
         withinDataSetBatch = false;
-        if (batchData.size() == 0) {
+        if (batchData.isEmpty()) {
             return EMPTY_INT_ARRAY;
         }
         Closure transformedClosure = new Closure(null) {
@@ -232,7 +232,7 @@ public class DataSet extends Sql {
      */
     public void add(Map<String, Object> map) throws SQLException {
         if (withinDataSetBatch) {
-            if (batchData.size() == 0) {
+            if (batchData.isEmpty()) {
                 batchKeys = map.keySet();
             } else {
                 if (!map.keySet().equals(batchKeys)) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/subprojects/groovy-templates/src/main/groovy/groovy/text/StreamingTemplateEngine.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-templates/src/main/groovy/groovy/text/StreamingTemplateEngine.java b/subprojects/groovy-templates/src/main/groovy/groovy/text/StreamingTemplateEngine.java
index b7fb032..8a02d43 100644
--- a/subprojects/groovy-templates/src/main/groovy/groovy/text/StreamingTemplateEngine.java
+++ b/subprojects/groovy-templates/src/main/groovy/groovy/text/StreamingTemplateEngine.java
@@ -802,7 +802,7 @@ public class StreamingTemplateEngine extends TemplateEngine {
             ErrorCollector collector = e.getErrorCollector();
             @SuppressWarnings({"unchecked"})
             List<Message> errors = (List<Message>) collector.getErrors();
-            if (errors.size() > 0) {
+            if (!errors.isEmpty()) {
                 Message firstMessage = errors.get(0);
                 if (firstMessage instanceof SyntaxErrorMessage) {
                     @SuppressWarnings({"ThrowableResultOfMethodCallIgnored"})

http://git-wip-us.apache.org/repos/asf/groovy/blob/61e898c6/subprojects/groovy-test/src/main/java/org/codehaus/groovy/transform/NotYetImplementedASTTransformation.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-test/src/main/java/org/codehaus/groovy/transform/NotYetImplementedASTTransformation.java b/subprojects/groovy-test/src/main/java/org/codehaus/groovy/transform/NotYetImplementedASTTransformation.java
index 5aa4c9b..2a8affe 100644
--- a/subprojects/groovy-test/src/main/java/org/codehaus/groovy/transform/NotYetImplementedASTTransformation.java
+++ b/subprojects/groovy-test/src/main/java/org/codehaus/groovy/transform/NotYetImplementedASTTransformation.java
@@ -66,7 +66,7 @@ public class NotYetImplementedASTTransformation extends AbstractASTTransformatio
             statements.addAll(((BlockStatement) statement).getStatements());
         }
 
-        if (statements.size() == 0) return;
+        if (statements.isEmpty()) return;
 
         BlockStatement rewrittenMethodCode = new BlockStatement();
 


Mime
View raw message