groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Huabin Zhang (JIRA)" <j...@apache.org>
Subject [jira] [Created] (GROOVY-8219) Add @TupleConstructor(includeFields = true) to a class implements a trait which contains fields will cause NPE
Date Tue, 06 Jun 2017 11:28:18 GMT
Huabin Zhang created GROOVY-8219:
------------------------------------

             Summary: Add @TupleConstructor(includeFields = true) to a class implements a
trait which contains fields 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


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
(v6.3.15#6346)

Mime
View raw message