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 6AED6200C3C for ; Mon, 3 Apr 2017 09:56:47 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 69050160B8F; Mon, 3 Apr 2017 07:56:47 +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 B1D79160B76 for ; Mon, 3 Apr 2017 09:56:46 +0200 (CEST) Received: (qmail 45927 invoked by uid 500); 3 Apr 2017 07:56:45 -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 45915 invoked by uid 99); 3 Apr 2017 07:56:45 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Apr 2017 07:56:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 5950A1A7A38 for ; Mon, 3 Apr 2017 07:56:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-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 (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id bHKltbBmi6nL for ; Mon, 3 Apr 2017 07:56:44 +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 E278D5F397 for ; Mon, 3 Apr 2017 07:56:43 +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 254C9E036E for ; Mon, 3 Apr 2017 07:56:43 +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 62E5C24017 for ; Mon, 3 Apr 2017 07:56:42 +0000 (UTC) Date: Mon, 3 Apr 2017 07:56:42 +0000 (UTC) From: "Paul King (JIRA)" To: notifications@groovy.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (GROOVY-7087) @TupleConstructor and @Builder should be able to use defined setters rather than the field directly MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 03 Apr 2017 07:56:47 -0000 [ https://issues.apache.org/jira/browse/GROOVY-7087?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paul King updated GROOVY-7087: ------------------------------ Summary: @TupleConstructor and @Builder should be able to use defined setters rather than the field directly (was: @TupleConstructor and @Builder should use defined setters rather than the field directly) > @TupleConstructor and @Builder should be able to use defined setters rather than the field directly > --------------------------------------------------------------------------------------------------- > > Key: GROOVY-7087 > URL: https://issues.apache.org/jira/browse/GROOVY-7087 > Project: Groovy > Issue Type: Bug > Components: xforms > Affects Versions: 2.3.6 > Reporter: Pavel > Assignee: Paul King > Fix For: 2.5.0-alpha-1 > > > {code} > import groovy.transform.TupleConstructor > import groovy.transform.ToString > import groovy.transform.InheritConstructors > import groovy.transform.builder.Builder > import groovy.transform.builder.SimpleStrategy > @Builder(builderStrategy=SimpleStrategy, prefix='with') > @TupleConstructor > @ToString > class Person{ > String name; > void setName(String n){ > println "Called setName(n=$n)" > name = n; > } > } > println Person.constructors > println ( [ new Person(name: 'Map style'), new Person('@TupleConsructor'), new Person().with{ name = 'With style'; it }, new Person().withName('@Builder') ] ) > {code} > In output we get: > {noformat} > Called setName(n=Map style) > Called setName(n=With style) > [Person(Map style), Person(@TupleConsructor), Person(With style), Person(@Builder)] > {noformat} > So, all forms of new object instatiation like Map-style, With block became different with new methods, defined by AST transformations. -- This message was sent by Atlassian JIRA (v6.3.15#6346)