groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject groovy git commit: Rename class `X` to `XforStaticInitTest`
Date Mon, 21 May 2018 08:21:27 GMT
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X 6615446eb -> 836da71e9


Rename class `X` to `XforStaticInitTest`

Generics type parameters normally have a short time, e.g. `T`, `E`, `X`. If the classpath
contains a class whose name is very short, the groovy compiler will resolve the generics type
parameter with same name as the existing class when resolving the generics type parameter
failed.

See http://groovy.329449.n5.nabble.com/VOTE-Release-Apache-Groovy-2-5-0-rc-3-tp5750728p5750772.html

(cherry picked from commit b85935c)


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

Branch: refs/heads/GROOVY_2_6_X
Commit: 836da71e9cb6cf9cd43383f783142f44e92009ec
Parents: 6615446
Author: sunlan <sunlan@apache.org>
Authored: Mon May 21 16:06:19 2018 +0800
Committer: sunlan <sunlan@apache.org>
Committed: Mon May 21 16:21:22 2018 +0800

----------------------------------------------------------------------
 src/test/org/codehaus/groovy/runtime/StaticInitTest.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/836da71e/src/test/org/codehaus/groovy/runtime/StaticInitTest.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/StaticInitTest.java b/src/test/org/codehaus/groovy/runtime/StaticInitTest.java
index 0fb7ee9..35c4831 100644
--- a/src/test/org/codehaus/groovy/runtime/StaticInitTest.java
+++ b/src/test/org/codehaus/groovy/runtime/StaticInitTest.java
@@ -23,13 +23,14 @@ import junit.framework.TestCase;
 
 import java.lang.reflect.Field;
 
-class X {
+class XforStaticInitTest {
 
     public static int field = 0;
 
     static {
         StaticInitTest.failed = true;
     }
+
 }
 
 public class StaticInitTest extends TestCase {
@@ -37,7 +38,7 @@ public class StaticInitTest extends TestCase {
     static boolean failed;
 
     public void testInitOrder () throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException
{
-        final Field f = new GroovyClassLoader().loadClass("org.codehaus.groovy.runtime.X",
false, false, false).getField("field");
+        final Field f = new GroovyClassLoader().loadClass("org.codehaus.groovy.runtime.XforStaticInitTest",
false, false, false).getField("field");
         assertTrue(!failed);
         f.getInt(null);
         assertTrue(failed);


Mime
View raw message