[
https://issues.apache.org/jira/browse/GROOVY-8245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16074065#comment-16074065
]
ASF GitHub Bot commented on GROOVY-8245:
----------------------------------------
GitHub user jwagenleitner opened a pull request:
https://github.com/apache/groovy/pull/571
GROOVY-8245: @Newify(auto=false) not transforming declarations
Also added default for `value` attribute for
[GROOVY-8242](https://issues.apache.org/jira/browse/GROOVY-8242).
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jwagenleitner/groovy 8245-Newify
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/groovy/pull/571.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 #571
----
commit f2c80cf2403e40b7c7f22eaa778bec35a8c80bee
Author: John Wagenleitner <[email protected]>
Date: 2017-07-04T16:37:04Z
GROOVY-8245: @Newify(auto=false) not transforming declarations
----
> @Newify(auto=false) causing error (in Groovy Web Console)
> ---------------------------------------------------------
>
> Key: GROOVY-8245
> URL: https://issues.apache.org/jira/browse/GROOVY-8245
> Project: Groovy
> Issue Type: Bug
> Reporter: Eric Milles
>
> When I run this with no {{auto=flase}} attribute or with {{auto=true}}, it
> runs successfully (in Groovy Web Console). When I run as below, I get a
> strange error: {code}
> java.lang.ExceptionInInitializerError
> at Script1.run(Script1.groovy:15)
> Caused by: groovy.lang.MissingMethodException: No signature of method: static
> Bar.Foo() is applicable for argument types: () values: []
> Possible solutions: any(), is(java.lang.Object), any(groovy.lang.Closure),
> use([Ljava.lang.Object;), use(java.util.List, groovy.lang.Closure),
> use(java.lang.Class, groovy.lang.Closure)
> at Bar.<clinit>(Script1.groovy:10)
> {code}
> {code}
> class Foo {
> Foo() {
> println 'new foo'
> }
> }
> @Newify(auto=false, value=Foo)
> class Bar {
> static {
> Foo foo = Foo()
> }
> static void method() {}
> }
> ​Bar.method()
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)