From notifications-return-15898-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Thu Mar 21 20:35:03 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 9D7B2180789 for ; Thu, 21 Mar 2019 21:35:02 +0100 (CET) Received: (qmail 34987 invoked by uid 500); 21 Mar 2019 20:35:01 -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 34789 invoked by uid 99); 21 Mar 2019 20:35:01 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Mar 2019 20:35:01 +0000 Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id EB224E2604 for ; Thu, 21 Mar 2019 20:35:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 4A817245A1 for ; Thu, 21 Mar 2019 20:35:00 +0000 (UTC) Date: Thu, 21 Mar 2019 20:35:00 +0000 (UTC) From: "Paul King (JIRA)" To: notifications@groovy.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (GROOVY-9051) @groovy.lang.Delegate should generate a constructor annotated with @Generated MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/GROOVY-9051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16798407#comment-16798407 ] Paul King edited comment on GROOVY-9051 at 3/21/19 8:34 PM: ------------------------------------------------------------ This isn't really specific to {{@Delegate}}. {{@Delegate}} doesn't add any constructor itself but relies on the normal default constructor creation which currently doesn't add {{@Generated}}. It looks like {{Verifier#addDefaultConstructor}} doesn't call {{markAsGenerated}}. I'll update the summary. was (Author: paulk): This isn't really specific to {{@Delegate}}. {{@Delegate}} doesn't add any constructor itself but relies on the normal default constructor creation which currently doesn't add {{@Generated}}. It looks like {{Verifier#addDefaultConstructor}} doesn't call {{markAsGenerated}}. > @groovy.lang.Delegate should generate a constructor annotated with @Generated > ------------------------------------------------------------------------------ > > Key: GROOVY-9051 > URL: https://issues.apache.org/jira/browse/GROOVY-9051 > Project: Groovy > Issue Type: Bug > Components: Compiler > Affects Versions: 2.5.6 > Reporter: Jan Wloka > Priority: Major > > Groovy input: > {code:java} > class GroovyDelegateClassTarget { > @groovy.lang.Delegate > Date target > } > {code} > Groovy output: > {code} > public class GroovyDelegateClassTarget implements GroovyObject, Serializable, Cloneable, Comparable { > @Delegate > private Date target; > public GroovyDelegateClassTarget() { > CallSite[] var1 = $getCallSiteArray(); > super(); > MetaClass var2 = this.$getStaticMetaClass(); > this.metaClass = var2; > } > @Generated > public long getTime() { > CallSite[] var1 = $getCallSiteArray(); > return DefaultTypeTransformation.longUnbox(var1[0].call(this.target)); > } > @Generated > public void setTime(long param0) { > CallSite[] var3 = $getCallSiteArray(); > var3[1].call(this.target, param0); > } > @Generated > public boolean before(Date param0) { > CallSite[] var2 = $getCallSiteArray(); > return DefaultTypeTransformation.booleanUnbox(var2[2].call(this.target, param0)); > } > @Generated > public boolean after(Date param0) { > CallSite[] var2 = $getCallSiteArray(); > return DefaultTypeTransformation.booleanUnbox(var2[3].call(this.target, param0)); > } > @Generated > public int compareTo(Date param0) { > CallSite[] var2 = $getCallSiteArray(); > return DefaultTypeTransformation.intUnbox(var2[4].call(this.target, param0)); > } > @Generated > public Instant toInstant() { > CallSite[] var1 = $getCallSiteArray(); > return (Instant)ScriptBytecodeAdapter.castToType(var1[5].call(this.target), Instant.class); > } > @Generated > public Date getTarget() { > return this.target; > } > @Generated > public void setTarget(Date var1) { > this.target = var1; > } > } > {code} > The constructor for this class should be annotated with @Generated > Issue found during Hackergarten Zurich. -- This message was sent by Atlassian JIRA (v7.6.3#76005)