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 92E4F200D1B for ; Thu, 12 Oct 2017 16:55:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 91A321609CD; Thu, 12 Oct 2017 14:55:07 +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 D73061609E8 for ; Thu, 12 Oct 2017 16:55:06 +0200 (CEST) Received: (qmail 97817 invoked by uid 500); 12 Oct 2017 14:55:06 -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 97808 invoked by uid 99); 12 Oct 2017 14:55:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Oct 2017 14:55:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 2D106183286 for ; Thu, 12 Oct 2017 14:55:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id zpEYODPK6tT3 for ; Thu, 12 Oct 2017 14:55:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 841775F239 for ; Thu, 12 Oct 2017 14:55:02 +0000 (UTC) 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 79314E0AA3 for ; Thu, 12 Oct 2017 14:55:01 +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 AE4CF23F8F for ; Thu, 12 Oct 2017 14:55:00 +0000 (UTC) Date: Thu, 12 Oct 2017 14:55:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: notifications@groovy.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (GROOVY-8352) Add a @Generated annotation to mark generated members MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 12 Oct 2017 14:55:07 -0000 [ https://issues.apache.org/jira/browse/GROOVY-8352?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D162= 02057#comment-16202057 ]=20 ASF GitHub Bot commented on GROOVY-8352: ---------------------------------------- Github user aalmiray commented on a diff in the pull request: https://github.com/apache/groovy/pull/617#discussion_r144314040 =20 --- Diff: src/main/org/codehaus/groovy/classgen/Verifier.java --- @@ -384,6 +387,7 @@ public void visit(MethodVisitor mv) { protected void addGroovyObjectInterfaceAndMethods(ClassNode node, = final String classInternalName) { if (!node.isDerivedFromGroovyObject()) node.addInterface(Class= Helper.make(GroovyObject.class)); FieldNode metaClassField =3D getMetaClassField(node); + AnnotationNode generatedAnnotation =3D new AnnotationNode(Clas= sHelper.make(GENERATED_ANNOTATION)); =20 --- End diff -- =20 2 small fixes added =F0=9F=98=84=20 > Add a @Generated annotation to mark generated members > ----------------------------------------------------- > > Key: GROOVY-8352 > URL: https://issues.apache.org/jira/browse/GROOVY-8352 > Project: Groovy > Issue Type: New Feature > Components: class generator > Affects Versions: 2.6.0-alpha-1 > Reporter: Andres Almiray > > Rationale: > Tooling support for Groovy may benefit from having additional information= on generated members. We already provide some information by marking certa= in generated methods as synthetic, however tools such as IDEs hide these me= thods. The goal of `@Generated` is to mark members that are still visible t= o IDEs and other tools. > Example: > The JaCoCo and Lombok projects have agreed on an annotation named `@lombo= k.Generated`. This annotation serves as a hint to JaCoCo in order to skip c= overage on the annotated elements; this helps JaCoCo in reporting more accu= rate coverage numbers for source code. > What would be needed: > An annotation in the groovy space named `@Generated` that can be used by = JaCoCo (or any other tool). We can't use `@javax.annotation.Generated` beca= use its retention policy is `SOURCE` and we need `CLASS` at the very least. > Modify the Verifier to mark the 5 default GroovyObject methods with this = annotation when the inspected class does not provide an implementation for = any of these methods. > Additionally, any AST transformation that creates additional methods/type= s/fields that should be marked can make use of the new annotation. > The work required for JaCoCo has already been started and is tracked by h= ttps://github.com/jacoco/jacoco/pull/610 -- This message was sent by Atlassian JIRA (v6.4.14#64029)