Repository: groovy Updated Branches: refs/heads/master 67b774284 -> f7be98a08
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/53ac431f Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/53ac431f Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/53ac431f Branch: refs/heads/master Commit: 53ac431f807f629ad49bfb91a511ff95b42828ca Parents: 67b7742 Author: John Wagenleitner <[email protected]> Authored: Sun Jan 31 07:08:10 2016 -0800 Committer: John Wagenleitner <[email protected]> Committed: Sun Jan 31 07:08:10 2016 -0800 ---------------------------------------------------------------------- .../runtime/PerInstanceMetaClassTest.groovy | 29 -------------------- 1 file changed, 29 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/53ac431f/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
