[ 
https://issues.apache.org/jira/browse/GROOVY-8242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16115516#comment-16115516
 ] 

ASF GitHub Bot commented on GROOVY-8242:
----------------------------------------

GitHub user jwagenleitner opened a pull request:

    https://github.com/apache/groovy/pull/579

    GROOVY-8242: @Newify default attribute value

    Class values are only required for Python-style conversions so the
    attribute should default to an empty array to indicate it is not
    strictly required.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jwagenleitner/groovy 8242-Newify-value-default

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/groovy/pull/579.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #579
    
----
commit e68a7c7ca60e9c6453565bbb91720dfe6479567c
Author: John Wagenleitner <jwagenleit...@apache.org>
Date:   2017-08-05T18:05:17Z

    GROOVY-8242: @Newify default attribute value
    
    Class values are only required for Python-style conversions so the
    attribute should default to an empty array to indicate it is not
    strictly required.

----


> Javadoc for Newify is missing some attribute values
> ---------------------------------------------------
>
>                 Key: GROOVY-8242
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8242
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Eric Milles
>            Priority: Minor
>
> I was looking at thw Newify AST transform.  Some of the Javadoc appears 
> incorrect since the annotation requires a value.
> {code}
>  * or this ("Ruby-style"):
>  * <pre>
>  * {@code @Newify} class MyTreeProcessor {  --  Is this supposed to be 
> @Newify([Tree,Leaf])?
>  *     def myTree = Tree.new(Tree.new(Leaf.new("A"), Leaf.new("B")), 
> Leaf.new("C"))
>  *     def process() { ... }
>  * }
>  * </pre>
> {code}
> {code}
>  * An example showing how to use the annotation at different levels:
>  * <pre>
>  * {@code @Newify(auto=false, value=Foo)}
>  * class Main {
>  *     {@code @Newify} // turn auto on for field  --  Is this supposed to be 
> @Newify(BigInteger)?
>  *     def field1 = java.math.BigInteger.new(42)
>  *     def field2, field3, field4
>  *
>  *     {@code @Newify(Bar)}
>  *     def process() {
>  *         field2 = Bar("my bar")
>  *     }
>  *
>  *     {@code @Newify(Baz)}
>  *     Main() {
>  *         field3 = Foo("my foo")
>  *         field4 = Baz("my baz")
>  *     }
>  * }
>  * </pre>
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to