Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 75B4D200B8E for ; Mon, 12 Sep 2016 00:11:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7438B160AD4; Sun, 11 Sep 2016 22:11:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BA598160AC7 for ; Mon, 12 Sep 2016 00:11:21 +0200 (CEST) Received: (qmail 85296 invoked by uid 500); 11 Sep 2016 22:11:20 -0000 Mailing-List: contact notifications-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list notifications@groovy.apache.org Received: (qmail 85287 invoked by uid 99); 11 Sep 2016 22:11:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 Sep 2016 22:11:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 88F672C014F for ; Sun, 11 Sep 2016 22:11:20 +0000 (UTC) Date: Sun, 11 Sep 2016 22:11:20 +0000 (UTC) From: "Paul King (JIRA)" To: notifications@groovy.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (GROOVY-7926) Method that returns void in a Trait with generics produces questionable byte code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sun, 11 Sep 2016 22:11:22 -0000 [ https://issues.apache.org/jira/browse/GROOVY-7926?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paul King reassigned GROOVY-7926: --------------------------------- Assignee: Paul King > Method that returns void in a Trait with generics produces questionable byte code > --------------------------------------------------------------------------------- > > Key: GROOVY-7926 > URL: https://issues.apache.org/jira/browse/GROOVY-7926 > Project: Groovy > Issue Type: Bug > Affects Versions: 2.4.7 > Reporter: Graeme Rocher > Assignee: Paul King > > Given the following trait: > {code} > trait MyTrait { > void delete() { > // no-op > } > } > class MyImpl implements MyTrait { > } > {code} > The delete method produces byte code that when decompiled looks like: > {code} > public void delete() { > CallSite[] var1 = $getCallSiteArray(); > void var10000 = (void)var1[1].call(Helper.class, this); > } > {code} > As you can see "void" is used as a type of a variable. This results in the following exception on the IBM JVM (it works fine in Oracle and OpenJDK): > {code} > Caused by: java.lang.NoClassDefFoundError: void > at it.dedagroup.Test.delete(Test.groovy) > at org.grails.datastore.gorm.GormEntity$delete$0.call(Unknown Source) > at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) > {code} > Since the issue occurs only in IBM JVM it could be argued that this is a problem with that JVM, however the byte code produced does seem suspicious to me as "void" cannot be used as a type of a local variable. Thoughts? -- This message was sent by Atlassian JIRA (v6.3.4#6332)