Issue 405 in groovypptest: NoSuchMethodError for type bound generic method

10 views
Skip to first unread message

groovy...@googlecode.com

unread,
Dec 19, 2011, 3:17:19 PM12/19/11
to groovyp...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 405 by mendapar...@gmail.com: NoSuchMethodError for type bound
generic method
http://code.google.com/p/groovypptest/issues/detail?id=405

If had a type bound generic method defined in pure Java class then @Typed
groovy fails at runtime with NoSuchMethodError.

Here is an example:
---------------------------
public class Hello {
...
}
---------------------------
public class HelloTools {

public static <T extends Hello> T say(T hello) {

...
}
}
---------------------------

Then following groovy code fails at runtime:

---------------------------
class HelloTest {


@Test
void test1() {
def hello = new Hello()
HelloTools.say(hell)
}

@Typed
@Test
void test2() {
def hello = new Hello()
HelloTools.say(hell)
}
}
---------------------------

The second test will fail with the NoSuchMethodError

I am using the latest release of Groovy++ with Groovy 1.8.2

groovy...@googlecode.com

unread,
Dec 19, 2011, 3:21:21 PM12/19/11
to groovyp...@googlegroups.com

Comment #1 on issue 405 by mendapar...@gmail.com: NoSuchMethodError for

Here I am attaching a test project.

Attachments:
hello-groovy.tar.gz 1.4 KB

groovy...@googlecode.com

unread,
Dec 19, 2011, 3:38:36 PM12/19/11
to groovyp...@googlegroups.com

Comment #2 on issue 405 by mendapar...@gmail.com: NoSuchMethodError for

You can also test with getAnnotation method defined in Class. The signature
of this method is:

public <A extends Annotation> A getAnnotation(Class<A> annotationClass)

groovy...@googlecode.com

unread,
Dec 29, 2011, 7:07:52 AM12/29/11
to groovyp...@googlegroups.com

Comment #3 on issue 405 by sit1...@gmail.com: NoSuchMethodError for type

Look at the project activity @mendapar

After Groovy/Spring announced they are working on their own static Groovy
(completely undermining g++ in the process), g++ activity stopped.

Really unfortunate, g++ had nice momentum and provided strong typing +
speed with Groovy concision. Oh well, big companies tend to ruin the open
source party.

I believe g++ project lead is working on JetBrains' Kotlin project.

Anyway, would be nice if there were some confirmation as to what is going
on (or not) with g++ project.

Reply all
Reply to author
Forward
0 new messages