You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2022/11/22 21:15:00 UTC
[jira] [Updated] (GROOVY-8219) Add @TupleConstructor(includeFields = true) to a class implements a trait which contains properties will cause NPE
[ https://issues.apache.org/jira/browse/GROOVY-8219?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles updated GROOVY-8219:
--------------------------------
Labels: breaking trait traits (was: trait traits)
> Add @TupleConstructor(includeFields = true) to a class implements a trait which contains properties will cause NPE
> ------------------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-8219
> URL: https://issues.apache.org/jira/browse/GROOVY-8219
> Project: Groovy
> Issue Type: Bug
> Components: xforms
> Affects Versions: 2.4.11
> Environment: Win 8.1, Oracle JDK 8u112
> Reporter: Huabin Zhang
> Assignee: Eric Milles
> Priority: Major
> Labels: breaking, trait, traits
>
> Hi, guys:
> I got NPE when I wrote the following codes:
> {code:java|title=Groovy Script|borderStyle=solid}
> trait T {
> def x = 'abc'
> }
> import groovy.transform.TupleConstructor
> @TupleConstructor(includeFields = true)
> class A implements T {
> def a
> private b
> }
> assert 'ABC' == new A().x.toUpperCase()
> {code}
> I found that it will works well if I remove {{(includefields = true)}}.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)