Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.5
-
Fix Version/s: 1.5.8
-
Component/s: groovy-jdk
-
Labels:None
-
Environment:Windows XP SP2
-
Number of attachments :
Description
static method in sub category class could not override that in super category class.
More information to recreate the problem
****************************************************
TestBaseCategory .java
****************************************************
package zero.assemble.flow.util;
public class TestBaseCategory {
public static void test(Object str)
{ System.out.println("test() in TestBaseCategory"); }}
****************************************************
TestCategory.java
****************************************************
package zero.assemble.flow.util;
public class TestCategory extends TestBaseCategory{
public static void test(Object str)
}
****************************************************
test.groovy
****************************************************
use (zero.assemble.flow.util.TestCategory) {
"abc".test()
}
In the system console, it should show the "test() in TestCategory", but it show
"test() in TestBaseCategory",
When our debug the code, we found the
org.codehaus.groovy.runtime.metaclass.NewMetaMethod#getDeclaringClass() could
not return correct class.