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:S1764 - Identical expressions should not be used on both sides of a binary operator
Date Mon, 04 Jan 2016 09:02:24 GMT
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_4_X 32d35a159 -> 82d1390ba


Fixing squid:S1764 - Identical expressions should not be used on both sides of a binary operator


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

Branch: refs/heads/GROOVY_2_4_X
Commit: 82d1390ba7361793be94fc321728287dd246dbb4
Parents: 32d35a1
Author: Kirill Vlasov <kirill.vlasov@devfactory.com>
Authored: Wed Dec 30 10:42:25 2015 +0500
Committer: paulk <paulk@asert.com.au>
Committed: Mon Jan 4 19:02:09 2016 +1000

----------------------------------------------------------------------
 src/main/groovy/transform/builder/DefaultStrategy.java             | 2 +-
 src/main/groovy/util/FactoryBuilderSupport.java                    | 2 +-
 .../java/groovy/util/slurpersupport/NamespaceAwareHashMap.java     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/82d1390b/src/main/groovy/transform/builder/DefaultStrategy.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/transform/builder/DefaultStrategy.java b/src/main/groovy/transform/builder/DefaultStrategy.java
index 0b3987f..2cb6922 100644
--- a/src/main/groovy/transform/builder/DefaultStrategy.java
+++ b/src/main/groovy/transform/builder/DefaultStrategy.java
@@ -176,7 +176,7 @@ public class DefaultStrategy extends BuilderASTTransformation.AbstractBuilderStr
     }
 
     public void buildMethod(BuilderASTTransformation transform, MethodNode mNode, AnnotationNode
anno) {
-        if (transform.getMemberValue(anno, "includes") != null || transform.getMemberValue(anno,
"includes") != null) {
+        if (transform.getMemberValue(anno, "includes") != null || transform.getMemberValue(anno,
"excludes") != null) {
             transform.addError("Error during " + BuilderASTTransformation.MY_TYPE_NAME +
                     " processing: includes/excludes only allowed on classes", anno);
         }

http://git-wip-us.apache.org/repos/asf/groovy/blob/82d1390b/src/main/groovy/util/FactoryBuilderSupport.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/FactoryBuilderSupport.java b/src/main/groovy/util/FactoryBuilderSupport.java
index 4041113..543b7dd 100644
--- a/src/main/groovy/util/FactoryBuilderSupport.java
+++ b/src/main/groovy/util/FactoryBuilderSupport.java
@@ -68,7 +68,7 @@ public abstract class FactoryBuilderSupport extends Binding {
         public int compare(final Method o1, final Method o2) {
             int cmp = o1.getName().compareTo(o2.getName());
             if (cmp != 0) return cmp;
-            cmp = o1.getParameterTypes().length - o1.getParameterTypes().length;
+            cmp = o1.getParameterTypes().length - o2.getParameterTypes().length;
             return cmp;
         }
     };

http://git-wip-us.apache.org/repos/asf/groovy/blob/82d1390b/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/NamespaceAwareHashMap.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/NamespaceAwareHashMap.java
b/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/NamespaceAwareHashMap.java
index 5c15571..3508c02 100644
--- a/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/NamespaceAwareHashMap.java
+++ b/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/NamespaceAwareHashMap.java
@@ -69,7 +69,7 @@ public class NamespaceAwareHashMap extends HashMap<String, String>
{
 
     private Object adjustForNamespaceIfNeeded(Object key) {
         String keyString = key.toString();
-        if (keyString.contains("{") || namespaceTagHints == null || namespaceTagHints.isEmpty()
|| keyString.contains("{") || !keyString.contains(":")) {
+        if (keyString.contains("{") || namespaceTagHints == null || namespaceTagHints.isEmpty()
|| !keyString.contains(":")) {
             return key;
         }
         final int i = keyString.indexOf(":");


Mime
View raw message