groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-8300) Groovy should have an @AutoFinal annotation
Date Tue, 29 Aug 2017 01:01:00 GMT

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

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

GitHub user paulk-asert opened a pull request:

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

    GROOVY-8300: Initial version sans tests and having no configuration o…

    …ptions

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

    $ git pull https://github.com/paulk-asert/groovy groovy8300

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

    https://github.com/apache/groovy/pull/594.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 #594
    
----
commit fe2e3abcd038d64072bb60929946009012575761
Author: paulk <paulk@asert.com.au>
Date:   2017-08-29T00:57:53Z

    GROOVY-8300: Initial version sans tests and having no configuration options

----


> Groovy should have an @AutoFinal annotation
> -------------------------------------------
>
>                 Key: GROOVY-8300
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8300
>             Project: Groovy
>          Issue Type: New Feature
>            Reporter: Paul King
>
> When defined on a method or constructor, all parameters of that method/constructor will
be final. When applied on a class, the annotation applies to all methods/constructors.
> Discussion points:
> # Should visibility matter, e.g. would it apply to all public, protected, private, etc.
members, or does there need to be some ability to customise? *Current thinking*: it should
apply to all methods. We can always introduce an additional annotation attribute at a later
point if there is demand.
> # Should there be support for 'includes' or 'excludes' functionality? *Current thinking*:
don't support this for now. The annotation can be applied on multiple methods/constructors
if finer granularity than the class level is required.
> # Should the annotation apply to fields/properties? Applying 'final' to a field/property
seems to be more efficient than applying @AutoFinal but would there ever be a desire to apply
such an annotation to all fields/properties? *Current thinking*: don't support this for now.
An annotation attribute could be added later if we wanted to optionally turn such extra cases
on.
> # Should it apply to synthetic methods/constructors added by the compiler/other transforms?
> # What phase should this run at? It needs to be before the (incubating) final variable
analyser is run.
> # We should have tests to confirm that there are no adverse interactions with other language
features, e.g. default parameter values.



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

Mime
View raw message