You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2019/04/16 09:43:13 UTC

[groovy] branch master updated (241eca6 -> 5d34fd3)

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git.


    from 241eca6  remove codenarc warnings
     new 7c4bbb9  Revert "remove codenarc warnings"
     new f8b6f09  Revert "remove codenarc warnings"
     new 16a2d42  remove codenarc warnings (take 2)
     new 5d34fd3  remove codenarc warnings (take 2)

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/test/groovy/PrimitiveTypesTest.groovy           | 21 +++++++++++----------
 src/test/groovy/bugs/Groovy4078Bug.groovy           | 10 +++++-----
 .../transform/tailrec/TailRecursiveExamples.groovy  |  2 +-
 .../src/main/java/groovy/util/AntBuilder.java       |  5 ++---
 .../main/java/org/codehaus/groovy/ant/Groovy.java   |  3 +--
 .../tools/shell/util/PackageHelperImpl.groovy       |  4 +---
 .../groovy/binding/ClosureTriggerBinding.java       |  5 ++---
 7 files changed, 23 insertions(+), 27 deletions(-)


[groovy] 04/04: remove codenarc warnings (take 2)

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 5d34fd3abfafdb55ab58ca3f0f7bc2290da7d948
Author: Paul King <pa...@asert.com.au>
AuthorDate: Tue Apr 16 19:42:27 2019 +1000

    remove codenarc warnings (take 2)
---
 src/test/groovy/bugs/Groovy4078Bug.groovy          | 98 +++++++++++-----------
 .../operator/BigIntegerOperationsTest.groovy       |  2 +-
 .../transform/tailrec/TailRecursiveExamples.groovy |  4 +-
 3 files changed, 52 insertions(+), 52 deletions(-)

diff --git a/src/test/groovy/bugs/Groovy4078Bug.groovy b/src/test/groovy/bugs/Groovy4078Bug.groovy
index 1f755d5..fc13e28 100644
--- a/src/test/groovy/bugs/Groovy4078Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4078Bug.groovy
@@ -1,49 +1,49 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package groovy.bugs
-
-class Groovy4078Bug extends GroovyTestCase {
-    void testInfiniteLoopDetectionInStepUsage() {
-        (2..2).step 0, {assert it != null} //IntRange
-        
-        ('b'..'b').step 0, {assert it != null} //ObjectRange
-        
-        5.step( 5, 1 ) { assert it != null } // DGM.step(), int
-        
-        5.0.step (5.0, 1 ) { assert it != null } // DGM.step(), BigDecimal
-        
-        def from = new BigInteger(5)
-        def to = new BigInteger(5)
-        from.step (to, 1 ) { assert it != null }  // DGM.step(), BigInteger
-
-        try{
-            (1..2).step 0, {assert it != null} //IntRange
-            fail('Should have failed as step size 0 causes infinite loop')
-        } catch(ex) {
-            assert ex.message.contains('Infinite loop detected due to step size of 0')
-        }
-                      
-        try{
-            ('a'..'b').step 0, {assert it != null} // ObjectRange
-            fail('Should have failed as step size 0 causes infinite loop')
-        } catch(ex) {
-            assert ex.message.contains('Infinite loop detected due to step size of 0')
-        }
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package groovy.bugs
+
+class Groovy4078Bug extends GroovyTestCase {
+    void testInfiniteLoopDetectionInStepUsage() {
+        (2..2).step 0, {assert it != null} //IntRange
+
+        ('b'..'b').step 0, {assert it != null} //ObjectRange
+
+        5.step( 5, 1 ) { assert it != null } // DGM.step(), int
+
+        5.0.step (5.0, 1 ) { assert it != null } // DGM.step(), BigDecimal
+
+        def from = BigInteger.valueOf(5)
+        def to = BigInteger.valueOf(5)
+        from.step (to, 1 ) { assert it != null }  // DGM.step(), BigInteger
+
+        try{
+            (1..2).step 0, {assert it != null} //IntRange
+            fail('Should have failed as step size 0 causes infinite loop')
+        } catch(ex) {
+            assert ex.message.contains('Infinite loop detected due to step size of 0')
+        }
+
+        try{
+            ('a'..'b').step 0, {assert it != null} // ObjectRange
+            fail('Should have failed as step size 0 causes infinite loop')
+        } catch(ex) {
+            assert ex.message.contains('Infinite loop detected due to step size of 0')
+        }
+    }
+}
diff --git a/src/test/groovy/operator/BigIntegerOperationsTest.groovy b/src/test/groovy/operator/BigIntegerOperationsTest.groovy
index 22bffc8..21f79e8 100644
--- a/src/test/groovy/operator/BigIntegerOperationsTest.groovy
+++ b/src/test/groovy/operator/BigIntegerOperationsTest.groovy
@@ -58,7 +58,7 @@ class BigIntegerOperationsTest extends GroovyTestCase {
     }
     
     void testAsOperatorPrecisionLoss() {
-        def value = new BigInteger(Long.MAX_VALUE) + 1
+        def value = BigInteger.valueOf(Long.MAX_VALUE) + 1
         def value2 = value as BigInteger
         assert value == value2
     }
diff --git a/src/test/org/codehaus/groovy/transform/tailrec/TailRecursiveExamples.groovy b/src/test/org/codehaus/groovy/transform/tailrec/TailRecursiveExamples.groovy
index 11d916e..f89d7bb 100644
--- a/src/test/org/codehaus/groovy/transform/tailrec/TailRecursiveExamples.groovy
+++ b/src/test/org/codehaus/groovy/transform/tailrec/TailRecursiveExamples.groovy
@@ -66,8 +66,8 @@ class TailRecursiveExamples {
         assert target.reduce(0, plus, 1, 5, 10) == 16
         assert target.reduce(99, plus, 1, 5, 10, 98) == 213
 
-        def numbersFrom1to1000 = (1..1000).collect { new BigInteger(it) }.toArray()
-        assert target.reduce(new BigInteger(1), { BigInteger a, BigInteger b -> a * b }, numbersFrom1to1000).bitCount() == 3788
+        def numbersFrom1to1000 = (1..1000).collect { BigInteger.valueOf(it) }.toArray()
+        assert target.reduce(BigInteger.valueOf(1), { BigInteger a, BigInteger b -> a * b }, numbersFrom1to1000).bitCount() == 3788
     }
 
     @Test


[groovy] 01/04: Revert "remove codenarc warnings"

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 7c4bbb911a8f02d423adbf96a076c13d339fed23
Author: Paul King <pa...@asert.com.au>
AuthorDate: Tue Apr 16 17:44:20 2019 +1000

    Revert "remove codenarc warnings"
    
    This reverts commit 1bb3e041672f719745cbc523b7d342296014791a.
---
 src/test/groovy/PrimitiveTypesTest.groovy          | 21 ++---
 src/test/groovy/bugs/Groovy4078Bug.groovy          | 98 +++++++++++-----------
 .../operator/BigIntegerOperationsTest.groovy       |  2 +-
 .../transform/tailrec/TailRecursiveExamples.groovy |  4 +-
 .../src/main/java/groovy/util/AntBuilder.java      |  5 +-
 .../main/java/org/codehaus/groovy/ant/Groovy.java  |  3 +-
 .../tools/shell/util/PackageHelperImpl.groovy      |  4 +-
 .../groovy/binding/ClosureTriggerBinding.java      |  5 +-
 8 files changed, 69 insertions(+), 73 deletions(-)

diff --git a/src/test/groovy/PrimitiveTypesTest.groovy b/src/test/groovy/PrimitiveTypesTest.groovy
index 15cf1b7..eacd6d8 100644
--- a/src/test/groovy/PrimitiveTypesTest.groovy
+++ b/src/test/groovy/PrimitiveTypesTest.groovy
@@ -21,35 +21,35 @@ package groovy
 class PrimitiveTypesTest extends GroovyTestCase {
 
     int getInt() {
-        return 1
+        return 1;
     }
     
     short getShort() {
-        return 1
+        return 1;
     }
     
     boolean getBoolean() {
-        return true
+        return true;
     }
     
     double getDouble() {
-        return 1.0
+        return 1.0;
     }
     
     float getFloat() {
-        return 1.0
+        return 1.0;
     }
     
     byte getByte() {
-        return 1
+        return 1;
     }
     
     long getLong() {
-        return 1
+        return 1;
     }
 
     char getChar() {
-        return 'a'
+        return 'a';
     }
     
     int getNextInt(int i) {
@@ -85,14 +85,15 @@ class PrimitiveTypesTest extends GroovyTestCase {
     }
 
     void testBigInteger2BigDecimal() {
-        BigInteger big = BigInteger.valueOf(Long.MAX_VALUE)
+        BigInteger big = new BigInteger(Long.MAX_VALUE)
         assert big.longValue() == testMethod(big).longValueExact()
     }
 
     private testMethod(BigDecimal bd) {
-        return bd
+        return bd;
     }
 
+
     static void main(args) {
         new PrimitiveTypesTest().testPrimitiveTypes()
     }
diff --git a/src/test/groovy/bugs/Groovy4078Bug.groovy b/src/test/groovy/bugs/Groovy4078Bug.groovy
index 9bf88c5..1f755d5 100644
--- a/src/test/groovy/bugs/Groovy4078Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4078Bug.groovy
@@ -1,49 +1,49 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package groovy.bugs
-
-class Groovy4078Bug extends GroovyTestCase {
-    void testInfiniteLoopDetectionInStepUsage() {
-        (2..2).step 0, {assert it != null} //IntRange
-        
-        ('b'..'b').step 0, {assert it != null} //ObjectRange
-        
-        5.step( 5, 1 ) { assert it != null } // DGM.step(), int
-        
-        5.0.step (5.0, 1 ) { assert it != null } // DGM.step(), BigDecimal
-        
-        def from = BigInteger.valueOf(5)
-        def to = BigInteger.valueOf(5)
-        from.step (to, 1 ) { assert it != null }  // DGM.step(), BigInteger
-
-        try{
-            (1..2).step 0, {assert it != null} //IntRange
-            fail('Should have failed as step size 0 causes infinite loop')
-        } catch(ex) {
-            assert ex.message.contains('Infinite loop detected due to step size of 0')
-        }
-                      
-        try{
-            ('a'..'b').step 0, {assert it != null} // ObjectRange
-            fail('Should have failed as step size 0 causes infinite loop')
-        } catch(ex) {
-            assert ex.message.contains('Infinite loop detected due to step size of 0')
-        }
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package groovy.bugs
+
+class Groovy4078Bug extends GroovyTestCase {
+    void testInfiniteLoopDetectionInStepUsage() {
+        (2..2).step 0, {assert it != null} //IntRange
+        
+        ('b'..'b').step 0, {assert it != null} //ObjectRange
+        
+        5.step( 5, 1 ) { assert it != null } // DGM.step(), int
+        
+        5.0.step (5.0, 1 ) { assert it != null } // DGM.step(), BigDecimal
+        
+        def from = new BigInteger(5)
+        def to = new BigInteger(5)
+        from.step (to, 1 ) { assert it != null }  // DGM.step(), BigInteger
+
+        try{
+            (1..2).step 0, {assert it != null} //IntRange
+            fail('Should have failed as step size 0 causes infinite loop')
+        } catch(ex) {
+            assert ex.message.contains('Infinite loop detected due to step size of 0')
+        }
+                      
+        try{
+            ('a'..'b').step 0, {assert it != null} // ObjectRange
+            fail('Should have failed as step size 0 causes infinite loop')
+        } catch(ex) {
+            assert ex.message.contains('Infinite loop detected due to step size of 0')
+        }
+    }
+}
diff --git a/src/test/groovy/operator/BigIntegerOperationsTest.groovy b/src/test/groovy/operator/BigIntegerOperationsTest.groovy
index 21f79e8..22bffc8 100644
--- a/src/test/groovy/operator/BigIntegerOperationsTest.groovy
+++ b/src/test/groovy/operator/BigIntegerOperationsTest.groovy
@@ -58,7 +58,7 @@ class BigIntegerOperationsTest extends GroovyTestCase {
     }
     
     void testAsOperatorPrecisionLoss() {
-        def value = BigInteger.valueOf(Long.MAX_VALUE) + 1
+        def value = new BigInteger(Long.MAX_VALUE) + 1
         def value2 = value as BigInteger
         assert value == value2
     }
diff --git a/src/test/org/codehaus/groovy/transform/tailrec/TailRecursiveExamples.groovy b/src/test/org/codehaus/groovy/transform/tailrec/TailRecursiveExamples.groovy
index a6f54fd..11d916e 100644
--- a/src/test/org/codehaus/groovy/transform/tailrec/TailRecursiveExamples.groovy
+++ b/src/test/org/codehaus/groovy/transform/tailrec/TailRecursiveExamples.groovy
@@ -66,8 +66,8 @@ class TailRecursiveExamples {
         assert target.reduce(0, plus, 1, 5, 10) == 16
         assert target.reduce(99, plus, 1, 5, 10, 98) == 213
 
-        def numbersFrom1to1000 = (1..1000).collect { BigInteger.valueOf(it) }.toArray()
-        assert target.reduce(BigInteger.ONE, { BigInteger a, BigInteger b -> a * b }, numbersFrom1to1000).bitCount() == 3788
+        def numbersFrom1to1000 = (1..1000).collect { new BigInteger(it) }.toArray()
+        assert target.reduce(new BigInteger(1), { BigInteger a, BigInteger b -> a * b }, numbersFrom1to1000).bitCount() == 3788
     }
 
     @Test
diff --git a/subprojects/groovy-ant/src/main/java/groovy/util/AntBuilder.java b/subprojects/groovy-ant/src/main/java/groovy/util/AntBuilder.java
index 63123d9..ae176e0 100644
--- a/subprojects/groovy-ant/src/main/java/groovy/util/AntBuilder.java
+++ b/subprojects/groovy-ant/src/main/java/groovy/util/AntBuilder.java
@@ -35,7 +35,6 @@ import org.apache.tools.ant.dispatch.DispatchUtils;
 import org.apache.tools.ant.helper.AntXMLContext;
 import org.apache.tools.ant.helper.ProjectHelper2;
 import org.codehaus.groovy.ant.FileScanner;
-import org.codehaus.groovy.reflection.ReflectionUtils;
 import org.codehaus.groovy.runtime.DefaultGroovyMethodsSupport;
 import org.xml.sax.Attributes;
 import org.xml.sax.Locator;
@@ -321,7 +320,7 @@ public class AntBuilder extends BuilderSupport {
         try {
             // Have to call fireTestStared/fireTestFinished via reflection as they unfortunately have protected access in Project
             final Method fireTaskStarted = Project.class.getDeclaredMethod("fireTaskStarted", Task.class);
-            ReflectionUtils.trySetAccessible(fireTaskStarted);
+            fireTaskStarted.setAccessible(true);
             fireTaskStarted.invoke(project, task);
 
             Object realThing;
@@ -355,7 +354,7 @@ public class AntBuilder extends BuilderSupport {
         finally {
             try {
                 final Method fireTaskFinished = Project.class.getDeclaredMethod("fireTaskFinished", Task.class, Throwable.class);
-                ReflectionUtils.trySetAccessible(fireTaskFinished);
+                fireTaskFinished.setAccessible(true);
                 fireTaskFinished.invoke(project, task, reason);
             }
             catch (Exception e) {
diff --git a/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovy.java b/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovy.java
index f235771..15825f5 100644
--- a/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovy.java
+++ b/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovy.java
@@ -36,7 +36,6 @@ import org.apache.tools.ant.util.FileUtils;
 import org.codehaus.groovy.control.CompilationFailedException;
 import org.codehaus.groovy.control.CompilerConfiguration;
 import org.codehaus.groovy.control.customizers.ImportCustomizer;
-import org.codehaus.groovy.reflection.ReflectionUtils;
 import org.codehaus.groovy.runtime.InvokerHelper;
 import org.codehaus.groovy.runtime.ResourceGroovyMethods;
 import org.codehaus.groovy.tools.ErrorReporter;
@@ -431,7 +430,7 @@ public class Groovy extends Java {
             try {
                 final Object propsHandler = project.getClass().getMethod("getPropsHandler").invoke(project);
                 final Field contextField = propsHandler.getClass().getDeclaredField("context");
-                ReflectionUtils.trySetAccessible(contextField);
+                contextField.setAccessible(true);
                 final Object context = contextField.get(propsHandler);
                 mavenPom = InvokerHelper.invokeMethod(context, "getProject", EMPTY_OBJECT_ARRAY);
             }
diff --git a/subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/util/PackageHelperImpl.groovy b/subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/util/PackageHelperImpl.groovy
index 7293b3e..17d0e09 100644
--- a/subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/util/PackageHelperImpl.groovy
+++ b/subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/util/PackageHelperImpl.groovy
@@ -183,14 +183,12 @@ def filterClassName(Path path) {
     }
 }
 
-class GroovyFileVisitor extends SimpleFileVisitor {}
-
 // walk each file and directory, possibly storing directories as packages, and files as classes
 Files.walkFileTree(fs.getPath('modules'),
         [preVisitDirectory: { dir, attrs -> filterPackageName(dir); FileVisitResult.CONTINUE },
          visitFile: { file, attrs -> filterClassName(file); FileVisitResult.CONTINUE}
         ]
-            as GroovyFileVisitor)
+            as SimpleFileVisitor)
 '''
 
         Set<String> jigsawPackages = (Set<String>) shell.getProperty('result')
diff --git a/subprojects/groovy-swing/src/main/java/org/codehaus/groovy/binding/ClosureTriggerBinding.java b/subprojects/groovy-swing/src/main/java/org/codehaus/groovy/binding/ClosureTriggerBinding.java
index 0069d92..f31dbfb 100644
--- a/subprojects/groovy-swing/src/main/java/org/codehaus/groovy/binding/ClosureTriggerBinding.java
+++ b/subprojects/groovy-swing/src/main/java/org/codehaus/groovy/binding/ClosureTriggerBinding.java
@@ -21,7 +21,6 @@ package org.codehaus.groovy.binding;
 import groovy.lang.Closure;
 import groovy.lang.GroovyObjectSupport;
 import groovy.lang.Reference;
-import org.codehaus.groovy.reflection.ReflectionUtils;
 
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
@@ -82,13 +81,13 @@ public class ClosureTriggerBinding implements TriggerBinding, SourceBinding {
                     }
                     try {
                         boolean acc = constructor.isAccessible();
-                        ReflectionUtils.trySetAccessible(constructor);
+                        constructor.setAccessible(true);
                         Closure localCopy = (Closure) constructor.newInstance(args);
                         if (!acc) { constructor.setAccessible(false); }
                         localCopy.setResolveStrategy(Closure.DELEGATE_ONLY);
                         for (Field f:closureClass.getDeclaredFields()) {
                             acc = f.isAccessible();
-                            ReflectionUtils.trySetAccessible(f);
+                            f.setAccessible(true);
                             if (f.getType() == Reference.class) {
                                 delegate.fields.put(f.getName(),
                                         (BindPathSnooper) ((Reference) f.get(localCopy)).get());


[groovy] 03/04: remove codenarc warnings (take 2)

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 16a2d4267f4d4cc55d3f6e3107383743ec2b9c2e
Author: Paul King <pa...@asert.com.au>
AuthorDate: Tue Apr 16 17:46:10 2019 +1000

    remove codenarc warnings (take 2)
---
 src/test/groovy/util/ProxyGeneratorTest.groovy | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/test/groovy/util/ProxyGeneratorTest.groovy b/src/test/groovy/util/ProxyGeneratorTest.groovy
index 53af084..5e165c2 100644
--- a/src/test/groovy/util/ProxyGeneratorTest.groovy
+++ b/src/test/groovy/util/ProxyGeneratorTest.groovy
@@ -93,7 +93,8 @@ class ProxyGeneratorTest extends GroovyTestCase {
         assert 3 == testClass[2]
         testClass[3] = 99
         assert 99 == testClass[3]
-        testClass.removeRange(1, 3)
+        testClass.removeAt(2)
+        testClass.removeAt(1)
         assert [1, 99, 5] == testClass
     }
 


[groovy] 02/04: Revert "remove codenarc warnings"

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit f8b6f0959b8bbf3b86ae2df07ba9570a8d4d8e7a
Author: Paul King <pa...@asert.com.au>
AuthorDate: Tue Apr 16 17:44:24 2019 +1000

    Revert "remove codenarc warnings"
    
    This reverts commit 241eca618c7bff385f9a80117ebddda24d13cdf6.
---
 src/test/groovy/util/ProxyGeneratorTest.groovy | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/test/groovy/util/ProxyGeneratorTest.groovy b/src/test/groovy/util/ProxyGeneratorTest.groovy
index 5e165c2..53af084 100644
--- a/src/test/groovy/util/ProxyGeneratorTest.groovy
+++ b/src/test/groovy/util/ProxyGeneratorTest.groovy
@@ -93,8 +93,7 @@ class ProxyGeneratorTest extends GroovyTestCase {
         assert 3 == testClass[2]
         testClass[3] = 99
         assert 99 == testClass[3]
-        testClass.removeAt(2)
-        testClass.removeAt(1)
+        testClass.removeRange(1, 3)
         assert [1, 99, 5] == testClass
     }