groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwagenleit...@apache.org
Subject [3/3] groovy git commit: Remove Java 1.4 compatibility code (Integer.valueOf(int) was added in 1.5)
Date Sun, 31 Jan 2016 16:18:57 GMT
Remove Java 1.4 compatibility code (Integer.valueOf(int) was added in 1.5)


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

Branch: refs/heads/GROOVY_2_4_X
Commit: a007f8700a5b38cbdf6700c73de65e719471e50a
Parents: 220c4ee
Author: John Wagenleitner <jwagenleitner@apache.org>
Authored: Sun Jan 31 07:08:10 2016 -0800
Committer: John Wagenleitner <jwagenleitner@apache.org>
Committed: Sun Jan 31 08:17:41 2016 -0800

----------------------------------------------------------------------
 .../runtime/PerInstanceMetaClassTest.groovy     | 29 --------------------
 1 file changed, 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/a007f870/src/test/org/codehaus/groovy/runtime/PerInstanceMetaClassTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/PerInstanceMetaClassTest.groovy b/src/test/org/codehaus/groovy/runtime/PerInstanceMetaClassTest.groovy
index 5488862..8ed2e02 100644
--- a/src/test/org/codehaus/groovy/runtime/PerInstanceMetaClassTest.groovy
+++ b/src/test/org/codehaus/groovy/runtime/PerInstanceMetaClassTest.groovy
@@ -20,35 +20,8 @@ package org.codehaus.groovy.runtime
 
 class PerInstanceMetaClassTest extends GroovyTestCase{
 
-    static Integer [] cache
-
-    static {
-        try {
-            Integer.valueOf(0)
-        }
-        catch (MissingMethodException e) {
-            cache = new Integer[-(-128) + 127 + 1]
-            for(int i = 0; i < cache.length; i++)
-              cache[i] = new Integer(i - 128);
-        }
-    }
-
     protected void setUp() {
         Integer.metaClass = null
-        setValueOfMethod()
-    }
-
-    private def setValueOfMethod() {
-        if (cache != null) {
-            Integer.metaClass.static.valueOf = {
-                Integer i ->
-                final int offset = 128;
-                if (i >= -128 && i <= 127) { // must cache
-                    return cache[i + offset];
-                }
-                return new Integer(i);
-            }
-        }
     }
 
     void testEMC () {
@@ -88,7 +61,6 @@ class PerInstanceMetaClassTest extends GroovyTestCase{
 
         x.metaClass = null
         Integer.metaClass = null
-        setValueOfMethod()
 
         assertEquals 28, x + 6
 
@@ -277,7 +249,6 @@ class PerInstanceMetaClassTest extends GroovyTestCase{
        ExpandoMetaClass.enableGlobally()
 
        Integer.metaClass = null
-       setValueOfMethod()
 
        def foo =  { x ->
            return x._100 


Mime
View raw message