[jira] [Resolved] (GROOVY-8281) Final field is null in trait, but it has assigned value
[ https://issues.apache.org/jira/browse/GROOVY-8281?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paul King resolved GROOVY-8281. --- Resolution: Fixed Assignee: Paul King Fix Version/s: 2.5.1 Proposed PR merged. > Final field is null in trait, but it has assigned value > --- > > Key: GROOVY-8281 > URL: https://issues.apache.org/jira/browse/GROOVY-8281 > Project: Groovy > Issue Type: Bug >Affects Versions: 2.4.8, 2.4.9, 2.4.10, 2.4.11, 2.4.12 >Reporter: Dominik Przybysz >Assignee: Paul King >Priority: Major > Fix For: 2.5.1 > > > I have a code like this: > {code} > trait MyTrait { > final String myValue = "test" > final Wrapper wrapper = new Wrapper(myValue) > } > class Wrapper { > Wrapper(String value){ > if(value == null) { > throw new Exception("Value is null!!!") > } > println "OK: $value" > } > } > class Main implements MyTrait {} > new Main() > {code} > Everything works as expected with groovy 2.4.7: > {code} > $ sdk u groovy 2.4.7 > Using groovy version 2.4.7 in this shell. > $ groovy bug.groovy > OK: test > {code} > but newer versions of groovy do not compile this code (2.4.8, 2.4.9, 2.4.10) > or have null to value (2.4.11, 2.4.12): > {code} > $ sdk u groovy 2.4.8 > Using groovy version 2.4.8 in this shell. > $ groovy bug.groovy > org.codehaus.groovy.control.MultipleCompilationErrorsException: startup > failed: > ~/bug.groovy: 3: Apparent variable 'myValue' was found in a static scope but > doesn't refer to a local variable, static field or class. Possible causes: > You attempted to reference a variable in the binding or an instance variable > from a static context. > You misspelled a classname or statically imported field. Please check the > spelling. > You attempted to use a method 'myValue' but left out brackets in a place not > allowed by the grammar. > @ line 3, column 38. > final Wrapper wrapper = new Wrapper(myValue) > ^ > 1 error > $ sdk u groovy 2.4.9 > Using groovy version 2.4.9 in this shell. > $ groovy bug.groovy > org.codehaus.groovy.control.MultipleCompilationErrorsException: startup > failed: > ~/bug.groovy: 3: Apparent variable 'myValue' was found in a static scope but > doesn't refer to a local variable, static field or class. Possible causes: > You attempted to reference a variable in the binding or an instance variable > from a static context. > You misspelled a classname or statically imported field. Please check the > spelling. > You attempted to use a method 'myValue' but left out brackets in a place not > allowed by the grammar. > @ line 3, column 38. > final Wrapper wrapper = new Wrapper(myValue) > ^ > ~/bug.groovy: 3: Apparent variable 'myValue' was found in a static scope but > doesn't refer to a local variable, static field or class. Possible causes: > You attempted to reference a variable in the binding or an instance variable > from a static context. > You misspelled a classname or statically imported field. Please check the > spelling. > You attempted to use a method 'myValue' but left out brackets in a place not > allowed by the grammar. > @ line 3, column 38. > final Wrapper wrapper = new Wrapper(myValue) > ^ > 2 errors > $ sdk u groovy 2.4.10 > Using groovy version 2.4.10 in this shell. > $ groovy bug.groovy > org.codehaus.groovy.control.MultipleCompilationErrorsException: startup > failed: > ~/bug.groovy: 3: Apparent variable 'myValue' was found in a static scope but > doesn't refer to a local variable, static field or class. Possible causes: > You attempted to reference a variable in the binding or an instance variable > from a static context. > You misspelled a classname or statically imported field. Please check the > spelling. > You attempted to use a method 'myValue' but left out brackets in a place not > allowed by the grammar. > @ line 3, column 38. > final Wrapper wrapper = new Wrapper(myValue) > ^ > ~/bug.groovy: 3: Apparent variable 'myValue' was found in a static scope but > doesn't refer to a local variable, static field or class. Possible causes: > You attempted to reference a variable in the binding or an instance variable > from a static context. > You misspelled a classname or statically imported field. Please check the > spelling. > You attempted to use a method 'myValue' but left out brackets in a place not > allowed by the grammar. > @ line 3, column 38. > final Wrapper wrapper = new Wrapper(myValue) > ^ > 2 errors > $ sdk u groovy 2.4.11 > Using groovy version 2.4.1
[jira] [Commented] (GROOVY-8281) Final field is null in trait, but it has assigned value
[ https://issues.apache.org/jira/browse/GROOVY-8281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16538503#comment-16538503 ] ASF GitHub Bot commented on GROOVY-8281: Github user asfgit closed the pull request at: https://github.com/apache/groovy/pull/772 > Final field is null in trait, but it has assigned value > --- > > Key: GROOVY-8281 > URL: https://issues.apache.org/jira/browse/GROOVY-8281 > Project: Groovy > Issue Type: Bug >Affects Versions: 2.4.8, 2.4.9, 2.4.10, 2.4.11, 2.4.12 >Reporter: Dominik Przybysz >Priority: Major > > I have a code like this: > {code} > trait MyTrait { > final String myValue = "test" > final Wrapper wrapper = new Wrapper(myValue) > } > class Wrapper { > Wrapper(String value){ > if(value == null) { > throw new Exception("Value is null!!!") > } > println "OK: $value" > } > } > class Main implements MyTrait {} > new Main() > {code} > Everything works as expected with groovy 2.4.7: > {code} > $ sdk u groovy 2.4.7 > Using groovy version 2.4.7 in this shell. > $ groovy bug.groovy > OK: test > {code} > but newer versions of groovy do not compile this code (2.4.8, 2.4.9, 2.4.10) > or have null to value (2.4.11, 2.4.12): > {code} > $ sdk u groovy 2.4.8 > Using groovy version 2.4.8 in this shell. > $ groovy bug.groovy > org.codehaus.groovy.control.MultipleCompilationErrorsException: startup > failed: > ~/bug.groovy: 3: Apparent variable 'myValue' was found in a static scope but > doesn't refer to a local variable, static field or class. Possible causes: > You attempted to reference a variable in the binding or an instance variable > from a static context. > You misspelled a classname or statically imported field. Please check the > spelling. > You attempted to use a method 'myValue' but left out brackets in a place not > allowed by the grammar. > @ line 3, column 38. > final Wrapper wrapper = new Wrapper(myValue) > ^ > 1 error > $ sdk u groovy 2.4.9 > Using groovy version 2.4.9 in this shell. > $ groovy bug.groovy > org.codehaus.groovy.control.MultipleCompilationErrorsException: startup > failed: > ~/bug.groovy: 3: Apparent variable 'myValue' was found in a static scope but > doesn't refer to a local variable, static field or class. Possible causes: > You attempted to reference a variable in the binding or an instance variable > from a static context. > You misspelled a classname or statically imported field. Please check the > spelling. > You attempted to use a method 'myValue' but left out brackets in a place not > allowed by the grammar. > @ line 3, column 38. > final Wrapper wrapper = new Wrapper(myValue) > ^ > ~/bug.groovy: 3: Apparent variable 'myValue' was found in a static scope but > doesn't refer to a local variable, static field or class. Possible causes: > You attempted to reference a variable in the binding or an instance variable > from a static context. > You misspelled a classname or statically imported field. Please check the > spelling. > You attempted to use a method 'myValue' but left out brackets in a place not > allowed by the grammar. > @ line 3, column 38. > final Wrapper wrapper = new Wrapper(myValue) > ^ > 2 errors > $ sdk u groovy 2.4.10 > Using groovy version 2.4.10 in this shell. > $ groovy bug.groovy > org.codehaus.groovy.control.MultipleCompilationErrorsException: startup > failed: > ~/bug.groovy: 3: Apparent variable 'myValue' was found in a static scope but > doesn't refer to a local variable, static field or class. Possible causes: > You attempted to reference a variable in the binding or an instance variable > from a static context. > You misspelled a classname or statically imported field. Please check the > spelling. > You attempted to use a method 'myValue' but left out brackets in a place not > allowed by the grammar. > @ line 3, column 38. > final Wrapper wrapper = new Wrapper(myValue) > ^ > ~/bug.groovy: 3: Apparent variable 'myValue' was found in a static scope but > doesn't refer to a local variable, static field or class. Possible causes: > You attempted to reference a variable in the binding or an instance variable > from a static context. > You misspelled a classname or statically imported field. Please check the > spelling. > You attempted to use a method 'myValue' but left out brackets in a place not > allowed by the grammar. > @ line 3, column 38. > final Wrapper wrapper = new Wrapper(myValue) > ^ > 2 errors > $ sdk u groovy 2.4.11 > Using groovy version 2.4.11 i
[GitHub] groovy pull request #772: GROOVY-8281: Final field is null in trait, but it ...
Github user asfgit closed the pull request at: https://github.com/apache/groovy/pull/772 ---
[jira] [Resolved] (GROOVY-8690) Bump picocli version to 3.2.0 from 3.1.0
[ https://issues.apache.org/jira/browse/GROOVY-8690?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paul King resolved GROOVY-8690. --- Resolution: Fixed > Bump picocli version to 3.2.0 from 3.1.0 > > > Key: GROOVY-8690 > URL: https://issues.apache.org/jira/browse/GROOVY-8690 > Project: Groovy > Issue Type: Dependency upgrade > Components: command line processing >Affects Versions: 2.5.0 >Reporter: Remko Popma >Assignee: Remko Popma >Priority: Major > Fix For: 2.5.1 > > > Many improvements. For Groovy users, perhaps most interesting is better > support for completion candidates (both bash completion scripts and JLine > interactive applications). > The description for options and positional parameters can contain variables > that expand to the default value or completion candidates. > For more details, see https://github.com/remkop/picocli/releases/tag/v3.2.0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Assigned] (GROOVY-8690) Bump picocli version to 3.2.0 from 3.1.0
[ https://issues.apache.org/jira/browse/GROOVY-8690?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paul King reassigned GROOVY-8690: - Assignee: Remko Popma > Bump picocli version to 3.2.0 from 3.1.0 > > > Key: GROOVY-8690 > URL: https://issues.apache.org/jira/browse/GROOVY-8690 > Project: Groovy > Issue Type: Dependency upgrade > Components: command line processing >Affects Versions: 2.5.0 >Reporter: Remko Popma >Assignee: Remko Popma >Priority: Major > Fix For: 2.5.1 > > > Many improvements. For Groovy users, perhaps most interesting is better > support for completion candidates (both bash completion scripts and JLine > interactive applications). > The description for options and positional parameters can contain variables > that expand to the default value or completion candidates. > For more details, see https://github.com/remkop/picocli/releases/tag/v3.2.0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Resolved] (GROOVY-8233) Java stub generation incorrect for static properties of traits
[ https://issues.apache.org/jira/browse/GROOVY-8233?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paul King resolved GROOVY-8233. --- Resolution: Fixed Assignee: Paul King Fix Version/s: 2.5.1 Proposed PR merged. > Java stub generation incorrect for static properties of traits > -- > > Key: GROOVY-8233 > URL: https://issues.apache.org/jira/browse/GROOVY-8233 > Project: Groovy > Issue Type: Bug > Components: Stub generator / Joint compiler >Affects Versions: 2.4.11 >Reporter: Graeme Rocher >Assignee: Paul King >Priority: Major > Fix For: 2.5.1 > > Attachments: domain-plugins.zip > > > Groovy generates incorrect stubs for static properties of traits resulting in > compilation errors such as: > {code} > /Users/graemerocher/grails/apps/domain-plugins/app/build/tmp/compileGroovy/groovy-java-stubs/bug/DomainA.java:10: > error: > org_grails_datastore_mapping_dirty_checking_DirtyCheckable__DIRTY_CLASS_MARKER$get() > in DomainParent cannot implement > org_grails_datastore_mapping_dirty_checking_DirtyCheckable__DIRTY_CLASS_MARKER$get() > in DirtyCheckable$Trait$FieldHelper > public class DomainA >^ > overriding method is static > 1 error > startup failed: > Compilation failed; see the compiler error output for details. > 1 error > {code} > Attached is an example. Simply run `./gradlew compileGroovy` -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (GROOVY-8233) Java stub generation incorrect for static properties of traits
[ https://issues.apache.org/jira/browse/GROOVY-8233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16538469#comment-16538469 ] ASF GitHub Bot commented on GROOVY-8233: Github user paulk-asert closed the pull request at: https://github.com/apache/groovy/pull/767 > Java stub generation incorrect for static properties of traits > -- > > Key: GROOVY-8233 > URL: https://issues.apache.org/jira/browse/GROOVY-8233 > Project: Groovy > Issue Type: Bug > Components: Stub generator / Joint compiler >Affects Versions: 2.4.11 >Reporter: Graeme Rocher >Priority: Major > Attachments: domain-plugins.zip > > > Groovy generates incorrect stubs for static properties of traits resulting in > compilation errors such as: > {code} > /Users/graemerocher/grails/apps/domain-plugins/app/build/tmp/compileGroovy/groovy-java-stubs/bug/DomainA.java:10: > error: > org_grails_datastore_mapping_dirty_checking_DirtyCheckable__DIRTY_CLASS_MARKER$get() > in DomainParent cannot implement > org_grails_datastore_mapping_dirty_checking_DirtyCheckable__DIRTY_CLASS_MARKER$get() > in DirtyCheckable$Trait$FieldHelper > public class DomainA >^ > overriding method is static > 1 error > startup failed: > Compilation failed; see the compiler error output for details. > 1 error > {code} > Attached is an example. Simply run `./gradlew compileGroovy` -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[GitHub] groovy pull request #767: GROOVY-8233: Java stub generation incorrect for st...
Github user paulk-asert closed the pull request at: https://github.com/apache/groovy/pull/767 ---
[jira] [Commented] (GROOVY-8281) Final field is null in trait, but it has assigned value
[ https://issues.apache.org/jira/browse/GROOVY-8281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16538466#comment-16538466 ] ASF GitHub Bot commented on GROOVY-8281: GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/772 GROOVY-8281: Final field is null in trait, but it has assigned value You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8281 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/772.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 #772 commit be7834c73ff967372f7714bad3ec1c5b662d1456 Author: Paul King Date: 2018-07-10T11:51:57Z GROOVY-8281: Final field is null in trait, but it has assigned value > Final field is null in trait, but it has assigned value > --- > > Key: GROOVY-8281 > URL: https://issues.apache.org/jira/browse/GROOVY-8281 > Project: Groovy > Issue Type: Bug >Affects Versions: 2.4.8, 2.4.9, 2.4.10, 2.4.11, 2.4.12 >Reporter: Dominik Przybysz >Priority: Major > > I have a code like this: > {code} > trait MyTrait { > final String myValue = "test" > final Wrapper wrapper = new Wrapper(myValue) > } > class Wrapper { > Wrapper(String value){ > if(value == null) { > throw new Exception("Value is null!!!") > } > println "OK: $value" > } > } > class Main implements MyTrait {} > new Main() > {code} > Everything works as expected with groovy 2.4.7: > {code} > $ sdk u groovy 2.4.7 > Using groovy version 2.4.7 in this shell. > $ groovy bug.groovy > OK: test > {code} > but newer versions of groovy do not compile this code (2.4.8, 2.4.9, 2.4.10) > or have null to value (2.4.11, 2.4.12): > {code} > $ sdk u groovy 2.4.8 > Using groovy version 2.4.8 in this shell. > $ groovy bug.groovy > org.codehaus.groovy.control.MultipleCompilationErrorsException: startup > failed: > ~/bug.groovy: 3: Apparent variable 'myValue' was found in a static scope but > doesn't refer to a local variable, static field or class. Possible causes: > You attempted to reference a variable in the binding or an instance variable > from a static context. > You misspelled a classname or statically imported field. Please check the > spelling. > You attempted to use a method 'myValue' but left out brackets in a place not > allowed by the grammar. > @ line 3, column 38. > final Wrapper wrapper = new Wrapper(myValue) > ^ > 1 error > $ sdk u groovy 2.4.9 > Using groovy version 2.4.9 in this shell. > $ groovy bug.groovy > org.codehaus.groovy.control.MultipleCompilationErrorsException: startup > failed: > ~/bug.groovy: 3: Apparent variable 'myValue' was found in a static scope but > doesn't refer to a local variable, static field or class. Possible causes: > You attempted to reference a variable in the binding or an instance variable > from a static context. > You misspelled a classname or statically imported field. Please check the > spelling. > You attempted to use a method 'myValue' but left out brackets in a place not > allowed by the grammar. > @ line 3, column 38. > final Wrapper wrapper = new Wrapper(myValue) > ^ > ~/bug.groovy: 3: Apparent variable 'myValue' was found in a static scope but > doesn't refer to a local variable, static field or class. Possible causes: > You attempted to reference a variable in the binding or an instance variable > from a static context. > You misspelled a classname or statically imported field. Please check the > spelling. > You attempted to use a method 'myValue' but left out brackets in a place not > allowed by the grammar. > @ line 3, column 38. > final Wrapper wrapper = new Wrapper(myValue) > ^ > 2 errors > $ sdk u groovy 2.4.10 > Using groovy version 2.4.10 in this shell. > $ groovy bug.groovy > org.codehaus.groovy.control.MultipleCompilationErrorsException: startup > failed: > ~/bug.groovy: 3: Apparent variable 'myValue' was found in a static scope but > doesn't refer to a local variable, static field or class. Possible causes: > You attempted to reference a variable in the binding or an instance variable > from a static context. > You misspelled a classname or statically imported field. Please check the > spelling. > You attempted to use a method 'myValue' but left out brackets in a place not > allowed by the grammar. > @ line 3, column 38. > final Wrapper wrapper = new Wrapper(myValue) >
[GitHub] groovy pull request #772: GROOVY-8281: Final field is null in trait, but it ...
GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/772 GROOVY-8281: Final field is null in trait, but it has assigned value You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8281 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/772.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 #772 commit be7834c73ff967372f7714bad3ec1c5b662d1456 Author: Paul King Date: 2018-07-10T11:51:57Z GROOVY-8281: Final field is null in trait, but it has assigned value ---