[jira] [Created] (GROOVY-10398) LazyFieldNode never equals itself

2021-11-30 Thread James Kleeh (Jira)
James Kleeh created GROOVY-10398:


 Summary: LazyFieldNode never equals itself
 Key: GROOVY-10398
 URL: https://issues.apache.org/jira/browse/GROOVY-10398
 Project: Groovy
  Issue Type: Bug
  Components: ast builder
Affects Versions: 3.0.9
Reporter: James Kleeh


Assume you have a LazyFieldNode instance

LazyFieldNode node = ...

List nodes = [node]

`nodes.contains(node)` -> this will return false

 

This is because the `equals` method that `LazyFieldNode` implements compares 
the object to the delegate instead of itself so a lazy field node can never 
equal itself



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (GROOVY-10288) Regression with generics

2021-10-08 Thread James Kleeh (Jira)


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

James Kleeh commented on GROOVY-10288:
--

[~emilles] is there no intention to backport this to 3.0.x?

> Regression with generics
> 
>
> Key: GROOVY-10288
> URL: https://issues.apache.org/jira/browse/GROOVY-10288
> Project: Groovy
>  Issue Type: Bug
>  Components: Compiler
>Affects Versions: 3.0.9
>Reporter: James Kleeh
>Assignee: Eric Milles
>Priority: Major
>
> The following class fails to compile with 3.0.9, but works OK with 3.0.7
> {code:java}
> abstract class Test {
>  }{code}
> The error:
>  
> {code:java}
> Script370812522650681.groovy: 6: Cycle detected: the type java.lang.Object 
> cannot extend/implement itself or one of its own member types
>  @ line 6, column 34.
>  abstract class Test {
>  ^{code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (GROOVY-10289) Regression with static and non static class mixing

2021-10-07 Thread James Kleeh (Jira)


 [ 
https://issues.apache.org/jira/browse/GROOVY-10289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh updated GROOVY-10289:
-
Description: 
This issue started after the upgrade from 3.0.7 -> 3.0.9

 

Given the following code:
{code:java}
class A {

 static class B {
 String throwC() {
 throw new C()
 }
 }

 class C extends RuntimeException {

 } 
}{code}
 

The following exception is thrown. 
{code:java}
BUG! exception in phase 'semantic analysis' in source unit 
'ideaGroovyConsole.groovy' unexpected NullPointerExceptionBUG! exception in 
phase 'semantic analysis' in source unit 'ideaGroovyConsole.groovy' 
Caused by: java.lang.NullPointerException at 
org.codehaus.groovy.classgen.InnerClassVisitor.insertThis0ToSuperCall(InnerClassVisitor.java:304)
 at 
org.codehaus.groovy.classgen.InnerClassVisitor.passThisReference(InnerClassVisitor.java:284)
 at 
org.codehaus.groovy.classgen.InnerClassVisitor.visitConstructorCallExpression(InnerClassVisitor.java:145)
 at 
org.codehaus.groovy.ast.expr.ConstructorCallExpression.visit(ConstructorCallExpression.java:44)
 at 
org.codehaus.groovy.ast.CodeVisitorSupport.visitThrowStatement(CodeVisitorSupport.java:179)
 at 
org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitThrowStatement(ClassCodeVisitorSupport.java:236)
 at org.codehaus.groovy.ast.stmt.ThrowStatement.visit(ThrowStatement.java:41) 
at 
org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:86)
 at 
org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:164)
 at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69) 
at 
org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:138)
 at 
org.codehaus.groovy.classgen.InnerClassVisitor.visitConstructorOrMethod(InnerClassVisitor.java:114)
 at 
org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:106)
 at org.codehaus.groovy.ast.ClassNode.visitMethods(ClassNode.java:1099) at 
org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1092) at 
org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:52)
 at 
org.codehaus.groovy.classgen.InnerClassVisitor.visitClass(InnerClassVisitor.java:84)
 at 
org.codehaus.groovy.control.CompilationUnit.lambda$addPhaseOperations$4(CompilationUnit.java:214)
 at 
org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation(CompilationUnit.java:942){code}
 

Changing class C to be static causes it to work again

  was:
This issue started after the upgrade from 3.0.7 -> 3.0.9

 

Given the following code:
{code:java}
class A {

 static class B {
 String throwC() {
 throw new C()
 }
 }

 class C extends RuntimeException {

 } 
}{code}
 

The following exception is thrown. 
{code:java}
BUG! exception in phase 'semantic analysis' in source unit 
'ideaGroovyConsole.groovy' unexpected NullPointerExceptionBUG! exception in 
phase 'semantic analysis' in source unit 'ideaGroovyConsole.groovy' unexpected 
NullPointerException at 
org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation(CompilationUnit.java:947)
 at 
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:671)
 at 
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:635) 
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:389) at 
groovy.lang.GroovyClassLoader.lambda$parseClass$3(GroovyClassLoader.java:332) 
at 
org.codehaus.groovy.runtime.memoize.StampedCommonCache.compute(StampedCommonCache.java:163)
 at 
org.codehaus.groovy.runtime.memoize.StampedCommonCache.getAndPut(StampedCommonCache.java:154)
 at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:330) at 
groovy.lang.GroovyShell.parseClass(GroovyShell.java:526) at 
groovy.lang.GroovyShell.run(GroovyShell.java:359) at 
groovy.lang.GroovyShell.run(GroovyShell.java:339) at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498) at 
org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
 at 
org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:170)
 at 
org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:73)
 at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
 at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
 at 

[jira] [Updated] (GROOVY-10289) Regression with static and non static class mixing

2021-10-07 Thread James Kleeh (Jira)


 [ 
https://issues.apache.org/jira/browse/GROOVY-10289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh updated GROOVY-10289:
-
Description: 
This issue started after the upgrade from 3.0.7 -> 3.0.9

 

Given the following code:
{code:java}
class A {

 static class B {
 String throwC() {
 throw new C()
 }
 }

 class C extends RuntimeException {

 } 
}{code}
 

The following exception is thrown. 
{code:java}
BUG! exception in phase 'semantic analysis' in source unit 
'ideaGroovyConsole.groovy' unexpected NullPointerExceptionBUG! exception in 
phase 'semantic analysis' in source unit 'ideaGroovyConsole.groovy' unexpected 
NullPointerException at 
org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation(CompilationUnit.java:947)
 at 
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:671)
 at 
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:635) 
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:389) at 
groovy.lang.GroovyClassLoader.lambda$parseClass$3(GroovyClassLoader.java:332) 
at 
org.codehaus.groovy.runtime.memoize.StampedCommonCache.compute(StampedCommonCache.java:163)
 at 
org.codehaus.groovy.runtime.memoize.StampedCommonCache.getAndPut(StampedCommonCache.java:154)
 at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:330) at 
groovy.lang.GroovyShell.parseClass(GroovyShell.java:526) at 
groovy.lang.GroovyShell.run(GroovyShell.java:359) at 
groovy.lang.GroovyShell.run(GroovyShell.java:339) at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498) at 
org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
 at 
org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:170)
 at 
org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:73)
 at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
 at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
 at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:148)
 at console.run(console.groovy:11) at 
groovy.ui.GroovyMain.processReader(GroovyMain.java:631) at 
groovy.ui.GroovyMain.processFiles(GroovyMain.java:552) at 
groovy.ui.GroovyMain.run(GroovyMain.java:396) at 
groovy.ui.GroovyMain.access$1400(GroovyMain.java:68) at 
groovy.ui.GroovyMain$GroovyCommand.process(GroovyMain.java:322) at 
groovy.ui.GroovyMain.processArgs(GroovyMain.java:142) at 
groovy.ui.GroovyMain.main(GroovyMain.java:115) at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498) at 
org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:111) at 
org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:129) at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498) at 
com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:64)Caused
 by: java.lang.NullPointerException at 
org.codehaus.groovy.classgen.InnerClassVisitor.insertThis0ToSuperCall(InnerClassVisitor.java:304)
 at 
org.codehaus.groovy.classgen.InnerClassVisitor.passThisReference(InnerClassVisitor.java:284)
 at 
org.codehaus.groovy.classgen.InnerClassVisitor.visitConstructorCallExpression(InnerClassVisitor.java:145)
 at 
org.codehaus.groovy.ast.expr.ConstructorCallExpression.visit(ConstructorCallExpression.java:44)
 at 
org.codehaus.groovy.ast.CodeVisitorSupport.visitThrowStatement(CodeVisitorSupport.java:179)
 at 
org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitThrowStatement(ClassCodeVisitorSupport.java:236)
 at org.codehaus.groovy.ast.stmt.ThrowStatement.visit(ThrowStatement.java:41) 
at 
org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:86)
 at 
org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:164)
 at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69) 
at 
org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:138)
 at 

[jira] [Created] (GROOVY-10289) Regression with static and non static class mixing

2021-10-07 Thread James Kleeh (Jira)
James Kleeh created GROOVY-10289:


 Summary: Regression with static and non static class mixing
 Key: GROOVY-10289
 URL: https://issues.apache.org/jira/browse/GROOVY-10289
 Project: Groovy
  Issue Type: Bug
  Components: Compiler
Reporter: James Kleeh


This issue started after the upgrade from 3.0.7 -> 3.0.9

 

Given the following code:
{code:java}
class A {

 static class B {
 String throwC() {
 throw new C()
 }
 }

 class C extends RuntimeException {

 } 
}{code}
 

The following exception is thrown. 
{code:java}
BUG! exception in phase 'semantic analysis' in source unit 
'ideaGroovyConsole.groovy' unexpected NullPointerExceptionBUG! exception in 
phase 'semantic analysis' in source unit 'ideaGroovyConsole.groovy' unexpected 
NullPointerException at 
org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation(CompilationUnit.java:947)
 at 
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:671)
 at 
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:635) 
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:389) at 
groovy.lang.GroovyClassLoader.lambda$parseClass$3(GroovyClassLoader.java:332) 
at 
org.codehaus.groovy.runtime.memoize.StampedCommonCache.compute(StampedCommonCache.java:163)
 at 
org.codehaus.groovy.runtime.memoize.StampedCommonCache.getAndPut(StampedCommonCache.java:154)
 at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:330) at 
groovy.lang.GroovyShell.parseClass(GroovyShell.java:526) at 
groovy.lang.GroovyShell.run(GroovyShell.java:359) at 
groovy.lang.GroovyShell.run(GroovyShell.java:339) at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498) at 
org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
 at 
org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:170)
 at 
org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:73)
 at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
 at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
 at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:148)
 at console.run(console.groovy:11) at 
groovy.ui.GroovyMain.processReader(GroovyMain.java:631) at 
groovy.ui.GroovyMain.processFiles(GroovyMain.java:552) at 
groovy.ui.GroovyMain.run(GroovyMain.java:396) at 
groovy.ui.GroovyMain.access$1400(GroovyMain.java:68) at 
groovy.ui.GroovyMain$GroovyCommand.process(GroovyMain.java:322) at 
groovy.ui.GroovyMain.processArgs(GroovyMain.java:142) at 
groovy.ui.GroovyMain.main(GroovyMain.java:115) at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498) at 
org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:111) at 
org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:129) at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498) at 
com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:64)Caused
 by: java.lang.NullPointerException at 
org.codehaus.groovy.classgen.InnerClassVisitor.insertThis0ToSuperCall(InnerClassVisitor.java:304)
 at 
org.codehaus.groovy.classgen.InnerClassVisitor.passThisReference(InnerClassVisitor.java:284)
 at 
org.codehaus.groovy.classgen.InnerClassVisitor.visitConstructorCallExpression(InnerClassVisitor.java:145)
 at 
org.codehaus.groovy.ast.expr.ConstructorCallExpression.visit(ConstructorCallExpression.java:44)
 at 
org.codehaus.groovy.ast.CodeVisitorSupport.visitThrowStatement(CodeVisitorSupport.java:179)
 at 
org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitThrowStatement(ClassCodeVisitorSupport.java:236)
 at org.codehaus.groovy.ast.stmt.ThrowStatement.visit(ThrowStatement.java:41) 
at 
org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:86)
 at 
org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:164)
 at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69) 
at 

[jira] [Updated] (GROOVY-10288) Regression with generics

2021-10-07 Thread James Kleeh (Jira)


 [ 
https://issues.apache.org/jira/browse/GROOVY-10288?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh updated GROOVY-10288:
-
Description: 
The following class fails to compile with 3.0.9, but works OK with 3.0.7

 

`

abstract class Test {
 }

`

`

Script370812522650681.groovy: 6: Cycle detected: the type java.lang.Object 
cannot extend/implement itself or one of its own member types
 @ line 6, column 34.
 abstract class Test {
 ^

`

  was:
The following class fails to compile with 3.0.9, but works OK with 3.0.7

 

{{abstract class Test {}}
{{ }}}

 

The error:

{{Script370812522650681.groovy: 6: Cycle detected: the type java.lang.Object 
cannot extend/implement itself or one of its own member types}}
{{ @ line 6, column 34.}}
{{ abstract class Test {}}
{{ ^}}

 


> Regression with generics
> 
>
> Key: GROOVY-10288
> URL: https://issues.apache.org/jira/browse/GROOVY-10288
> Project: Groovy
>  Issue Type: Bug
>  Components: Compiler
>Affects Versions: 3.0.9
>Reporter: James Kleeh
>Priority: Major
>
> The following class fails to compile with 3.0.9, but works OK with 3.0.7
>  
> `
> abstract class Test {
>  }
> `
> `
> Script370812522650681.groovy: 6: Cycle detected: the type java.lang.Object 
> cannot extend/implement itself or one of its own member types
>  @ line 6, column 34.
>  abstract class Test {
>  ^
> `



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (GROOVY-10288) Regression with generics

2021-10-07 Thread James Kleeh (Jira)


 [ 
https://issues.apache.org/jira/browse/GROOVY-10288?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh updated GROOVY-10288:
-
Description: 
The following class fails to compile with 3.0.9, but works OK with 3.0.7
{code:java}
abstract class Test {
 }{code}
The error:

 
{code:java}
Script370812522650681.groovy: 6: Cycle detected: the type java.lang.Object 
cannot extend/implement itself or one of its own member types
 @ line 6, column 34.
 abstract class Test {
 ^{code}
 

 

  was:
The following class fails to compile with 3.0.9, but works OK with 3.0.7

 

`

abstract class Test {
 }

`

`

Script370812522650681.groovy: 6: Cycle detected: the type java.lang.Object 
cannot extend/implement itself or one of its own member types
 @ line 6, column 34.
 abstract class Test {
 ^

`


> Regression with generics
> 
>
> Key: GROOVY-10288
> URL: https://issues.apache.org/jira/browse/GROOVY-10288
> Project: Groovy
>  Issue Type: Bug
>  Components: Compiler
>Affects Versions: 3.0.9
>Reporter: James Kleeh
>Priority: Major
>
> The following class fails to compile with 3.0.9, but works OK with 3.0.7
> {code:java}
> abstract class Test {
>  }{code}
> The error:
>  
> {code:java}
> Script370812522650681.groovy: 6: Cycle detected: the type java.lang.Object 
> cannot extend/implement itself or one of its own member types
>  @ line 6, column 34.
>  abstract class Test {
>  ^{code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (GROOVY-10288) Regression with generics

2021-10-07 Thread James Kleeh (Jira)


 [ 
https://issues.apache.org/jira/browse/GROOVY-10288?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh updated GROOVY-10288:
-
Description: 
The following class fails to compile with 3.0.9, but works OK with 3.0.7

 

{{abstract class Test {}}
{{ }}}

 

The error:

{{Script370812522650681.groovy: 6: Cycle detected: the type java.lang.Object 
cannot extend/implement itself or one of its own member types}}
{{ @ line 6, column 34.}}
{{ abstract class Test {}}
{{ ^}}

 

  was:
The following class fails to compile with 3.0.9, but works OK with 3.0.7

 

```

abstract class Test {
}

```

```

Script370812522650681.groovy: 6: Cycle detected: the type java.lang.Object 
cannot extend/implement itself or one of its own member types
 @ line 6, column 34.
 abstract class Test {
 ^

```


> Regression with generics
> 
>
> Key: GROOVY-10288
> URL: https://issues.apache.org/jira/browse/GROOVY-10288
> Project: Groovy
>  Issue Type: Bug
>  Components: Compiler
>Affects Versions: 3.0.9
>Reporter: James Kleeh
>Priority: Major
>
> The following class fails to compile with 3.0.9, but works OK with 3.0.7
>  
> {{abstract class Test {}}
> {{ }}}
>  
> The error:
> {{Script370812522650681.groovy: 6: Cycle detected: the type java.lang.Object 
> cannot extend/implement itself or one of its own member types}}
> {{ @ line 6, column 34.}}
> {{ abstract class Test {}}
> {{ ^}}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (GROOVY-10288) Regression with generics

2021-10-07 Thread James Kleeh (Jira)
James Kleeh created GROOVY-10288:


 Summary: Regression with generics
 Key: GROOVY-10288
 URL: https://issues.apache.org/jira/browse/GROOVY-10288
 Project: Groovy
  Issue Type: Bug
  Components: Compiler
Affects Versions: 3.0.9
Reporter: James Kleeh


The following class fails to compile with 3.0.9, but works OK with 3.0.7

 

```

abstract class Test {
}

```

```

Script370812522650681.groovy: 6: Cycle detected: the type java.lang.Object 
cannot extend/implement itself or one of its own member types
 @ line 6, column 34.
 abstract class Test {
 ^

```



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (GROOVY-10185) Static compilation issue between static and non static methods

2021-07-27 Thread James Kleeh (Jira)


 [ 
https://issues.apache.org/jira/browse/GROOVY-10185?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh updated GROOVY-10185:
-
Description: 
The following code fails with the exception 

 
{code:java}
ideaGroovyConsole.groovy: 19: [Static type checking] - Non static method 
Bar#run cannot be called from static context
 @ line 19, column 17.
 println Bar.run(Foo){code}
 

 
{code:java}
import groovy.transform.CompileStatic
class Bar {
static String run(Class cls, String... args) { return "ok" }
void run(Class type) {}
}
@CompileStatic
class Foo {
static void go() { println Bar.run(Foo) }
}
Foo.go()
{code}
 This worked in Groovy 3.0.7

 

  was:
The following code fails with the exception 

 
{code:java}
ideaGroovyConsole.groovy: 19: [Static type checking] - Non static method 
Bar#run cannot be called from static context
 @ line 19, column 17.
 println Bar.run(Foo){code}
 

 
{code:java}
import groovy.transform.CompileStatic
class Bar {
static String run(Class cls, String... args) { return "ok" }
void run(Class type) {}
}
@CompileStatic
class Foo {
static void go() { println Bar.run(Foo) }
}
Foo.go()
{code}
 

 


> Static compilation issue between static and non static methods
> --
>
> Key: GROOVY-10185
> URL: https://issues.apache.org/jira/browse/GROOVY-10185
> Project: Groovy
>  Issue Type: Bug
>  Components: Static compilation
>Affects Versions: 3.0.8
>Reporter: James Kleeh
>Priority: Major
>
> The following code fails with the exception 
>  
> {code:java}
> ideaGroovyConsole.groovy: 19: [Static type checking] - Non static method 
> Bar#run cannot be called from static context
>  @ line 19, column 17.
>  println Bar.run(Foo){code}
>  
>  
> {code:java}
> import groovy.transform.CompileStatic
> class Bar {
> static String run(Class cls, String... args) { return "ok" }
> void run(Class type) {}
> }
> @CompileStatic
> class Foo {
> static void go() { println Bar.run(Foo) }
> }
> Foo.go()
> {code}
>  This worked in Groovy 3.0.7
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (GROOVY-10185) Static compilation issue between static and non static methods

2021-07-27 Thread James Kleeh (Jira)


 [ 
https://issues.apache.org/jira/browse/GROOVY-10185?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh updated GROOVY-10185:
-
Description: 
The following code fails with the exception 

 
{code:java}
ideaGroovyConsole.groovy: 19: [Static type checking] - Non static method 
Bar#run cannot be called from static context
 @ line 19, column 17.
 println Bar.run(Foo){code}
 

 
{code:java}
import groovy.transform.CompileStatic
class Bar {
static String run(Class cls, String... args) { return "ok" }
void run(Class type) {}
}
@CompileStatic
class Foo {
static void go() { println Bar.run(Foo) }
}
Foo.go()
{code}
 

 

  was:
The following code fails with the exception 

```

ideaGroovyConsole.groovy: 19: [Static type checking] - Non static method 
Bar#run cannot be called from static context
 @ line 19, column 17.
 println Bar.run(Foo)

```

 

```

import groovy.transform.CompileStatic

class Bar {

 static String run(Class cls, String... args) {
 return "ok"
 }

 void run(Class type) {
 }
}

@CompileStatic
class Foo {

 static void go() {
 println Bar.run(Foo)
 }
}

Foo.go()

```


> Static compilation issue between static and non static methods
> --
>
> Key: GROOVY-10185
> URL: https://issues.apache.org/jira/browse/GROOVY-10185
> Project: Groovy
>  Issue Type: Bug
>  Components: Static compilation
>Affects Versions: 3.0.8
>Reporter: James Kleeh
>Priority: Major
>
> The following code fails with the exception 
>  
> {code:java}
> ideaGroovyConsole.groovy: 19: [Static type checking] - Non static method 
> Bar#run cannot be called from static context
>  @ line 19, column 17.
>  println Bar.run(Foo){code}
>  
>  
> {code:java}
> import groovy.transform.CompileStatic
> class Bar {
> static String run(Class cls, String... args) { return "ok" }
> void run(Class type) {}
> }
> @CompileStatic
> class Foo {
> static void go() { println Bar.run(Foo) }
> }
> Foo.go()
> {code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (GROOVY-10185) Static compilation issue between static and non static methods

2021-07-27 Thread James Kleeh (Jira)
James Kleeh created GROOVY-10185:


 Summary: Static compilation issue between static and non static 
methods
 Key: GROOVY-10185
 URL: https://issues.apache.org/jira/browse/GROOVY-10185
 Project: Groovy
  Issue Type: Bug
  Components: Static compilation
Affects Versions: 3.0.8
Reporter: James Kleeh


The following code fails with the exception 

```

ideaGroovyConsole.groovy: 19: [Static type checking] - Non static method 
Bar#run cannot be called from static context
 @ line 19, column 17.
 println Bar.run(Foo)

```

 

```

import groovy.transform.CompileStatic

class Bar {

 static String run(Class cls, String... args) {
 return "ok"
 }

 void run(Class type) {
 }
}

@CompileStatic
class Foo {

 static void go() {
 println Bar.run(Foo)
 }
}

Foo.go()

```



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (GROOVY-9962) Stub generation malforms annotation values

2021-03-02 Thread James Kleeh (Jira)
James Kleeh created GROOVY-9962:
---

 Summary: Stub generation malforms annotation values
 Key: GROOVY-9962
 URL: https://issues.apache.org/jira/browse/GROOVY-9962
 Project: Groovy
  Issue Type: Bug
  Components: Stub generator / Joint compiler
Affects Versions: 3.0.7
Reporter: James Kleeh


This issue was introduced by https://issues.apache.org/jira/browse/GROOVY-6085 
and the fix 
[https://github.com/apache/groovy/commit/561fad780794a5ac6be81818d2f123496e6c9bad#diff-fb5c7aed8d75294b5fbca45b00da5e20968d33704cb81720503ee3601df30fecR732]

 

That commit replaces `$` with `.` in annotation values, however it seems that 
should only happen if the value is a class expression. For things like string 
literals it is changing the string value which is causing other problems.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Closed] (GROOVY-8726) Parameter lacks a reference to the MethodNode it belongs to

2020-05-21 Thread James Kleeh (Jira)


 [ 
https://issues.apache.org/jira/browse/GROOVY-8726?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh closed GROOVY-8726.
---
Resolution: Won't Fix

> Parameter lacks a reference to the MethodNode it belongs to
> ---
>
> Key: GROOVY-8726
> URL: https://issues.apache.org/jira/browse/GROOVY-8726
> Project: Groovy
>  Issue Type: Improvement
>  Components: Compiler
>Affects Versions: 2.5.1
>Reporter: James Kleeh
>Priority: Major
>
> The Parameter class lacks a reference to it's method node. This is important 
> to find arguments that have been "overridden".



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (GROOVY-9566) Default import for Proxy is wrong

2020-05-21 Thread James Kleeh (Jira)
James Kleeh created GROOVY-9566:
---

 Summary: Default import for Proxy is wrong
 Key: GROOVY-9566
 URL: https://issues.apache.org/jira/browse/GROOVY-9566
 Project: Groovy
  Issue Type: Bug
  Components: Compiler
Affects Versions: 3.0.3
Reporter: James Kleeh


In Java 11, a Groovy class that uses `Proxy`, the default import is 
`groovy.util.Proxy` where it should be `java.net.Proxy`

 

In Java 8, the default import is `java.net.Proxy`



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (GROOVY-9405) Junit 5 IncompatibleClassChangeError

2020-02-17 Thread James Kleeh (Jira)


 [ 
https://issues.apache.org/jira/browse/GROOVY-9405?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh updated GROOVY-9405:

Description: 
Junit5 fails to process closures as annotation member values in 
package-info.groovy. This worked in Groovy 2.5 / Junit4

 

{{Caused by: java.lang.IncompatibleClassChangeError: 
io.micronaut.inject.configurations.requirescondition.package-info and 
io.micronaut.inject.configurations.requirescondition.package-info$_closure1 
disagree on InnerClasses attribute at java.lang.Class.getDeclaringClass0(Native 
Method) at java.lang.Class.getDeclaringClass(Class.java:1235) at 
java.lang.Class.getEnclosingClass(Class.java:1277) at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.isInnerClass(JUnitPlatformTestClassProcessor.java:104)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.access$200(JUnitPlatformTestClassProcessor.java:54)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.execute(JUnitPlatformTestClassProcessor.java:90)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.execute(JUnitPlatformTestClassProcessor.java:79)
 at 
org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)
 at 
org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)}}

 

The package info is related to Micronaut

 

{{@Configuration}}
{{@Requires(condition = \{ ConditionContext context -> true })}}
{{package io.micronaut.inject.configurations.requirescondition2}}

import io.micronaut.context.annotation.Configuration
{{import io.micronaut.context.annotation.Requires}}
{{import io.micronaut.context.condition.ConditionContext}}

 

I'll try to create a sample application here shortly

 

I was able to work around the issue by adding 

 

{{test {}}
 {{    exclude '**/*$_closure*'}}
 {{}}}

 

to my build.gradle

  was:
Junit5 fails to process closures as annotation member values in 
package-info.groovy. This worked in Groovy 2.5 / Junit4

 

{{Caused by: java.lang.IncompatibleClassChangeError: 
io.micronaut.inject.configurations.requirescondition.package-info and 
io.micronaut.inject.configurations.requirescondition.package-info$_closure1 
disagree on InnerClasses attribute at java.lang.Class.getDeclaringClass0(Native 
Method) at java.lang.Class.getDeclaringClass(Class.java:1235) at 
java.lang.Class.getEnclosingClass(Class.java:1277) at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.isInnerClass(JUnitPlatformTestClassProcessor.java:104)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.access$200(JUnitPlatformTestClassProcessor.java:54)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.execute(JUnitPlatformTestClassProcessor.java:90)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.execute(JUnitPlatformTestClassProcessor.java:79)
 at 
org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)
 at 
org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)}}

 

The package info is related to Micronaut

 

{{@Configuration}}
{{ @Requires(condition = \{ ConditionContext context -> true })}}
{{ package io.micronaut.inject.configurations.requirescondition2}}

{{import io.micronaut.context.annotation.Configuration}}
{{ import io.micronaut.context.annotation.Requires}}
{{ import io.micronaut.context.condition.ConditionContext}}

 

I'll try to create a sample application here shortly

 

I was able to work around the issue by adding 

 

{{test {}}
{{    exclude '**/*$_closure*'}}
{{}}}

 

to my build.gradle


> Junit 5 IncompatibleClassChangeError
> 
>
> Key: GROOVY-9405
> URL: https://issues.apache.org/jira/browse/GROOVY-9405
> Project: Groovy
>  Issue Type: Bug
>  Components: groovy-test-junit5
>Affects Versions: 3.0.1
>Reporter: James Kleeh
>Priority: Major
>
> Junit5 fails to process closures as annotation member values in 
> package-info.groovy. This worked in Groovy 2.5 / Junit4
>  
> {{Caused by: java.lang.IncompatibleClassChangeError: 
> io.micronaut.inject.configurations.requirescondition.package-info and 
> io.micronaut.inject.configurations.requirescondition.package-info$_closure1 
> disagree on InnerClasses attribute at 
> java.lang.Class.getDeclaringClass0(Native Method) at 
> 

[jira] [Updated] (GROOVY-9405) Junit 5 IncompatibleClassChangeError

2020-02-17 Thread James Kleeh (Jira)


 [ 
https://issues.apache.org/jira/browse/GROOVY-9405?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh updated GROOVY-9405:

Description: 
Junit5 fails to process closures as annotation member values in 
package-info.groovy. This worked in Groovy 2.5 / Junit4

 

{{Caused by: java.lang.IncompatibleClassChangeError: 
io.micronaut.inject.configurations.requirescondition.package-info and 
io.micronaut.inject.configurations.requirescondition.package-info$_closure1 
disagree on InnerClasses attribute at java.lang.Class.getDeclaringClass0(Native 
Method) at java.lang.Class.getDeclaringClass(Class.java:1235) at 
java.lang.Class.getEnclosingClass(Class.java:1277) at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.isInnerClass(JUnitPlatformTestClassProcessor.java:104)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.access$200(JUnitPlatformTestClassProcessor.java:54)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.execute(JUnitPlatformTestClassProcessor.java:90)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.execute(JUnitPlatformTestClassProcessor.java:79)
 at 
org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)
 at 
org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)}}

 

The package info is related to Micronaut

 

{{@Configuration}}
 {{@Requires(condition = \{ ConditionContext context -> true })}}
 {{package io.micronaut.inject.configurations.requirescondition2}}

{{import io.micronaut.context.annotation.Configuration}}
 {{import io.micronaut.context.annotation.Requires}}
 {{import io.micronaut.context.condition.ConditionContext}}

 

I'll try to create a sample application here shortly

 

I was able to work around the issue by adding 

 

{{test {}}
 {{    exclude '**/*$_closure*'}}
 {{}}}

 

to my build.gradle

  was:
Junit5 fails to process closures as annotation member values in 
package-info.groovy. This worked in Groovy 2.5 / Junit4

 

{{Caused by: java.lang.IncompatibleClassChangeError: 
io.micronaut.inject.configurations.requirescondition.package-info and 
io.micronaut.inject.configurations.requirescondition.package-info$_closure1 
disagree on InnerClasses attribute at java.lang.Class.getDeclaringClass0(Native 
Method) at java.lang.Class.getDeclaringClass(Class.java:1235) at 
java.lang.Class.getEnclosingClass(Class.java:1277) at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.isInnerClass(JUnitPlatformTestClassProcessor.java:104)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.access$200(JUnitPlatformTestClassProcessor.java:54)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.execute(JUnitPlatformTestClassProcessor.java:90)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.execute(JUnitPlatformTestClassProcessor.java:79)
 at 
org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)
 at 
org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)}}

 

The package info is related to Micronaut

 

{{@Configuration}}
{{@Requires(condition = \{ ConditionContext context -> true })}}
{{package io.micronaut.inject.configurations.requirescondition2}}

import io.micronaut.context.annotation.Configuration
{{import io.micronaut.context.annotation.Requires}}
{{import io.micronaut.context.condition.ConditionContext}}

 

I'll try to create a sample application here shortly

 

I was able to work around the issue by adding 

 

{{test {}}
 {{    exclude '**/*$_closure*'}}
 {{}}}

 

to my build.gradle


> Junit 5 IncompatibleClassChangeError
> 
>
> Key: GROOVY-9405
> URL: https://issues.apache.org/jira/browse/GROOVY-9405
> Project: Groovy
>  Issue Type: Bug
>  Components: groovy-test-junit5
>Affects Versions: 3.0.1
>Reporter: James Kleeh
>Priority: Major
>
> Junit5 fails to process closures as annotation member values in 
> package-info.groovy. This worked in Groovy 2.5 / Junit4
>  
> {{Caused by: java.lang.IncompatibleClassChangeError: 
> io.micronaut.inject.configurations.requirescondition.package-info and 
> io.micronaut.inject.configurations.requirescondition.package-info$_closure1 
> disagree on InnerClasses attribute at 
> java.lang.Class.getDeclaringClass0(Native Method) at 
> 

[jira] [Updated] (GROOVY-9405) Junit 5 IncompatibleClassChangeError

2020-02-17 Thread James Kleeh (Jira)


 [ 
https://issues.apache.org/jira/browse/GROOVY-9405?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh updated GROOVY-9405:

Description: 
Junit5 fails to process closures as annotation member values in 
package-info.groovy. This worked in Groovy 2.5 / Junit4

 

{{Caused by: java.lang.IncompatibleClassChangeError: 
io.micronaut.inject.configurations.requirescondition.package-info and 
io.micronaut.inject.configurations.requirescondition.package-info$_closure1 
disagree on InnerClasses attribute at java.lang.Class.getDeclaringClass0(Native 
Method) at java.lang.Class.getDeclaringClass(Class.java:1235) at 
java.lang.Class.getEnclosingClass(Class.java:1277) at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.isInnerClass(JUnitPlatformTestClassProcessor.java:104)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.access$200(JUnitPlatformTestClassProcessor.java:54)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.execute(JUnitPlatformTestClassProcessor.java:90)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.execute(JUnitPlatformTestClassProcessor.java:79)
 at 
org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)
 at 
org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)}}

 

The package info is related to Micronaut

 

{{@Configuration}}
 {{@Requires(condition = \{ ConditionContext context -> true })}}
 {{package io.micronaut.inject.configurations.requirescondition2}}

{{import io.micronaut.context.annotation.Configuration}}
 {{import io.micronaut.context.annotation.Requires}}
 {{import io.micronaut.context.condition.ConditionContext}}

 

I'll try to create a sample application here shortly

 

I was able to work around the issue by adding 

 

{{test {}}
 {{    exclude '***/*$_closure*'}}
 {{}}}

 

to my build.gradle

  was:
Junit5 fails to process closures as annotation member values in 
package-info.groovy. This worked in Groovy 2.5 / Junit4

 

{{Caused by: java.lang.IncompatibleClassChangeError: 
io.micronaut.inject.configurations.requirescondition.package-info and 
io.micronaut.inject.configurations.requirescondition.package-info$_closure1 
disagree on InnerClasses attribute at java.lang.Class.getDeclaringClass0(Native 
Method) at java.lang.Class.getDeclaringClass(Class.java:1235) at 
java.lang.Class.getEnclosingClass(Class.java:1277) at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.isInnerClass(JUnitPlatformTestClassProcessor.java:104)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.access$200(JUnitPlatformTestClassProcessor.java:54)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.execute(JUnitPlatformTestClassProcessor.java:90)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.execute(JUnitPlatformTestClassProcessor.java:79)
 at 
org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)
 at 
org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)}}

 

The package info is related to Micronaut

 

{{@Configuration}}
 {{@Requires(condition = \{ ConditionContext context -> true })}}
 {{package io.micronaut.inject.configurations.requirescondition2}}

{{import io.micronaut.context.annotation.Configuration}}
 {{import io.micronaut.context.annotation.Requires}}
 {{import io.micronaut.context.condition.ConditionContext}}

 

I'll try to create a sample application here shortly

 

I was able to work around the issue by adding 

 

{{test {}}
 {{    exclude '**/*$_closure*'}}
 {{}}}

 

to my build.gradle


> Junit 5 IncompatibleClassChangeError
> 
>
> Key: GROOVY-9405
> URL: https://issues.apache.org/jira/browse/GROOVY-9405
> Project: Groovy
>  Issue Type: Bug
>  Components: groovy-test-junit5
>Affects Versions: 3.0.1
>Reporter: James Kleeh
>Priority: Major
>
> Junit5 fails to process closures as annotation member values in 
> package-info.groovy. This worked in Groovy 2.5 / Junit4
>  
> {{Caused by: java.lang.IncompatibleClassChangeError: 
> io.micronaut.inject.configurations.requirescondition.package-info and 
> io.micronaut.inject.configurations.requirescondition.package-info$_closure1 
> disagree on InnerClasses attribute at 
> java.lang.Class.getDeclaringClass0(Native Method) at 
> 

[jira] [Updated] (GROOVY-9405) Junit 5 IncompatibleClassChangeError

2020-02-17 Thread James Kleeh (Jira)


 [ 
https://issues.apache.org/jira/browse/GROOVY-9405?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh updated GROOVY-9405:

Description: 
Junit5 fails to process closures as annotation member values in 
package-info.groovy. This worked in Groovy 2.5 / Junit4

 

{{Caused by: java.lang.IncompatibleClassChangeError: 
io.micronaut.inject.configurations.requirescondition.package-info and 
io.micronaut.inject.configurations.requirescondition.package-info$_closure1 
disagree on InnerClasses attribute at java.lang.Class.getDeclaringClass0(Native 
Method) at java.lang.Class.getDeclaringClass(Class.java:1235) at 
java.lang.Class.getEnclosingClass(Class.java:1277) at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.isInnerClass(JUnitPlatformTestClassProcessor.java:104)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.access$200(JUnitPlatformTestClassProcessor.java:54)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.execute(JUnitPlatformTestClassProcessor.java:90)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.execute(JUnitPlatformTestClassProcessor.java:79)
 at 
org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)
 at 
org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)}}

 

The package info is related to Micronaut

 

{{@Configuration}}
{{ @Requires(condition = \{ ConditionContext context -> true })}}
{{ package io.micronaut.inject.configurations.requirescondition2}}

{{import io.micronaut.context.annotation.Configuration}}
{{ import io.micronaut.context.annotation.Requires}}
{{ import io.micronaut.context.condition.ConditionContext}}

 

I'll try to create a sample application here shortly

 

I was able to work around the issue by adding 

 

{{test {}}
{{    exclude '**/*$_closure*'}}
{{}}}

 

to my build.gradle

  was:
Junit5 fails to process closures as annotation member values in 
package-info.groovy

 

```

Caused by: java.lang.IncompatibleClassChangeError: 
io.micronaut.inject.configurations.requirescondition.package-info and 
io.micronaut.inject.configurations.requirescondition.package-info$_closure1 
disagree on InnerClasses attribute at java.lang.Class.getDeclaringClass0(Native 
Method) at java.lang.Class.getDeclaringClass(Class.java:1235) at 
java.lang.Class.getEnclosingClass(Class.java:1277) at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.isInnerClass(JUnitPlatformTestClassProcessor.java:104)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.access$200(JUnitPlatformTestClassProcessor.java:54)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.execute(JUnitPlatformTestClassProcessor.java:90)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.execute(JUnitPlatformTestClassProcessor.java:79)
 at 
org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)
 at 
org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)

```

 

The package info is related to Micronaut

 

```

@Configuration
@Requires(condition = \{ ConditionContext context -> true })
package io.micronaut.inject.configurations.requirescondition2

import io.micronaut.context.annotation.Configuration
import io.micronaut.context.annotation.Requires
import io.micronaut.context.condition.ConditionContext

```

 

I'll try to create a sample application here shortly


> Junit 5 IncompatibleClassChangeError
> 
>
> Key: GROOVY-9405
> URL: https://issues.apache.org/jira/browse/GROOVY-9405
> Project: Groovy
>  Issue Type: Bug
>  Components: groovy-test-junit5
>Affects Versions: 3.0.1
>Reporter: James Kleeh
>Priority: Major
>
> Junit5 fails to process closures as annotation member values in 
> package-info.groovy. This worked in Groovy 2.5 / Junit4
>  
> {{Caused by: java.lang.IncompatibleClassChangeError: 
> io.micronaut.inject.configurations.requirescondition.package-info and 
> io.micronaut.inject.configurations.requirescondition.package-info$_closure1 
> disagree on InnerClasses attribute at 
> java.lang.Class.getDeclaringClass0(Native Method) at 
> java.lang.Class.getDeclaringClass(Class.java:1235) at 
> java.lang.Class.getEnclosingClass(Class.java:1277) at 
> 

[jira] [Created] (GROOVY-9405) Junit 5 IncompatibleClassChangeError

2020-02-17 Thread James Kleeh (Jira)
James Kleeh created GROOVY-9405:
---

 Summary: Junit 5 IncompatibleClassChangeError
 Key: GROOVY-9405
 URL: https://issues.apache.org/jira/browse/GROOVY-9405
 Project: Groovy
  Issue Type: Bug
  Components: groovy-test-junit5
Affects Versions: 3.0.1
Reporter: James Kleeh


Junit5 fails to process closures as annotation member values in 
package-info.groovy

 

```

Caused by: java.lang.IncompatibleClassChangeError: 
io.micronaut.inject.configurations.requirescondition.package-info and 
io.micronaut.inject.configurations.requirescondition.package-info$_closure1 
disagree on InnerClasses attribute at java.lang.Class.getDeclaringClass0(Native 
Method) at java.lang.Class.getDeclaringClass(Class.java:1235) at 
java.lang.Class.getEnclosingClass(Class.java:1277) at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.isInnerClass(JUnitPlatformTestClassProcessor.java:104)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.access$200(JUnitPlatformTestClassProcessor.java:54)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.execute(JUnitPlatformTestClassProcessor.java:90)
 at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.execute(JUnitPlatformTestClassProcessor.java:79)
 at 
org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)
 at 
org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)

```

 

The package info is related to Micronaut

 

```

@Configuration
@Requires(condition = \{ ConditionContext context -> true })
package io.micronaut.inject.configurations.requirescondition2

import io.micronaut.context.annotation.Configuration
import io.micronaut.context.annotation.Requires
import io.micronaut.context.condition.ConditionContext

```

 

I'll try to create a sample application here shortly



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (GROOVY-9399) Annotations on annotation methods are missing in the AST

2020-02-14 Thread James Kleeh (Jira)


 [ 
https://issues.apache.org/jira/browse/GROOVY-9399?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh updated GROOVY-9399:

Description: 
In Groovy 2.5, the annotation would be found, in Groovy 3 it is not.

 

 Simple example:

 

{{import org.codehaus.groovy.ast.builder.AstBuilder}}
 {{import org.codehaus.groovy.ast.*}}

{{ASTNode[] nodes = new AstBuilder().buildFromString('''}}
 {{@interface Foo {}}
 {{    String value() default ""}}
 {{}}}

{{@interface Bar {}}

{{@Foo}}
 {{    String value()}}
 {{}}}
 {{''')}}

 

{{nodes[2].methods[0].getAnnotations()}}

  was:
In Groovy 2.5, the annotation would be found, in Groovy 3 it is not.

 

 Simple example:

 

{{

{{import org.codehaus.groovy.ast.builder.AstBuilder}}
{{import org.codehaus.groovy.ast.*}}

{{ASTNode[] nodes = new AstBuilder().buildFromString('''}}
{{@interface Foo {}}
 {{    String value() default ""}}
{{}}}

{{@interface Bar {}}

{{@Foo}}
 {{    String value()}}
{{}}}
{{''')}}

 

{{nodes[2].methods[0].getAnnotations()


> Annotations on annotation methods are missing in the AST
> 
>
> Key: GROOVY-9399
> URL: https://issues.apache.org/jira/browse/GROOVY-9399
> Project: Groovy
>  Issue Type: Bug
>  Components: ast builder
>Affects Versions: 3.0.0
>Reporter: James Kleeh
>Priority: Major
>
> In Groovy 2.5, the annotation would be found, in Groovy 3 it is not.
>  
>  Simple example:
>  
> {{import org.codehaus.groovy.ast.builder.AstBuilder}}
>  {{import org.codehaus.groovy.ast.*}}
> {{ASTNode[] nodes = new AstBuilder().buildFromString('''}}
>  {{@interface Foo {}}
>  {{    String value() default ""}}
>  {{}}}
> {{@interface Bar {}}
> {{@Foo}}
>  {{    String value()}}
>  {{}}}
>  {{''')}}
>  
> {{nodes[2].methods[0].getAnnotations()}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (GROOVY-9399) Annotations on annotation methods are missing in the AST

2020-02-14 Thread James Kleeh (Jira)


 [ 
https://issues.apache.org/jira/browse/GROOVY-9399?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh updated GROOVY-9399:

Description: 
In Groovy 2.5, the annotation would be found, in Groovy 3 it is not.

 

 Simple example:

 

{{import org.codehaus.groovy.ast.builder.AstBuilder}}
 {{import org.codehaus.groovy.ast.*}}

{{ASTNode[] nodes = new AstBuilder().buildFromString('''}}
 {{@interface Foo {}}
 {{    String value() default ""}}
 {{}}}

{{@interface Bar {}}

{{    @Foo}}
 {{    String value()}}
 {{}}}
 {{''')}}

 

{{nodes[2].methods[0].getAnnotations()}}

  was:
In Groovy 2.5, the annotation would be found, in Groovy 3 it is not.

 

 Simple example:

 

{{import org.codehaus.groovy.ast.builder.AstBuilder}}
 {{import org.codehaus.groovy.ast.*}}

{{ASTNode[] nodes = new AstBuilder().buildFromString('''}}
 {{@interface Foo {}}
 {{    String value() default ""}}
 {{}}}

{{@interface Bar {}}

{{@Foo}}
 {{    String value()}}
 {{}}}
 {{''')}}

 

{{nodes[2].methods[0].getAnnotations()}}


> Annotations on annotation methods are missing in the AST
> 
>
> Key: GROOVY-9399
> URL: https://issues.apache.org/jira/browse/GROOVY-9399
> Project: Groovy
>  Issue Type: Bug
>  Components: ast builder
>Affects Versions: 3.0.0
>Reporter: James Kleeh
>Priority: Major
>
> In Groovy 2.5, the annotation would be found, in Groovy 3 it is not.
>  
>  Simple example:
>  
> {{import org.codehaus.groovy.ast.builder.AstBuilder}}
>  {{import org.codehaus.groovy.ast.*}}
> {{ASTNode[] nodes = new AstBuilder().buildFromString('''}}
>  {{@interface Foo {}}
>  {{    String value() default ""}}
>  {{}}}
> {{@interface Bar {}}
> {{    @Foo}}
>  {{    String value()}}
>  {{}}}
>  {{''')}}
>  
> {{nodes[2].methods[0].getAnnotations()}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (GROOVY-9399) Annotations on annotation methods are missing in the AST

2020-02-14 Thread James Kleeh (Jira)


 [ 
https://issues.apache.org/jira/browse/GROOVY-9399?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh updated GROOVY-9399:

Description: 
In Groovy 2.5, the annotation would be found, in Groovy 3 it is not.

 

 Simple example:

 

{{

{{import org.codehaus.groovy.ast.builder.AstBuilder}}
{{import org.codehaus.groovy.ast.*}}

{{ASTNode[] nodes = new AstBuilder().buildFromString('''}}
{{@interface Foo {}}
 {{    String value() default ""}}
{{}}}

{{@interface Bar {}}

{{@Foo}}
 {{    String value()}}
{{}}}
{{''')}}

 

{{nodes[2].methods[0].getAnnotations()

  was:
In Groovy 2.5, the annotation would be found, in Groovy 3 it is not.

 

 Simple example:

 

import org.codehaus.groovy.ast.builder.AstBuilder;
{{ {{import org.codehaus.groovy.ast.*;

ASTNode[] nodes = new AstBuilder().buildFromString('''
{{ {{@interface Foo {
{{    String value() default ""}}
{{ {{}

@interface Bar {

@Foo
{{    String value()}}
{{ {{}
{{ {{''')

 

{{nodes[2].methods[0].getAnnotations()}}


> Annotations on annotation methods are missing in the AST
> 
>
> Key: GROOVY-9399
> URL: https://issues.apache.org/jira/browse/GROOVY-9399
> Project: Groovy
>  Issue Type: Bug
>  Components: ast builder
>Affects Versions: 3.0.0
>Reporter: James Kleeh
>Priority: Major
>
> In Groovy 2.5, the annotation would be found, in Groovy 3 it is not.
>  
>  Simple example:
>  
> {{
> {{import org.codehaus.groovy.ast.builder.AstBuilder}}
> {{import org.codehaus.groovy.ast.*}}
> {{ASTNode[] nodes = new AstBuilder().buildFromString('''}}
> {{@interface Foo {}}
>  {{    String value() default ""}}
> {{}}}
> {{@interface Bar {}}
> {{@Foo}}
>  {{    String value()}}
> {{}}}
> {{''')}}
>  
> {{nodes[2].methods[0].getAnnotations()



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (GROOVY-9399) Annotations on annotation methods are missing in the AST

2020-02-14 Thread James Kleeh (Jira)


 [ 
https://issues.apache.org/jira/browse/GROOVY-9399?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh updated GROOVY-9399:

Description: 
In Groovy 2.5, the annotation would be found, in Groovy 3 it is not.

 

 Simple example:

 

import org.codehaus.groovy.ast.builder.AstBuilder;
{{ {{import org.codehaus.groovy.ast.*;

ASTNode[] nodes = new AstBuilder().buildFromString('''
{{ {{@interface Foo {
{{    String value() default ""}}
{{ {{}

@interface Bar {

@Foo
{{    String value()}}
{{ {{}
{{ {{''')

 

{{nodes[2].methods[0].getAnnotations()}}

  was:
In Groovy 2.5, the annotation would be found, in Groovy 3 it is not.

 

 Simple example:

 

{{import org.codehaus.groovy.ast.builder.AstBuilder;}}
{{import org.codehaus.groovy.ast.*;}}

{{ASTNode[] nodes = new AstBuilder().buildFromString('''}}
{{@interface Foo {}}
{{ String value() default ""}}
{{}}}

{{@interface Bar {}}

{{@Foo}}
{{ String value()}}
{{}}}
{{''')}}

{{nodes[2].methods[0].getAnnotations()}}


> Annotations on annotation methods are missing in the AST
> 
>
> Key: GROOVY-9399
> URL: https://issues.apache.org/jira/browse/GROOVY-9399
> Project: Groovy
>  Issue Type: Bug
>  Components: ast builder
>Affects Versions: 3.0.0
>Reporter: James Kleeh
>Priority: Major
>
> In Groovy 2.5, the annotation would be found, in Groovy 3 it is not.
>  
>  Simple example:
>  
> import org.codehaus.groovy.ast.builder.AstBuilder;
> {{ {{import org.codehaus.groovy.ast.*;
> ASTNode[] nodes = new AstBuilder().buildFromString('''
> {{ {{@interface Foo {
> {{    String value() default ""}}
> {{ {{}
> @interface Bar {
> @Foo
> {{    String value()}}
> {{ {{}
> {{ {{''')
>  
> {{nodes[2].methods[0].getAnnotations()}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (GROOVY-9399) Annotations on annotation methods are missing in the AST

2020-02-14 Thread James Kleeh (Jira)
James Kleeh created GROOVY-9399:
---

 Summary: Annotations on annotation methods are missing in the AST
 Key: GROOVY-9399
 URL: https://issues.apache.org/jira/browse/GROOVY-9399
 Project: Groovy
  Issue Type: Bug
  Components: ast builder
Affects Versions: 3.0.0
Reporter: James Kleeh


In Groovy 2.5, the annotation would be found, in Groovy 3 it is not.

 

 Simple example:

 

{{import org.codehaus.groovy.ast.builder.AstBuilder;}}
{{import org.codehaus.groovy.ast.*;}}

{{ASTNode[] nodes = new AstBuilder().buildFromString('''}}
{{@interface Foo {}}
{{ String value() default ""}}
{{}}}

{{@interface Bar {}}

{{@Foo}}
{{ String value()}}
{{}}}
{{''')}}

{{nodes[2].methods[0].getAnnotations()}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GROOVY-8822) Conflict between @Generated and @Delegate

2018-12-14 Thread James Kleeh (JIRA)


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

James Kleeh commented on GROOVY-8822:
-

[~paulk] I'm currently hitting this with the gradle-5 branch of 
github.com/grails/grails-views

running views-functional-tests:test causes the issue

It is using 2.5.4

> Conflict between @Generated and @Delegate
> -
>
> Key: GROOVY-8822
> URL: https://issues.apache.org/jira/browse/GROOVY-8822
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.5.3
>Reporter: François Guillot
>Assignee: Paul King
>Priority: Major
> Fix For: 3.0.0-alpha-4, 2.5.3
>
>
> I get 
> java.lang.annotation.AnnotationFormatError: Duplicate annotation for class: 
> interface groovy.transform.Generated: @groovy.transform.Generated()
> On a class with a field declared with @Delegate
>  
> Removing @Delegate works around the problem



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (GROOVY-8872) Decompiled parameter names don't reflect the names in the bytecode

2018-11-08 Thread James Kleeh (JIRA)


 [ 
https://issues.apache.org/jira/browse/GROOVY-8872?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh updated GROOVY-8872:

Affects Version/s: (was: 2.5.1)
   2.5.4

> Decompiled parameter names don't reflect the names in the bytecode
> --
>
> Key: GROOVY-8872
> URL: https://issues.apache.org/jira/browse/GROOVY-8872
> Project: Groovy
>  Issue Type: Improvement
>  Components: bytecode, Compiler
>Affects Versions: 2.5.4
>Reporter: James Kleeh
>Priority: Critical
> Attachments: groovy-bug.tar.gz
>
>
> org.codehaus.groovy.ast.Parameter names do not reflect what is stored in the 
> bytecode.
> In this example project, I have 3 projects.
> api - Has a single interface that is compiled with parameters=true
> app - Has a single interface that extends the one in api and is compiled with 
> parameters=true
> processor - Has a single ast transform that fails compilation if any method 
> parameters start with "param"
>  
> The parameter names for the interface in the api project do not reflect the 
> bytecode when compiling the app project
>  
> The runnable example is available here and I've attached it below
> https://github.com/jameskleeh/groovy-ast-bug



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (GROOVY-8872) Decompiled parameter names don't reflect the names in the bytecode

2018-11-08 Thread James Kleeh (JIRA)


 [ 
https://issues.apache.org/jira/browse/GROOVY-8872?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh updated GROOVY-8872:

Summary: Decompiled parameter names don't reflect the names in the bytecode 
 (was: AST Parameter names don't reflect the names in the bytecode)

> Decompiled parameter names don't reflect the names in the bytecode
> --
>
> Key: GROOVY-8872
> URL: https://issues.apache.org/jira/browse/GROOVY-8872
> Project: Groovy
>  Issue Type: Bug
>  Components: bytecode, Compiler
>Affects Versions: 2.5.1
>Reporter: James Kleeh
>Priority: Major
> Attachments: groovy-bug.tar.gz
>
>
> org.codehaus.groovy.ast.Parameter names do not reflect what is stored in the 
> bytecode.
> In this example project, I have 3 projects.
> api - Has a single interface that is compiled with parameters=true
> app - Has a single interface that extends the one in api and is compiled with 
> parameters=true
> processor - Has a single ast transform that fails compilation if any method 
> parameters start with "param"
>  
> The parameter names for the interface in the api project do not reflect the 
> bytecode when compiling the app project
>  
> The runnable example is available here and I've attached it below
> https://github.com/jameskleeh/groovy-ast-bug



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (GROOVY-8872) Decompiled parameter names don't reflect the names in the bytecode

2018-11-08 Thread James Kleeh (JIRA)


 [ 
https://issues.apache.org/jira/browse/GROOVY-8872?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh updated GROOVY-8872:

Priority: Critical  (was: Major)

> Decompiled parameter names don't reflect the names in the bytecode
> --
>
> Key: GROOVY-8872
> URL: https://issues.apache.org/jira/browse/GROOVY-8872
> Project: Groovy
>  Issue Type: Improvement
>  Components: bytecode, Compiler
>Affects Versions: 2.5.1
>Reporter: James Kleeh
>Priority: Critical
> Attachments: groovy-bug.tar.gz
>
>
> org.codehaus.groovy.ast.Parameter names do not reflect what is stored in the 
> bytecode.
> In this example project, I have 3 projects.
> api - Has a single interface that is compiled with parameters=true
> app - Has a single interface that extends the one in api and is compiled with 
> parameters=true
> processor - Has a single ast transform that fails compilation if any method 
> parameters start with "param"
>  
> The parameter names for the interface in the api project do not reflect the 
> bytecode when compiling the app project
>  
> The runnable example is available here and I've attached it below
> https://github.com/jameskleeh/groovy-ast-bug



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (GROOVY-8872) Decompiled parameter names don't reflect the names in the bytecode

2018-11-08 Thread James Kleeh (JIRA)


 [ 
https://issues.apache.org/jira/browse/GROOVY-8872?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh updated GROOVY-8872:

Issue Type: Improvement  (was: Bug)

> Decompiled parameter names don't reflect the names in the bytecode
> --
>
> Key: GROOVY-8872
> URL: https://issues.apache.org/jira/browse/GROOVY-8872
> Project: Groovy
>  Issue Type: Improvement
>  Components: bytecode, Compiler
>Affects Versions: 2.5.1
>Reporter: James Kleeh
>Priority: Major
> Attachments: groovy-bug.tar.gz
>
>
> org.codehaus.groovy.ast.Parameter names do not reflect what is stored in the 
> bytecode.
> In this example project, I have 3 projects.
> api - Has a single interface that is compiled with parameters=true
> app - Has a single interface that extends the one in api and is compiled with 
> parameters=true
> processor - Has a single ast transform that fails compilation if any method 
> parameters start with "param"
>  
> The parameter names for the interface in the api project do not reflect the 
> bytecode when compiling the app project
>  
> The runnable example is available here and I've attached it below
> https://github.com/jameskleeh/groovy-ast-bug



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (GROOVY-8872) AST Parameter names don't reflect the names in the bytecode

2018-11-08 Thread James Kleeh (JIRA)
James Kleeh created GROOVY-8872:
---

 Summary: AST Parameter names don't reflect the names in the 
bytecode
 Key: GROOVY-8872
 URL: https://issues.apache.org/jira/browse/GROOVY-8872
 Project: Groovy
  Issue Type: Bug
  Components: bytecode, Compiler
Affects Versions: 2.5.1
Reporter: James Kleeh
 Attachments: groovy-bug.tar.gz

org.codehaus.groovy.ast.Parameter names do not reflect what is stored in the 
bytecode.

In this example project, I have 3 projects.

api - Has a single interface that is compiled with parameters=true

app - Has a single interface that extends the one in api and is compiled with 
parameters=true

processor - Has a single ast transform that fails compilation if any method 
parameters start with "param"

 

The parameter names for the interface in the api project do not reflect the 
bytecode when compiling the app project

 

The runnable example is available here and I've attached it below

https://github.com/jameskleeh/groovy-ast-bug



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (GROOVY-8726) Parameter lacks a reference to the MethodNode it belongs to

2018-08-03 Thread James Kleeh (JIRA)


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

James Kleeh commented on GROOVY-8726:
-

[~emilles] Having access to the declaring class provides no value for my use 
case. 

No chore is being created as a result of this change. With my current changes 
parameters are being copied to new instances once they get passed in to the 
method node constructor and the declaring method is set at that time.

> Parameter lacks a reference to the MethodNode it belongs to
> ---
>
> Key: GROOVY-8726
> URL: https://issues.apache.org/jira/browse/GROOVY-8726
> Project: Groovy
>  Issue Type: Improvement
>  Components: Compiler
>Affects Versions: 2.5.1
>Reporter: James Kleeh
>Priority: Major
>
> The Parameter class lacks a reference to it's method node. This is important 
> to find arguments that have been "overridden".



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (GROOVY-8726) Parameter lacks a reference to the MethodNode it belongs to

2018-08-03 Thread James Kleeh (JIRA)


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

James Kleeh edited comment on GROOVY-8726 at 8/3/18 3:39 PM:
-

[~emilles] I don't think that other nodes lack references is a reason to not 
have it. The Java annotation processor API allows this behavior. The parameters 
are being retrieved from the MethodNode. It doesn't make sense to me to require 
users to design an API that allows a reference to the method node to be kept 
along with the parameter.

 

"Is there some interface that Groovy provides you are overriding that has 
Parameter as the passed data?" No. This is my own API that uses any 
AnnotatedNode.


was (Author: schlogen):
[~emilles] I don't think that other nodes lack references is a reason to not 
have it. The parameters are being retrieved from the MethodNode. It doesn't 
make sense to me to require users to design an API that allows a reference to 
the method node to be kept along with the parameter. 

 

"Is there some interface that Groovy provides you are overriding that has 
Parameter as the passed data?" No. This is my own API that uses any 
AnnotatedNode.

> Parameter lacks a reference to the MethodNode it belongs to
> ---
>
> Key: GROOVY-8726
> URL: https://issues.apache.org/jira/browse/GROOVY-8726
> Project: Groovy
>  Issue Type: Improvement
>  Components: Compiler
>Affects Versions: 2.5.1
>Reporter: James Kleeh
>Priority: Major
>
> The Parameter class lacks a reference to it's method node. This is important 
> to find arguments that have been "overridden".



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (GROOVY-8726) Parameter lacks a reference to the MethodNode it belongs to

2018-08-03 Thread James Kleeh (JIRA)


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

James Kleeh commented on GROOVY-8726:
-

[~emilles] I don't think that other nodes lack references is a reason to not 
have it. The parameters are being retrieved from the MethodNode. It doesn't 
make sense to me to require users to design an API that allows a reference to 
the method node to be kept along with the parameter. 

 

"Is there some interface that Groovy provides you are overriding that has 
Parameter as the passed data?" No. This is my own API that uses any 
AnnotatedNode.

> Parameter lacks a reference to the MethodNode it belongs to
> ---
>
> Key: GROOVY-8726
> URL: https://issues.apache.org/jira/browse/GROOVY-8726
> Project: Groovy
>  Issue Type: Improvement
>  Components: Compiler
>Affects Versions: 2.5.1
>Reporter: James Kleeh
>Priority: Major
>
> The Parameter class lacks a reference to it's method node. This is important 
> to find arguments that have been "overridden".



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (GROOVY-8726) Parameter lacks a reference to the MethodNode it belongs to

2018-08-01 Thread James Kleeh (JIRA)


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

James Kleeh commented on GROOVY-8726:
-

[~daniel_sun] [~paulk] Looks like there are many areas of the source that 
expect parameters to be reusable and thus passed to multiple method node 
constructors. Is this something you would be willing to accept a change for? It 
would require essentially cloning the parameters when they are being used 
multiple times. At the moment I'm throwing an exception when the same parameter 
is passed to 2 different method node constructors.

> Parameter lacks a reference to the MethodNode it belongs to
> ---
>
> Key: GROOVY-8726
> URL: https://issues.apache.org/jira/browse/GROOVY-8726
> Project: Groovy
>  Issue Type: Improvement
>  Components: Compiler
>Affects Versions: 2.5.1
>Reporter: James Kleeh
>Priority: Major
>
> The Parameter class lacks a reference to it's method node. This is important 
> to find arguments that have been "overridden".



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (GROOVY-8726) Parameter lacks a reference to the MethodNode it belongs to

2018-08-01 Thread James Kleeh (JIRA)


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

James Kleeh commented on GROOVY-8726:
-

Because using the parent element for this purpose will break existing use cases.

> Parameter lacks a reference to the MethodNode it belongs to
> ---
>
> Key: GROOVY-8726
> URL: https://issues.apache.org/jira/browse/GROOVY-8726
> Project: Groovy
>  Issue Type: Improvement
>  Components: Compiler
>Affects Versions: 2.5.1
>Reporter: James Kleeh
>Priority: Major
>
> The Parameter class lacks a reference to it's method node. This is important 
> to find arguments that have been "overridden".



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (GROOVY-8726) Parameter lacks a reference to the MethodNode it belongs to

2018-08-01 Thread James Kleeh (JIRA)


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

James Kleeh commented on GROOVY-8726:
-

[~blackdrag] A Parameter is passed to a method. That method needs to find all 
parameters that were overriden. In order to do so, the method node is required. 
I've created a class to wrap the parameter and its method together to use for 
this purpose currently (a hack imo). 

[https://github.com/micronaut-projects/micronaut-core/blob/653c244735e4052915cc6ee4d9dd7f326fda68d9/inject-groovy/src/main/groovy/io/micronaut/ast/groovy/annotation/GroovyAnnotationMetadataBuilder.groovy#L108]

 

The Java annotation processor has a generic `getEnclosingElement` method that 
returns the method for the parameter.

> Parameter lacks a reference to the MethodNode it belongs to
> ---
>
> Key: GROOVY-8726
> URL: https://issues.apache.org/jira/browse/GROOVY-8726
> Project: Groovy
>  Issue Type: Improvement
>  Components: Compiler
>Affects Versions: 2.5.1
>Reporter: James Kleeh
>Priority: Major
>
> The Parameter class lacks a reference to it's method node. This is important 
> to find arguments that have been "overridden".



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (GROOVY-8726) Parameter lacks a reference to the MethodNode it belongs to

2018-08-01 Thread James Kleeh (JIRA)
James Kleeh created GROOVY-8726:
---

 Summary: Parameter lacks a reference to the MethodNode it belongs 
to
 Key: GROOVY-8726
 URL: https://issues.apache.org/jira/browse/GROOVY-8726
 Project: Groovy
  Issue Type: Improvement
  Components: Compiler
Affects Versions: 2.5.1
Reporter: James Kleeh


The Parameter class lacks a reference to it's method node. This is important to 
find arguments that have been "overridden".



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (GROOVY-8464) Allow rendering inline json

2018-01-30 Thread James Kleeh (JIRA)
James Kleeh created GROOVY-8464:
---

 Summary: Allow rendering inline json
 Key: GROOVY-8464
 URL: https://issues.apache.org/jira/browse/GROOVY-8464
 Project: Groovy
  Issue Type: Improvement
  Components: JSON
Affects Versions: 2.5.0-beta-2
Reporter: James Kleeh


In order to be able to render json "inline" (without `{}`), one or both of the 
following should change:

 

This constructor to be made public

[https://github.com/apache/groovy/blob/master/subprojects/groovy-json/src/main/java/groovy/json/StreamingJsonBuilder.java#L534]


or this method to not be private
[https://github.com/apache/groovy/blob/master/subprojects/groovy-json/src/main/java/groovy/json/StreamingJsonBuilder.java#L834]

 

We have been using a fork of the classes for some time and we would like to use 
the ones provided by Groovy, however due to our advanced usage of the library, 
we need further access. Thanks!

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (GROOVY-8112) NPE in Groovy compiler

2017-10-20 Thread James Kleeh (JIRA)

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

James Kleeh commented on GROOVY-8112:
-

[~paulk] Just `./gradlew clean classes`

> NPE in Groovy compiler
> --
>
> Key: GROOVY-8112
> URL: https://issues.apache.org/jira/browse/GROOVY-8112
> Project: Groovy
>  Issue Type: Bug
>  Components: Compiler
>Affects Versions: 2.4.9
> Environment: Windows 8 x64
>Reporter: Alexey Vladykin
>
> The following Groovy script causes NPE at compile time:
> {code:java|title=Bug.groovy}
> @Grapes([
> @Grab("org.slf4j:slf4j-api:1.7.22"),
> @Grab("org.apache.kafka:kafka-clients:0.10.2.0")
> ])
> import groovy.transform.Field
> import org.apache.kafka.clients.producer.Callback
> import org.apache.kafka.clients.producer.KafkaProducer
> import org.apache.kafka.clients.producer.ProducerRecord
> import org.apache.kafka.clients.producer.RecordMetadata
> import org.slf4j.Logger
> import org.slf4j.LoggerFactory
> @Field static final Logger logger = LoggerFactory.getLogger(Bug.class)
> wrapper {
> Properties config = new Properties()
> KafkaProducer kafkaProducer = new KafkaProducer<>(config)
> kafkaProducer.send(new ProducerRecord<>('topic', 'data'), new Callback() {
> @Override
> void onCompletion(RecordMetadata recordMetadata, Exception e) {
> if (e != null) {
> logger.error("Error sending to Kafka", e)
> }
> }
> })
> }
> {code}
> Full error message from groovyc:
> {code:none}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> General error during class generation: NPE while processing Bug.groovy
> groovy.lang.GroovyRuntimeException: NPE while processing Bug.groovy
>   at 
> org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:258)
>   at 
> org.codehaus.groovy.control.CompilationUnit$16.call(CompilationUnit.java:813)
>   at 
> org.codehaus.groovy.control.CompilationUnit$16.call(CompilationUnit.java:830)
>   at 
> org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1053)
>   at 
> org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:591)
>   at 
> org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569)
>   at 
> org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546)
>   at 
> org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:525)
>   at 
> org.codehaus.groovy.tools.FileSystemCompiler.compile(FileSystemCompiler.java:61)
>   at 
> org.codehaus.groovy.tools.FileSystemCompiler.doCompilation(FileSystemCompiler.java:217)
>   at 
> org.codehaus.groovy.tools.FileSystemCompiler.commandLineCompile(FileSystemCompiler.java:150)
>   at 
> org.codehaus.groovy.tools.FileSystemCompiler.commandLineCompileWithErrorHandling(FileSystemCompiler.java:180)
>   at 
> org.codehaus.groovy.tools.FileSystemCompiler.main(FileSystemCompiler.java:164)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:498)
>   at 
> org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:109)
>   at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:131)
> Caused by: java.lang.NullPointerException
>   at 
> org.codehaus.groovy.classgen.AsmClassGenerator.visitFieldExpression(AsmClassGenerator.java:1049)
>   at 
> org.codehaus.groovy.classgen.asm.ClosureWriter.loadReference(ClosureWriter.java:135)
>   at 
> org.codehaus.groovy.classgen.asm.InvocationWriter.loadVariableWithReference(InvocationWriter.java:611)
>   at 
> org.codehaus.groovy.classgen.asm.InvocationWriter.writeAICCall(InvocationWriter.java:596)
>   at 
> org.codehaus.groovy.classgen.asm.InvocationWriter.writeInvokeConstructor(InvocationWriter.java:571)
>   at 
> org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorCallExpression(AsmClassGenerator.java:818)
>   at 
> org.codehaus.groovy.ast.expr.ConstructorCallExpression.visit(ConstructorCallExpression.java:46)
>   at 
> org.codehaus.groovy.classgen.asm.CallSiteWriter.makeCallSite(CallSiteWriter.java:303)
>   at 
> org.codehaus.groovy.classgen.asm.InvocationWriter.makeCachedCall(InvocationWriter.java:307)
>   at 
> org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:392)
>   at 
> org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:104)
>   at 
> 

[jira] [Commented] (GROOVY-8112) NPE in Groovy compiler

2017-10-19 Thread James Kleeh (JIRA)

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

James Kleeh commented on GROOVY-8112:
-

[~paulk] If you check out the spring_5 branch and change the Groovy version in 
build.gradle you can reproduce the issue

> NPE in Groovy compiler
> --
>
> Key: GROOVY-8112
> URL: https://issues.apache.org/jira/browse/GROOVY-8112
> Project: Groovy
>  Issue Type: Bug
>  Components: Compiler
>Affects Versions: 2.4.9
> Environment: Windows 8 x64
>Reporter: Alexey Vladykin
>
> The following Groovy script causes NPE at compile time:
> {code:java|title=Bug.groovy}
> @Grapes([
> @Grab("org.slf4j:slf4j-api:1.7.22"),
> @Grab("org.apache.kafka:kafka-clients:0.10.2.0")
> ])
> import groovy.transform.Field
> import org.apache.kafka.clients.producer.Callback
> import org.apache.kafka.clients.producer.KafkaProducer
> import org.apache.kafka.clients.producer.ProducerRecord
> import org.apache.kafka.clients.producer.RecordMetadata
> import org.slf4j.Logger
> import org.slf4j.LoggerFactory
> @Field static final Logger logger = LoggerFactory.getLogger(Bug.class)
> wrapper {
> Properties config = new Properties()
> KafkaProducer kafkaProducer = new KafkaProducer<>(config)
> kafkaProducer.send(new ProducerRecord<>('topic', 'data'), new Callback() {
> @Override
> void onCompletion(RecordMetadata recordMetadata, Exception e) {
> if (e != null) {
> logger.error("Error sending to Kafka", e)
> }
> }
> })
> }
> {code}
> Full error message from groovyc:
> {code:none}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> General error during class generation: NPE while processing Bug.groovy
> groovy.lang.GroovyRuntimeException: NPE while processing Bug.groovy
>   at 
> org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:258)
>   at 
> org.codehaus.groovy.control.CompilationUnit$16.call(CompilationUnit.java:813)
>   at 
> org.codehaus.groovy.control.CompilationUnit$16.call(CompilationUnit.java:830)
>   at 
> org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1053)
>   at 
> org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:591)
>   at 
> org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569)
>   at 
> org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546)
>   at 
> org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:525)
>   at 
> org.codehaus.groovy.tools.FileSystemCompiler.compile(FileSystemCompiler.java:61)
>   at 
> org.codehaus.groovy.tools.FileSystemCompiler.doCompilation(FileSystemCompiler.java:217)
>   at 
> org.codehaus.groovy.tools.FileSystemCompiler.commandLineCompile(FileSystemCompiler.java:150)
>   at 
> org.codehaus.groovy.tools.FileSystemCompiler.commandLineCompileWithErrorHandling(FileSystemCompiler.java:180)
>   at 
> org.codehaus.groovy.tools.FileSystemCompiler.main(FileSystemCompiler.java:164)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:498)
>   at 
> org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:109)
>   at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:131)
> Caused by: java.lang.NullPointerException
>   at 
> org.codehaus.groovy.classgen.AsmClassGenerator.visitFieldExpression(AsmClassGenerator.java:1049)
>   at 
> org.codehaus.groovy.classgen.asm.ClosureWriter.loadReference(ClosureWriter.java:135)
>   at 
> org.codehaus.groovy.classgen.asm.InvocationWriter.loadVariableWithReference(InvocationWriter.java:611)
>   at 
> org.codehaus.groovy.classgen.asm.InvocationWriter.writeAICCall(InvocationWriter.java:596)
>   at 
> org.codehaus.groovy.classgen.asm.InvocationWriter.writeInvokeConstructor(InvocationWriter.java:571)
>   at 
> org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorCallExpression(AsmClassGenerator.java:818)
>   at 
> org.codehaus.groovy.ast.expr.ConstructorCallExpression.visit(ConstructorCallExpression.java:46)
>   at 
> org.codehaus.groovy.classgen.asm.CallSiteWriter.makeCallSite(CallSiteWriter.java:303)
>   at 
> org.codehaus.groovy.classgen.asm.InvocationWriter.makeCachedCall(InvocationWriter.java:307)
>   at 
> org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:392)
>   at 
> 

[jira] [Commented] (GROOVY-8112) NPE in Groovy compiler

2017-10-19 Thread James Kleeh (JIRA)

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

James Kleeh commented on GROOVY-8112:
-

[~paulk] Facing this issue with 2.5.0-beta-2 in Grails core

> NPE in Groovy compiler
> --
>
> Key: GROOVY-8112
> URL: https://issues.apache.org/jira/browse/GROOVY-8112
> Project: Groovy
>  Issue Type: Bug
>  Components: Compiler
>Affects Versions: 2.4.9
> Environment: Windows 8 x64
>Reporter: Alexey Vladykin
>
> The following Groovy script causes NPE at compile time:
> {code:java|title=Bug.groovy}
> @Grapes([
> @Grab("org.slf4j:slf4j-api:1.7.22"),
> @Grab("org.apache.kafka:kafka-clients:0.10.2.0")
> ])
> import groovy.transform.Field
> import org.apache.kafka.clients.producer.Callback
> import org.apache.kafka.clients.producer.KafkaProducer
> import org.apache.kafka.clients.producer.ProducerRecord
> import org.apache.kafka.clients.producer.RecordMetadata
> import org.slf4j.Logger
> import org.slf4j.LoggerFactory
> @Field static final Logger logger = LoggerFactory.getLogger(Bug.class)
> wrapper {
> Properties config = new Properties()
> KafkaProducer kafkaProducer = new KafkaProducer<>(config)
> kafkaProducer.send(new ProducerRecord<>('topic', 'data'), new Callback() {
> @Override
> void onCompletion(RecordMetadata recordMetadata, Exception e) {
> if (e != null) {
> logger.error("Error sending to Kafka", e)
> }
> }
> })
> }
> {code}
> Full error message from groovyc:
> {code:none}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> General error during class generation: NPE while processing Bug.groovy
> groovy.lang.GroovyRuntimeException: NPE while processing Bug.groovy
>   at 
> org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:258)
>   at 
> org.codehaus.groovy.control.CompilationUnit$16.call(CompilationUnit.java:813)
>   at 
> org.codehaus.groovy.control.CompilationUnit$16.call(CompilationUnit.java:830)
>   at 
> org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1053)
>   at 
> org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:591)
>   at 
> org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569)
>   at 
> org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546)
>   at 
> org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:525)
>   at 
> org.codehaus.groovy.tools.FileSystemCompiler.compile(FileSystemCompiler.java:61)
>   at 
> org.codehaus.groovy.tools.FileSystemCompiler.doCompilation(FileSystemCompiler.java:217)
>   at 
> org.codehaus.groovy.tools.FileSystemCompiler.commandLineCompile(FileSystemCompiler.java:150)
>   at 
> org.codehaus.groovy.tools.FileSystemCompiler.commandLineCompileWithErrorHandling(FileSystemCompiler.java:180)
>   at 
> org.codehaus.groovy.tools.FileSystemCompiler.main(FileSystemCompiler.java:164)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:498)
>   at 
> org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:109)
>   at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:131)
> Caused by: java.lang.NullPointerException
>   at 
> org.codehaus.groovy.classgen.AsmClassGenerator.visitFieldExpression(AsmClassGenerator.java:1049)
>   at 
> org.codehaus.groovy.classgen.asm.ClosureWriter.loadReference(ClosureWriter.java:135)
>   at 
> org.codehaus.groovy.classgen.asm.InvocationWriter.loadVariableWithReference(InvocationWriter.java:611)
>   at 
> org.codehaus.groovy.classgen.asm.InvocationWriter.writeAICCall(InvocationWriter.java:596)
>   at 
> org.codehaus.groovy.classgen.asm.InvocationWriter.writeInvokeConstructor(InvocationWriter.java:571)
>   at 
> org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorCallExpression(AsmClassGenerator.java:818)
>   at 
> org.codehaus.groovy.ast.expr.ConstructorCallExpression.visit(ConstructorCallExpression.java:46)
>   at 
> org.codehaus.groovy.classgen.asm.CallSiteWriter.makeCallSite(CallSiteWriter.java:303)
>   at 
> org.codehaus.groovy.classgen.asm.InvocationWriter.makeCachedCall(InvocationWriter.java:307)
>   at 
> org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:392)
>   at 
> org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:104)
>   at 
> 

[jira] [Created] (GROOVY-8343) Issue implementing Java interface

2017-10-06 Thread James Kleeh (JIRA)
James Kleeh created GROOVY-8343:
---

 Summary: Issue implementing Java interface
 Key: GROOVY-8343
 URL: https://issues.apache.org/jira/browse/GROOVY-8343
 Project: Groovy
  Issue Type: Bug
  Components: Compiler
Affects Versions: 2.5.0-beta-2
Reporter: James Kleeh


Groovy compiler fails with a message saying a method is not implemented in the 
Groovy class that exists in the Java interface.

The error can be seen here: 
https://travis-ci.org/grails/grails-core/builds/284244075

The file in question does in fact implement the method. 
https://github.com/grails/grails-core/blob/spring_5/grails-bootstrap/src/main/groovy/org/grails/io/support/ByteArrayResource.groovy#L64



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


[jira] [Created] (GROOVY-8296) Groovydoc Recognition exception with Java 8 class

2017-08-24 Thread James Kleeh (JIRA)
James Kleeh created GROOVY-8296:
---

 Summary: Groovydoc Recognition exception with Java 8 class
 Key: GROOVY-8296
 URL: https://issues.apache.org/jira/browse/GROOVY-8296
 Project: Groovy
  Issue Type: Bug
  Components: GroovyDoc
Affects Versions: 2.4.12
Reporter: James Kleeh


The following class results in an error with groovy doc:

https://github.com/grails/gorm-graphql/blob/12e38e83042a1804b1fa55291841cd510cccab9d/core/src/main/groovy/org/grails/gorm/graphql/entity/EntityFetchOptions.java

{{ERROR [org.codehaus.groovy.tools.groovydoc.GroovyRootDocBuilder] ignored due 
to RecognitionException: org/grails/gorm/graphql/entity/EntityFetchOptions.java 
[expecting EOF, found 'joinProperties']}}




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


[jira] [Created] (GROOVY-8274) methodMissing not executed when the delegate is an inner class

2017-07-31 Thread James Kleeh (JIRA)
James Kleeh created GROOVY-8274:
---

 Summary: methodMissing not executed when the delegate is an inner 
class
 Key: GROOVY-8274
 URL: https://issues.apache.org/jira/browse/GROOVY-8274
 Project: Groovy
  Issue Type: Bug
  Components: groovy-runtime
Affects Versions: 2.4.12
Reporter: James Kleeh


{code}
class Foo {

void executeClosure(Closure c) {
c.resolveStrategy = Closure.DELEGATE_ONLY
c.delegate = new Bar()
c.call()
}

class Bar {
def methodMissing(String name, args) {
println name
}
}
}

Closure c = {
go()
}

new Foo().executeClosure(c)
{code}

Executing the above results in:
{{groovy.lang.MissingMethodException: No signature of method: Foo.go() is 
applicable for argument types: () values: []}}

If the Bar class is moved out of Foo, it works as I expect.



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


[jira] [Created] (GROOVY-8272) Extending trait can't execute static method

2017-07-28 Thread James Kleeh (JIRA)
James Kleeh created GROOVY-8272:
---

 Summary: Extending trait can't execute static method
 Key: GROOVY-8272
 URL: https://issues.apache.org/jira/browse/GROOVY-8272
 Project: Groovy
  Issue Type: Bug
  Components: Static compilation
Affects Versions: 2.4.12
Reporter: James Kleeh
Priority: Critical


{code}
import groovy.transform.CompileStatic

@CompileStatic
trait Foo {
static void go() {
}
}

@CompileStatic
trait Bar extends Foo {
void doIt() {
go()
}
}
{code}

The above code will produce the following:

{{[Static type checking] - Cannot find matching method Bar#go(). Please check 
if the declared type is right and if the method exists.}}



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


[jira] [Comment Edited] (GROOVY-8255) Odd problems with flow typing and generics in Groovy 2.4.12+

2017-07-21 Thread James Kleeh (JIRA)

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

James Kleeh edited comment on GROOVY-8255 at 7/21/17 1:11 PM:
--

Another example 

{{[Static type checking] - Cannot loop with element of type 
graphql.language.Selection with collection of type java.util.List }}

{code}
@Grab(group='com.graphql-java', module='graphql-java', version='2.4.0')

import graphql.language.*
import graphql.schema.*

@groovy.transform.CompileStatic
class Foo {

   void getFetchArguments(DataFetchingEnvironment environment) {
for (Field field: environment.fields) {
List selections = field.selectionSet?.selections ?: []
for (Selection selection: selections) {
def x
}
}
}
}
{code}


was (Author: schlogen):
Another example 

{{[Static type checking] - Cannot loop with element of type 
graphql.language.Selection with collection of type java.util.List }}

{code}
@Grab(group='com.graphql-java', module='graphql-java', version='2.4.0')

import graphql.language.*
import graphql.schema.*

@groovy.transform.CompileStatic
abstract class Foo {

   protected void getFetchArguments(DataFetchingEnvironment environment) {

for (Field field: environment.fields) {
List selections = field.selectionSet?.selections ?: []
for (Selection selection: selections) {
if (selection instanceof Field) {
Field selectedField = (Field)selection
}
}
}
}
}
{code}

> Odd problems with flow typing and generics in Groovy 2.4.12+
> 
>
> Key: GROOVY-8255
> URL: https://issues.apache.org/jira/browse/GROOVY-8255
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.4.12
>Reporter: Graeme Rocher
>
> In order to get the GORM codebase to compile I had to make this change:
> https://github.com/grails/grails-data-mapping/commit/1ef850c496d13d8ca915b27e76b6bfdb4e27377e
> The code in question is:
> {code}
> /**
>  * Sets multipart values within the request body
>  *
>  * @param name The name of the multipart
>  * @param value The value of the multipart
>  */
> void setProperty(String name, value) {
> if (value instanceof File) {
> value = new FileSystemResource(value)
> }
> else if (value instanceof URL) {
> value = new UrlResource(value)
> }
> else if (value instanceof InputStream) {
> value = new InputStreamResource(value)
> }
> else if (value instanceof GString) {
> value = value.toString()
> }
> if( mvm[name] ) {
> mvm[name].add value
> }
> else {
> mvm.put(name, [value]) // <--- FAILS COMPILATION HERE
> }
> }
> {code}
> No matter what I tried I could not get it into to compile. The method accepts 
> `put(String, List)` but fails compilation with:
> {code}
> RequestCustomizer.groovy: 392: [Static type checking] - Cannot call 
> org.springframework.util.MultiValueMap #put(java.lang.String, 
> java.lang.Object) with arguments [java.lang.String, java.util.List 
> ] 
>  @ line 392, column 13.
>mvm.put(name, [value])
>^
> {code}
> Altering the code to:
> {code}
>List values = [value]
>mvm.put(name, values)
> {code}
> Fails with:
> {code}
> RequestCustomizer.groovy: 392: [Static type checking] - Incompatible generic 
> argument types. Cannot assign java.util.List  to: 
> java.util.List 
>  @ line 392, column 35.
>List values = [value]
>  ^
> RequestCustomizer.groovy: 393: [Static type checking] - Cannot call 
> org.springframework.util.MultiValueMap #put(java.lang.String, 
> java.lang.Object) with arguments [java.lang.String, java.util.List 
> ] 
>  @ line 393, column 13.
>mvm.put(name, values)
>^
> 2 errors
> {code}



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


[jira] [Comment Edited] (GROOVY-8255) Odd problems with flow typing and generics in Groovy 2.4.12+

2017-07-21 Thread James Kleeh (JIRA)

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

James Kleeh edited comment on GROOVY-8255 at 7/21/17 1:10 PM:
--

Another example 

{{[Static type checking] - Cannot loop with element of type 
graphql.language.Selection with collection of type java.util.List }}

{code}
@Grab(group='com.graphql-java', module='graphql-java', version='2.4.0')

import graphql.language.*
import graphql.schema.*

@groovy.transform.CompileStatic
abstract class Foo {

   protected void getFetchArguments(DataFetchingEnvironment environment) {

for (Field field: environment.fields) {
List selections = field.selectionSet?.selections ?: []
for (Selection selection: selections) {
if (selection instanceof Field) {
Field selectedField = (Field)selection
}
}
}
}
}
{code}


was (Author: schlogen):
Another example 

{code}
@Grab(group='com.graphql-java', module='graphql-java', version='2.4.0')

import graphql.language.*
import graphql.schema.*

@groovy.transform.CompileStatic
abstract class Foo {

   protected void getFetchArguments(DataFetchingEnvironment environment) {

for (Field field: environment.fields) {
List selections = field.selectionSet?.selections ?: []
for (Selection selection: selections) {
if (selection instanceof Field) {
Field selectedField = (Field)selection
}
}
}
}
}
{code}

> Odd problems with flow typing and generics in Groovy 2.4.12+
> 
>
> Key: GROOVY-8255
> URL: https://issues.apache.org/jira/browse/GROOVY-8255
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.4.12
>Reporter: Graeme Rocher
>
> In order to get the GORM codebase to compile I had to make this change:
> https://github.com/grails/grails-data-mapping/commit/1ef850c496d13d8ca915b27e76b6bfdb4e27377e
> The code in question is:
> {code}
> /**
>  * Sets multipart values within the request body
>  *
>  * @param name The name of the multipart
>  * @param value The value of the multipart
>  */
> void setProperty(String name, value) {
> if (value instanceof File) {
> value = new FileSystemResource(value)
> }
> else if (value instanceof URL) {
> value = new UrlResource(value)
> }
> else if (value instanceof InputStream) {
> value = new InputStreamResource(value)
> }
> else if (value instanceof GString) {
> value = value.toString()
> }
> if( mvm[name] ) {
> mvm[name].add value
> }
> else {
> mvm.put(name, [value]) // <--- FAILS COMPILATION HERE
> }
> }
> {code}
> No matter what I tried I could not get it into to compile. The method accepts 
> `put(String, List)` but fails compilation with:
> {code}
> RequestCustomizer.groovy: 392: [Static type checking] - Cannot call 
> org.springframework.util.MultiValueMap #put(java.lang.String, 
> java.lang.Object) with arguments [java.lang.String, java.util.List 
> ] 
>  @ line 392, column 13.
>mvm.put(name, [value])
>^
> {code}
> Altering the code to:
> {code}
>List values = [value]
>mvm.put(name, values)
> {code}
> Fails with:
> {code}
> RequestCustomizer.groovy: 392: [Static type checking] - Incompatible generic 
> argument types. Cannot assign java.util.List  to: 
> java.util.List 
>  @ line 392, column 35.
>List values = [value]
>  ^
> RequestCustomizer.groovy: 393: [Static type checking] - Cannot call 
> org.springframework.util.MultiValueMap #put(java.lang.String, 
> java.lang.Object) with arguments [java.lang.String, java.util.List 
> ] 
>  @ line 393, column 13.
>mvm.put(name, values)
>^
> 2 errors
> {code}



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


[jira] [Comment Edited] (GROOVY-8255) Odd problems with flow typing and generics in Groovy 2.4.12+

2017-07-21 Thread James Kleeh (JIRA)

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

James Kleeh edited comment on GROOVY-8255 at 7/21/17 1:08 PM:
--

Another example 

{{
@Grab(group='com.graphql-java', module='graphql-java', version='2.4.0')

import graphql.language.*
import graphql.schema.*

@groovy.transform.CompileStatic
abstract class Foo {

   protected void getFetchArguments(DataFetchingEnvironment environment) {

for (Field field: environment.fields) {
List selections = field.selectionSet?.selections ?: []
for (Selection selection: selections) {
if (selection instanceof Field) {
Field selectedField = (Field)selection
}
}
}
}
}
}}


was (Author: schlogen):
Another example 

{{@Grab(group='com.graphql-java', module='graphql-java', version='2.4.0')

import graphql.language.*
import graphql.schema.*

@groovy.transform.CompileStatic
abstract class Foo {

   protected void getFetchArguments(DataFetchingEnvironment environment) {

for (Field field: environment.fields) {
List selections = field.selectionSet?.selections ?: []
for (Selection selection: selections) {
if (selection instanceof Field) {
Field selectedField = (Field)selection
}
}
}
}
}}}

> Odd problems with flow typing and generics in Groovy 2.4.12+
> 
>
> Key: GROOVY-8255
> URL: https://issues.apache.org/jira/browse/GROOVY-8255
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.4.12
>Reporter: Graeme Rocher
>
> In order to get the GORM codebase to compile I had to make this change:
> https://github.com/grails/grails-data-mapping/commit/1ef850c496d13d8ca915b27e76b6bfdb4e27377e
> The code in question is:
> {code}
> /**
>  * Sets multipart values within the request body
>  *
>  * @param name The name of the multipart
>  * @param value The value of the multipart
>  */
> void setProperty(String name, value) {
> if (value instanceof File) {
> value = new FileSystemResource(value)
> }
> else if (value instanceof URL) {
> value = new UrlResource(value)
> }
> else if (value instanceof InputStream) {
> value = new InputStreamResource(value)
> }
> else if (value instanceof GString) {
> value = value.toString()
> }
> if( mvm[name] ) {
> mvm[name].add value
> }
> else {
> mvm.put(name, [value]) // <--- FAILS COMPILATION HERE
> }
> }
> {code}
> No matter what I tried I could not get it into to compile. The method accepts 
> `put(String, List)` but fails compilation with:
> {code}
> RequestCustomizer.groovy: 392: [Static type checking] - Cannot call 
> org.springframework.util.MultiValueMap #put(java.lang.String, 
> java.lang.Object) with arguments [java.lang.String, java.util.List 
> ] 
>  @ line 392, column 13.
>mvm.put(name, [value])
>^
> {code}
> Altering the code to:
> {code}
>List values = [value]
>mvm.put(name, values)
> {code}
> Fails with:
> {code}
> RequestCustomizer.groovy: 392: [Static type checking] - Incompatible generic 
> argument types. Cannot assign java.util.List  to: 
> java.util.List 
>  @ line 392, column 35.
>List values = [value]
>  ^
> RequestCustomizer.groovy: 393: [Static type checking] - Cannot call 
> org.springframework.util.MultiValueMap #put(java.lang.String, 
> java.lang.Object) with arguments [java.lang.String, java.util.List 
> ] 
>  @ line 393, column 13.
>mvm.put(name, values)
>^
> 2 errors
> {code}



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


[jira] [Commented] (GROOVY-8255) Odd problems with flow typing and generics in Groovy 2.4.12+

2017-07-21 Thread James Kleeh (JIRA)

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

James Kleeh commented on GROOVY-8255:
-

Another example 

{{@Grab(group='com.graphql-java', module='graphql-java', version='2.4.0')

import graphql.language.*
import graphql.schema.*

@groovy.transform.CompileStatic
abstract class Foo {

   protected void getFetchArguments(DataFetchingEnvironment environment) {

for (Field field: environment.fields) {
List selections = field.selectionSet?.selections ?: []
for (Selection selection: selections) {
if (selection instanceof Field) {
Field selectedField = (Field)selection
}
}
}
}
}}}

> Odd problems with flow typing and generics in Groovy 2.4.12+
> 
>
> Key: GROOVY-8255
> URL: https://issues.apache.org/jira/browse/GROOVY-8255
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.4.12
>Reporter: Graeme Rocher
>
> In order to get the GORM codebase to compile I had to make this change:
> https://github.com/grails/grails-data-mapping/commit/1ef850c496d13d8ca915b27e76b6bfdb4e27377e
> The code in question is:
> {code}
> /**
>  * Sets multipart values within the request body
>  *
>  * @param name The name of the multipart
>  * @param value The value of the multipart
>  */
> void setProperty(String name, value) {
> if (value instanceof File) {
> value = new FileSystemResource(value)
> }
> else if (value instanceof URL) {
> value = new UrlResource(value)
> }
> else if (value instanceof InputStream) {
> value = new InputStreamResource(value)
> }
> else if (value instanceof GString) {
> value = value.toString()
> }
> if( mvm[name] ) {
> mvm[name].add value
> }
> else {
> mvm.put(name, [value]) // <--- FAILS COMPILATION HERE
> }
> }
> {code}
> No matter what I tried I could not get it into to compile. The method accepts 
> `put(String, List)` but fails compilation with:
> {code}
> RequestCustomizer.groovy: 392: [Static type checking] - Cannot call 
> org.springframework.util.MultiValueMap #put(java.lang.String, 
> java.lang.Object) with arguments [java.lang.String, java.util.List 
> ] 
>  @ line 392, column 13.
>mvm.put(name, [value])
>^
> {code}
> Altering the code to:
> {code}
>List values = [value]
>mvm.put(name, values)
> {code}
> Fails with:
> {code}
> RequestCustomizer.groovy: 392: [Static type checking] - Incompatible generic 
> argument types. Cannot assign java.util.List  to: 
> java.util.List 
>  @ line 392, column 35.
>List values = [value]
>  ^
> RequestCustomizer.groovy: 393: [Static type checking] - Cannot call 
> org.springframework.util.MultiValueMap #put(java.lang.String, 
> java.lang.Object) with arguments [java.lang.String, java.util.List 
> ] 
>  @ line 393, column 13.
>mvm.put(name, values)
>^
> 2 errors
> {code}



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


[jira] [Updated] (GROOVY-8260) Static compilation requires casting inside instanceof check

2017-07-17 Thread James Kleeh (JIRA)

 [ 
https://issues.apache.org/jira/browse/GROOVY-8260?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh updated GROOVY-8260:

Description: 
There are many times I find myself having to cast variables directly inside an 
{{instanceof Class}} check.

In addition, I have found a specific problem with a generic {{}} where a method in the class that returns {{T}}, Groovy believes a 
collection is being returned. This is the line in question: 
https://github.com/grails/gorm-graphql/blob/ea6887bef0ced75d9cc0d01dc7b94d4fc0520266/core/src/main/groovy/org/grails/gorm/graphql/fetcher/impl/EntityDataFetcher.groovy#L45

The goal of this issue is to have the following codebase compile without 
changes.

{{git clone -b broken_compilation https://github.com/grails/gorm-graphql}}

Attempt to compile with {{./gradlew clean classes}}

  was:
There are many times I find myself having to cast variables directly inside an 
{{instanceof Class}} check.

In addition, I have found a specific problem with a generic {{}} where a method in the class that returns {{T}}, Groovy believes a 
collection is being returned.

The goal of this issue is to have the following codebase compile without 
changes.

{{git clone -b broken_compilation https://github.com/grails/gorm-graphql}}

Attempt to compile with {{./gradlew clean classes}}


> Static compilation requires casting inside instanceof check
> ---
>
> Key: GROOVY-8260
> URL: https://issues.apache.org/jira/browse/GROOVY-8260
> Project: Groovy
>  Issue Type: Bug
>  Components: Compiler
>Affects Versions: 2.4.12
> Environment: macOS JDK 1.8
>Reporter: James Kleeh
>
> There are many times I find myself having to cast variables directly inside 
> an {{instanceof Class}} check.
> In addition, I have found a specific problem with a generic {{ SomeClass>}} where a method in the class that returns {{T}}, Groovy believes 
> a collection is being returned. This is the line in question: 
> https://github.com/grails/gorm-graphql/blob/ea6887bef0ced75d9cc0d01dc7b94d4fc0520266/core/src/main/groovy/org/grails/gorm/graphql/fetcher/impl/EntityDataFetcher.groovy#L45
> The goal of this issue is to have the following codebase compile without 
> changes.
> {{git clone -b broken_compilation https://github.com/grails/gorm-graphql}}
> Attempt to compile with {{./gradlew clean classes}}



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


[jira] [Created] (GROOVY-8260) Static compilation requires casting inside instanceof check

2017-07-17 Thread James Kleeh (JIRA)
James Kleeh created GROOVY-8260:
---

 Summary: Static compilation requires casting inside instanceof 
check
 Key: GROOVY-8260
 URL: https://issues.apache.org/jira/browse/GROOVY-8260
 Project: Groovy
  Issue Type: Bug
  Components: Compiler
Affects Versions: 2.4.12
 Environment: macOS JDK 1.8
Reporter: James Kleeh


There are many times I find myself having to cast variables directly inside an 
`instanceof Class` check.

In addition, I have found a specific problem with a generic `` where a method in the class that returns `T`, Groovy believes a 
collection is being returned.

The goal of this issue is to have the following codebase compile without 
changes.

`git clone -b broken_compilation https://github.com/grails/gorm-graphql`

Attempt to compile with `./gradlew clean classes`



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


[jira] [Updated] (GROOVY-8260) Static compilation requires casting inside instanceof check

2017-07-17 Thread James Kleeh (JIRA)

 [ 
https://issues.apache.org/jira/browse/GROOVY-8260?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh updated GROOVY-8260:

Description: 
There are many times I find myself having to cast variables directly inside an 
{{instanceof Class}} check.

In addition, I have found a specific problem with a generic {{}} where a method in the class that returns {{T}}, Groovy believes a 
collection is being returned.

The goal of this issue is to have the following codebase compile without 
changes.

{{git clone -b broken_compilation https://github.com/grails/gorm-graphql}}

Attempt to compile with {{./gradlew clean classes}}

  was:
There are many times I find myself having to cast variables directly inside an 
`instanceof Class` check.

In addition, I have found a specific problem with a generic `` where a method in the class that returns `T`, Groovy believes a 
collection is being returned.

The goal of this issue is to have the following codebase compile without 
changes.

`git clone -b broken_compilation https://github.com/grails/gorm-graphql`

Attempt to compile with `./gradlew clean classes`


> Static compilation requires casting inside instanceof check
> ---
>
> Key: GROOVY-8260
> URL: https://issues.apache.org/jira/browse/GROOVY-8260
> Project: Groovy
>  Issue Type: Bug
>  Components: Compiler
>Affects Versions: 2.4.12
> Environment: macOS JDK 1.8
>Reporter: James Kleeh
>
> There are many times I find myself having to cast variables directly inside 
> an {{instanceof Class}} check.
> In addition, I have found a specific problem with a generic {{ SomeClass>}} where a method in the class that returns {{T}}, Groovy believes 
> a collection is being returned.
> The goal of this issue is to have the following codebase compile without 
> changes.
> {{git clone -b broken_compilation https://github.com/grails/gorm-graphql}}
> Attempt to compile with {{./gradlew clean classes}}



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


[jira] [Updated] (GROOVY-7994) Anonymous inner class believes protected method in parent's superclass returns Object

2016-11-08 Thread James Kleeh (JIRA)

 [ 
https://issues.apache.org/jira/browse/GROOVY-7994?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh updated GROOVY-7994:

Description: 
The below will execute the constructor on `Other` that takes an `Object`, even 
though `getName()` returns a `String`.

{code}
import groovy.transform.CompileStatic

@CompileStatic
class Parent {
protected String getName() {
"sally"
}
}

@CompileStatic
class Child extends Parent {

Inner doSomething() {
return new Inner() {
void go() {
new Other(name)
}
}
}

}

@CompileStatic
class Other {
Other(Object object) {
println "called with other"
}
Other(String string) {
println "called with string"
}
}

@CompileStatic
abstract class Inner {
abstract void go()
}

Inner inner = new Child().doSomething()
inner.go()
{code}

  was:
The below will execute the constructor on `Other` that takes an `Object`, even 
though `getName()` returns a `String`.

```
import groovy.transform.CompileStatic

@CompileStatic
class Parent {
protected String getName() {
"sally"
}
}

@CompileStatic
class Child extends Parent {

Inner doSomething() {
return new Inner() {
void go() {
new Other(name)
}
}
}

}

@CompileStatic
class Other {
Other(Object object) {
println "called with other"
}
Other(String string) {
println "called with string"
}
}

@CompileStatic
abstract class Inner {
abstract void go()
}

Inner inner = new Child().doSomething()
inner.go()
```


> Anonymous inner class believes protected method in parent's superclass 
> returns Object
> -
>
> Key: GROOVY-7994
> URL: https://issues.apache.org/jira/browse/GROOVY-7994
> Project: Groovy
>  Issue Type: Bug
>  Components: groovy-runtime
>Affects Versions: 2.4.7
>Reporter: James Kleeh
>
> The below will execute the constructor on `Other` that takes an `Object`, 
> even though `getName()` returns a `String`.
> {code}
> import groovy.transform.CompileStatic
> @CompileStatic
> class Parent {
> protected String getName() {
> "sally"
> }
> }
> @CompileStatic
> class Child extends Parent {
> Inner doSomething() {
> return new Inner() {
> void go() {
> new Other(name)
> }
> }
> }
> }
> @CompileStatic
> class Other {
> Other(Object object) {
> println "called with other"
> }
> Other(String string) {
> println "called with string"
> }
> }
> @CompileStatic
> abstract class Inner {
> abstract void go()
> }
> Inner inner = new Child().doSomething()
> inner.go()
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (GROOVY-7994) Anonymous inner class believes protected method in parent's superclass returns Object

2016-11-08 Thread James Kleeh (JIRA)
James Kleeh created GROOVY-7994:
---

 Summary: Anonymous inner class believes protected method in 
parent's superclass returns Object
 Key: GROOVY-7994
 URL: https://issues.apache.org/jira/browse/GROOVY-7994
 Project: Groovy
  Issue Type: Bug
  Components: groovy-runtime
Affects Versions: 2.4.7
Reporter: James Kleeh


The below will execute the constructor on `Other` that takes an `Object`, even 
though `getName()` returns a `String`.

```
import groovy.transform.CompileStatic

@CompileStatic
class Parent {
protected String getName() {
"sally"
}
}

@CompileStatic
class Child extends Parent {

Inner doSomething() {
return new Inner() {
void go() {
new Other(name)
}
}
}

}

@CompileStatic
class Other {
Other(Object object) {
println "called with other"
}
Other(String string) {
println "called with string"
}
}

@CompileStatic
abstract class Inner {
abstract void go()
}

Inner inner = new Child().doSomething()
inner.go()
```



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (GROOVY-7915) Console toolbar on large resolutions very small

2016-08-22 Thread James Kleeh (JIRA)

 [ 
https://issues.apache.org/jira/browse/GROOVY-7915?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Kleeh updated GROOVY-7915:

Attachment: screenshot-1.png

> Console toolbar on large resolutions very small
> ---
>
> Key: GROOVY-7915
> URL: https://issues.apache.org/jira/browse/GROOVY-7915
> Project: Groovy
>  Issue Type: Improvement
>  Components: Groovy Console
>Affects Versions: 2.4.7
> Environment: Windows 10 x64
>Reporter: James Kleeh
>Priority: Trivial
> Attachments: screenshot-1.png
>
>
> The toolbar in the Groovy console is extremely small on 3840x2160.
> Increasing the font size in the AST inspector doesn't increase the height of 
> each of the items on the left menu, making them unreadable.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (GROOVY-7915) Console toolbar on large resolutions very small

2016-08-22 Thread James Kleeh (JIRA)
James Kleeh created GROOVY-7915:
---

 Summary: Console toolbar on large resolutions very small
 Key: GROOVY-7915
 URL: https://issues.apache.org/jira/browse/GROOVY-7915
 Project: Groovy
  Issue Type: Improvement
  Components: Groovy Console
Affects Versions: 2.4.7
 Environment: Windows 10 x64
Reporter: James Kleeh
Priority: Trivial


The toolbar in the Groovy console is extremely small on 3840x2160.

Increasing the font size in the AST inspector doesn't increase the height of 
each of the items on the left menu, making them unreadable.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)