[groovy-user] Method-Calls 1.0 vs. 1.5

0 views
Skip to first unread message

Thorsten Kamann

unread,
Jan 28, 2008, 11:23:18 AM1/28/08
to us...@groovy.codehaus.org
Hello,

I am preparing some projects here at my work to upgrade from 1.0 to 1.5.

In many test I get a red bar if I try to do this:

SomeClass.java
public class ...{
public void finish(boolean state){}
}


SomeTest.groovy:

public class ...{

final void testSomething(){
def someClass = new SomeClass()

[...]

someClass.finish()
}
}

This works with 1.0 but not 1.5. With 1.5 I get this exception:
java.lang.IllegalArgumentException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:95)
at
org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:599)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:904)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
at
org.codehaus.groovy.runtime.InvokerHelper.invokePojoMethod(InvokerHelper.java:761)
at
org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:749)
at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:167)
at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod0(ScriptBytecodeAdapter.java:195)
at ...SomeTest.testSomething(SomeTest.groovy:64)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

Is this right? And if yes why is this changed?

Thanks
Thorsten


--
Thorsten Kamann
Software-Architect, Consultant, Coaching
Germany, NRW

thorste...@googlemail.com
http://www.thorsten-kamann.de/
callto://thorque

Fornax-Platform - Platform for developing MDSD-related Tools and components
http://www.fornax-platform.org/


---------------------------------------------------------------------
To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Jürgen Hermann

unread,
Jan 29, 2008, 4:51:06 AM1/29/08
to us...@groovy.codehaus.org
> From: Thorsten Kamann [mailto:thorste...@googlemail.com]
> Is this right? And if yes why is this changed?

Because it's an obvious bug to be able to call an unary method with no parameters?

Thorsten Kamann

unread,
Jan 29, 2008, 5:35:09 AM1/29/08
to us...@groovy.codehaus.org
Jürgen Hermann schrieb:

>> From: Thorsten Kamann [mailto:thorste...@googlemail.com]
>> Is this right? And if yes why is this changed?
>>
>
> Because it's an obvious bug to be able to call an unary method with no parameters?
>
upps...ok, thanks for your answer... :)

--
Thorsten Kamann
Software-Architect, Consultant, Coaching
Germany, NRW

Fornax-Platform - Platform for developing MDSD-related Tools and components
http://www.fornax-platform.org/

Jochen Theodorou

unread,
Jan 29, 2008, 5:50:58 AM1/29/08
to us...@groovy.codehaus.org
Jürgen Hermann schrieb:

>> From: Thorsten Kamann [mailto:thorste...@googlemail.com]
>> Is this right? And if yes why is this changed?
>
> Because it's an obvious bug to be able to call an unary method with no parameters?

sadly this no bug... at last with an object (for example Boolean) the
method should work.

bye blackdrag

--
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/
http://www.g2one.com/

Reply all
Reply to author
Forward
0 new messages