[groovy] branch master updated (389e428 -> bbdec88)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[groovy] branch master updated (389e428 -> bbdec88)

paulk
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 389e428  Refactor DGM (remove deprecated methods)
     new d3867eb  remove old commented out code
     new bbdec88  refactor DGM (fix for JDK8)

The 2 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:
 .../groovy/runtime/DefaultGroovyMethods.java       | 65 +---------------------
 1 file changed, 1 insertion(+), 64 deletions(-)

Reply | Threaded
Open this post in threaded view
|

[groovy] 01/02: remove old commented out code

paulk
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 d3867ebdc2a4bc14843c2ba255eb10bf196eb107
Author: Paul King <[hidden email]>
AuthorDate: Mon Mar 23 09:37:26 2020 +1000

    remove old commented out code
---
 .../groovy/runtime/DefaultGroovyMethods.java       | 63 ----------------------
 1 file changed, 63 deletions(-)

diff --git a/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java b/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
index 56f57cc..82ecb1c 100644
--- a/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
+++ b/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
@@ -14017,69 +14017,6 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
         return result;
     }
 
-//    public static Boolean putAt(boolean[] array, int idx, Boolean newValue) {
-//        return (Boolean) primitiveArrayPut(array, idx, newValue);
-//    }
-//
-//    public static Byte putAt(byte[] array, int idx, Object newValue) {
-//        if (!(newValue instanceof Byte)) {
-//            Number n = (Number) newValue;
-//            newValue = new Byte(n.byteValue());
-//        }
-//        return (Byte) primitiveArrayPut(array, idx, newValue);
-//    }
-//
-//    public static Character putAt(char[] array, int idx, Object newValue) {
-//        if (newValue instanceof String) {
-//            String s = (String) newValue;
-//            if (s.length() != 1) throw new IllegalArgumentException("String of length 1 expected but got a bigger one");
-//            char c = s.charAt(0);
-//            newValue = new Character(c);
-//        }
-//        return (Character) primitiveArrayPut(array, idx, newValue);
-//    }
-//
-//    public static Short putAt(short[] array, int idx, Object newValue) {
-//        if (!(newValue instanceof Short)) {
-//            Number n = (Number) newValue;
-//            newValue = new Short(n.shortValue());
-//        }
-//        return (Short) primitiveArrayPut(array, idx, newValue);
-//    }
-//
-//    public static Integer putAt(int[] array, int idx, Object newValue) {
-//        if (!(newValue instanceof Integer)) {
-//            Number n = (Number) newValue;
-//            newValue = Integer.valueOf(n.intValue());
-//        }
-//        array [normaliseIndex(idx,array.length)] = ((Integer)newValue).intValue();
-//        return (Integer) newValue;
-//    }
-//
-//    public static Long putAt(long[] array, int idx, Object newValue) {
-//        if (!(newValue instanceof Long)) {
-//            Number n = (Number) newValue;
-//            newValue = new Long(n.longValue());
-//        }
-//        return (Long) primitiveArrayPut(array, idx, newValue);
-//    }
-//
-//    public static Float putAt(float[] array, int idx, Object newValue) {
-//        if (!(newValue instanceof Float)) {
-//            Number n = (Number) newValue;
-//            newValue = new Float(n.floatValue());
-//        }
-//        return (Float) primitiveArrayPut(array, idx, newValue);
-//    }
-//
-//    public static Double putAt(double[] array, int idx, Object newValue) {
-//        if (!(newValue instanceof Double)) {
-//            Number n = (Number) newValue;
-//            newValue = new Double(n.doubleValue());
-//        }
-//        return (Double) primitiveArrayPut(array, idx, newValue);
-//    }
-
     /**
      * Support assigning a range of values with a single assignment statement.
      *

Reply | Threaded
Open this post in threaded view
|

[groovy] 02/02: refactor DGM (fix for JDK8)

paulk
In reply to this post by paulk
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 bbdec88c1148fd0b9cff3841fdfea911756ddc50
Author: Paul King <[hidden email]>
AuthorDate: Mon Mar 23 09:37:50 2020 +1000

    refactor DGM (fix for JDK8)
---
 src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java b/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
index 82ecb1c..660bcf7 100644
--- a/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
+++ b/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
@@ -11460,7 +11460,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      */
     public static <T> T asType(Iterable iterable, Class<T> clazz) {
         if (Collection.class.isAssignableFrom(clazz)) {
-            return asType(toList(iterable), clazz);
+            return asType((Collection) toList(iterable), clazz);
         }
 
         return asType((Object) iterable, clazz);