[jira] [Comment Edited] (GROOVY-8880) Traits - static/instance init blocks

2018-11-18 Thread Anton Pryamostanov (JIRA)


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

Anton Pryamostanov edited comment on GROOVY-8880 at 11/18/18 10:15 AM:
---

hi [~paulk], yes - using "Clean" Maven task. Tried many times yesterday; works 
like charm in 2.5.5.SNAPSHOT but did not work in 3.0.0.

Also I validated that commit changes were in the project files used in my build.

There were some other issues with the build yesterday (related to Asciidoc 
plugin) and they are resolved now.

I will try again and will investigate more on what was happenning and post 
update here by today evening. Now going away from city.

 

I use "Dist" task for building and then I use Binary distribution (modifying 
GROOVY_HOME in its start_groovy.bat to be of the current directory with this 
latest build).


was (Author: anton.pryamostanov):
hi [~paulk], yes - using "Clean" Maven task. Tried many times yesterday; works 
like charm in 2.5.5.SNAPSHOT but did not work in 3.0.0.

Also I validated that commit changes were in the project files used in my build.

There were some other issues with the build yesterday (related to Asciidoc 
plugin) and they are resolved now.

I will try again and will investigate more on what was happenning and post 
update here by today evening. Now going away from city.

> Traits - static/instance init blocks
> 
>
> Key: GROOVY-8880
> URL: https://issues.apache.org/jira/browse/GROOVY-8880
> Project: Groovy
>  Issue Type: Improvement
>  Components: Compiler, groovy-runtime
>Affects Versions: 2.5.2
>Reporter: Anton Pryamostanov
>Assignee: Paul King
>Priority: Major
> Fix For: 3.0.0-alpha-4, 2.5.5
>
>
> Let's consider the below examples of Traits with Init blocks:
>  *Instance init block:*
> {code}
> trait InstanceTrait {
> {
> System.out.println("Instance init")
> }
> }
> class InstanceTraitClass implements InstanceTrait {
> }
> new InstanceTraitClass()
> {code}
> This gives the below compilation exception:
> {code:java}
> General error during class generation: NPE while processing 
> script1542098577743.groovy
> groovy.lang.GroovyRuntimeException: NPE while processing 
> script1542098577743.groovy
> at 
> org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:2
> at 
> org.codehaus.groovy.control.CompilationUnit$17.call(CompilationUnit.java:8
> at 
> org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:10
> at 
> org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:6
> at 
> org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:5
> at 
> org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:5
> at org.codehaus.groovy.control.CompilationUnit$compile$1.call(Unknown Sour
> at 
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:
> at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:1
> at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:1
> at 
> groovy.inspect.swingui.AstNodeToScriptAdapter.compileToScript(AstNodeToScriptAdapter.groovy:
> at 
> groovy.inspect.swingui.AstNodeToScriptAdapter$compileToScript.call(Unknown 
> Sour
> at 
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:
> at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:1
> at 
> groovy.inspect.swingui.AstBrowser$_decompile_closure6.doCall(AstBrowser.groovy:3
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Meth
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
> at java.lang.reflect.Method.invoke(Method.java:4
> at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:
> at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:3
> at 
> org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:2
> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:10
> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:10
> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:10
> at groovy.lang.Closure.call(Closure.java:4
> at groovy.lang.Closure.call(Closure.java:4
> at groovy.lang.Closure.run(Closure.java:4
> at java.lang.Thread.run(Thread.java:7
> Caused by: java.lang.NullPointerException
> at 
> org.codehaus.groovy.classgen.asm.CallSiteWriter.prepareCallSite(CallSiteWriter.java:2
> at 
> 

[jira] [Comment Edited] (GROOVY-8880) Traits - static/instance init blocks

2018-11-18 Thread Anton Pryamostanov (JIRA)


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

Anton Pryamostanov edited comment on GROOVY-8880 at 11/18/18 10:14 AM:
---

hi [~paulk], yes - using "Clean" Maven task. Tried many times yesterday; works 
like charm in 2.5.5.SNAPSHOT but did not work in 3.0.0.

Also I validated that commit changes were in the project files used in my build.

There were some other issues with the build yesterday (related to Asciidoc 
plugin) and they are resolved now.

I will try again and will investigate more on what was happenning and post 
update here by today evening. Now going away from city.


was (Author: anton.pryamostanov):
hi [~paulk], yes - using "Clean" Maven task. Tried many times yesterday; works 
like charm in 2.5.5.SNAPSHOT but did not work in 3.0.0.

Also I validated that commit changes were in the project files used in my build.

There were some other issues with the build yesterday (related to Asciidoc 
plug) and they are resolved now.

I will try again and will investigate more on what was happenning and post 
update here by today evening. Now going away from city.

> Traits - static/instance init blocks
> 
>
> Key: GROOVY-8880
> URL: https://issues.apache.org/jira/browse/GROOVY-8880
> Project: Groovy
>  Issue Type: Improvement
>  Components: Compiler, groovy-runtime
>Affects Versions: 2.5.2
>Reporter: Anton Pryamostanov
>Assignee: Paul King
>Priority: Major
> Fix For: 3.0.0-alpha-4, 2.5.5
>
>
> Let's consider the below examples of Traits with Init blocks:
>  *Instance init block:*
> {code}
> trait InstanceTrait {
> {
> System.out.println("Instance init")
> }
> }
> class InstanceTraitClass implements InstanceTrait {
> }
> new InstanceTraitClass()
> {code}
> This gives the below compilation exception:
> {code:java}
> General error during class generation: NPE while processing 
> script1542098577743.groovy
> groovy.lang.GroovyRuntimeException: NPE while processing 
> script1542098577743.groovy
> at 
> org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:2
> at 
> org.codehaus.groovy.control.CompilationUnit$17.call(CompilationUnit.java:8
> at 
> org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:10
> at 
> org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:6
> at 
> org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:5
> at 
> org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:5
> at org.codehaus.groovy.control.CompilationUnit$compile$1.call(Unknown Sour
> at 
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:
> at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:1
> at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:1
> at 
> groovy.inspect.swingui.AstNodeToScriptAdapter.compileToScript(AstNodeToScriptAdapter.groovy:
> at 
> groovy.inspect.swingui.AstNodeToScriptAdapter$compileToScript.call(Unknown 
> Sour
> at 
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:
> at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:1
> at 
> groovy.inspect.swingui.AstBrowser$_decompile_closure6.doCall(AstBrowser.groovy:3
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Meth
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
> at java.lang.reflect.Method.invoke(Method.java:4
> at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:
> at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:3
> at 
> org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:2
> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:10
> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:10
> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:10
> at groovy.lang.Closure.call(Closure.java:4
> at groovy.lang.Closure.call(Closure.java:4
> at groovy.lang.Closure.run(Closure.java:4
> at java.lang.Thread.run(Thread.java:7
> Caused by: java.lang.NullPointerException
> at 
> org.codehaus.groovy.classgen.asm.CallSiteWriter.prepareCallSite(CallSiteWriter.java:2
> at 
> org.codehaus.groovy.classgen.asm.CallSiteWriter.prepareSiteAndReceiver(CallSiteWriter.java:2
> at 
> org.codehaus.groovy.classgen.asm.CallSiteWriter.prepareSiteAndReceiver(CallSiteWriter.java:2
>