groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Wagenleitner (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-8242) Javadoc for Newify is missing some attribute values
Date Tue, 04 Jul 2017 16:27:00 GMT

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

John Wagenleitner commented on GROOVY-8242:
-------------------------------------------

Based on the docs and tests, I believe it's clear that the intent of {{Newify}} is to allow
the annotation without providing class values.  Assuming that's true then this issue should
be about providing a default for that attribute in order to avoid warnings.

> 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)

Mime
View raw message