[
https://issues.apache.org/jira/browse/GROOVY-6809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15453871#comment-15453871
]
Will Erickson edited comment on GROOVY-6809 at 9/1/16 12:38 AM:
----------------------------------------------------------------
I get the same error with the below code snippet:
{code:java}
import java.util.concurrent.ThreadFactory
class A {
public A() {
this(new ThreadFactory() {
@Override
public Thread newThread(final Runnable runnable) {
return null
}
})
}
private A(final ThreadFactory factory) {
}
}
final foo = new A()
{code}
{code}
Caught: java.lang.VerifyError: (class: A, method: <init> signature: ()V)
Expecting to find object/array on stack
java.lang.VerifyError: (class: A, method: <init> signature: ()V) Expecting to
find object/array on stack
at foo.run(foo.groovy:18)
{code}
was (Author: werickson):
I get the same error with the below code snippet:
{code:java}
import java.util.concurrent.ThreadFactory
class A {
public A() {
this(new ThreadFactory() {
@Override
public Thread newThread(final Runnable runnable) {
return null
}
})
}
private A(final ThreadFactory factory) {
}
}
final foo = new A()
{code}
> VerifyError With Inner Class
> -----------------------------
>
> Key: GROOVY-6809
> URL: https://issues.apache.org/jira/browse/GROOVY-6809
> Project: Groovy
> Issue Type: Bug
> Components: Compiler
> Affects Versions: 2.3.0, 2.4.0-beta-3
> Reporter: Jeff Brown
>
> The following code compiles but throws a VerifyError at runtime:
> {code:title=Test.groovy|borderStyle=solid}
> class Test {
> static void main(String[] args) {
> def a = new A()
> }
> static class A {
> A() {
> def b = new B()
> }
> void sayA() { println 'saying A' }
> class B extends A {
> public B() {
> super(A.this)
> sayA()
> }
> }
> }
> }
> {code}
> I didn't go back through versions but I tested with 2.3.0 and that shows the
> problem.
> {noformat}
> Caught: java.lang.VerifyError: (class: Test$A$B, method: <init> signature:
> (LTest$A;)V) Expecting to find object/array on stack
> java.lang.VerifyError: (class: Test$A$B, method: <init> signature:
> (LTest$A;)V) Expecting to find object/array on stack
> at Test$A.<init>(Test.groovy:9)
> at Test.main(Test.groovy:4)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)