You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2019/11/24 02:46:01 UTC
[jira] [Closed] (GROOVY-8442) java.lang.VerifyError: Bad
method call from inside of a branch
[ https://issues.apache.org/jira/browse/GROOVY-8442?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King closed GROOVY-8442.
-----------------------------
> java.lang.VerifyError: Bad <init> method call from inside of a branch
> ---------------------------------------------------------------------
>
> Key: GROOVY-8442
> URL: https://issues.apache.org/jira/browse/GROOVY-8442
> Project: Groovy
> Issue Type: Bug
> Components: Compiler
> Affects Versions: 2.4.9
> Reporter: Peter Szanto
> Assignee: Eric Milles
> Priority: Major
> Fix For: 2.5.8, 3.0.0-rc-1
>
>
> given this base class
> {code}
> abstract class AnimalBuilder {
> def animal;
> AnimalBuilder(def animal) {
> this.animal = animal
> }
> }
> {code}
> This subclass works as expected
> {code}
> class CatBuilder extends AnimalBuilder {
> CatBuilder() {
> super(new Cat());
> }
> }
> {code}
> but this
> {code}
> class CatBuilder2 extends AnimalBuilder {
> CatBuilder2() {
> super(createCat());
> }
> private Cat createCat() {
> new Cat()
> }
> }
> {code}
> Will result an
> {code}
> java.lang.VerifyError: Bad <init> method call from inside of a branch
> Exception Details:
> Location:
> org/example/builder/CatBuilder2.<init>()V @25: invokespecial
> Reason:
> Error exists in the bytecode
> {code}
> The full example can be seen here https://github.com/szantopeter/groovy-compile-failure2
--
This message was sent by Atlassian Jira
(v8.3.4#803005)