[jira] [Resolved] (GROOVY-9035) config script: unexpected NPE when processing compiler config DSL
[ https://issues.apache.org/jira/browse/GROOVY-9035?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paul King resolved GROOVY-9035. --- Resolution: Fixed Assignee: Paul King Fix Version/s: 2.5.7 3.0.0-beta-1 Fixed as per your suggestion. Thanks! > config script: unexpected NPE when processing compiler config DSL > - > > Key: GROOVY-9035 > URL: https://issues.apache.org/jira/browse/GROOVY-9035 > Project: Groovy > Issue Type: Bug >Affects Versions: 2.5.6 >Reporter: Eric Milles >Assignee: Paul King >Priority: Minor > Fix For: 3.0.0-beta-1, 2.5.7 > > > I started experimenting with using config script to enable static compilation > by default. I ran into GROOVY-7856 pretty much right away. So I decided to > comment out my config script like this: > {code:groovy} > withConfig(configuration) { > source(classValidator: { !it.isInterface() }) { -> > //ast(groovy.transform.CompileStatic) > } > } > {code} > Now I get this NPE because there is no delegate CompilationCustomizer found > for the SourceAwareCustomizer. > {code} > java.lang.NullPointerException > at > org.codehaus.groovy.control.customizers.DelegatingCustomizer.(DelegatingCustomizer.java:36) > at > org.codehaus.groovy.control.customizers.SourceAwareCustomizer.(SourceAwareCustomizer.java:50) > at > org.codehaus.groovy.control.customizers.builder.SourceAwareCustomizerFactory.postCompleteNode(SourceAwareCustomizerFactory.java:95) > at > org.codehaus.groovy.control.customizers.builder.CompilerCustomizationBuilder.postNodeCompletion(CompilerCustomizationBuilder.groovy:48) > at > groovy.util.FactoryBuilderSupport.dispatchNodeCall(FactoryBuilderSupport.java:903) > at > groovy.util.FactoryBuilderSupport.doInvokeMethod(FactoryBuilderSupport.java:787) > at > groovy.util.FactoryBuilderSupport.invokeMethod(FactoryBuilderSupport.java:507) > at > org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeOnDelegationObjects(ClosureMetaClass.java:413) > at > org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:337) > at > org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:64) > at > org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51) > at > org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:156) > at > org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:176) > at config$_run_closure1.doCall(config.groovy:4) > at config$_run_closure1.doCall(config.groovy) > ... > {code} > Could the SourceAwareCustomizerFactory be more forgiving and supply a "no-op" > CompilationCustomizer in newInstance? > {code} > public Object newInstance(final FactoryBuilderSupport builder, final > Object name, final Object value, final Map attributes) throws > InstantiationException, IllegalAccessException { > SourceOptions data = new SourceOptions(); > if (value instanceof CompilationCustomizer) { > data.delegate = (CompilationCustomizer) value; > } > // add > else { > data.delegate = new CompilationCustomizer(0) {}; > } > // end > return data; > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Comment Edited] (GROOVY-9059) Failed to parse/compile generic methods with "extends"
[ https://issues.apache.org/jira/browse/GROOVY-9059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16822125#comment-16822125 ] Eric Milles edited comment on GROOVY-9059 at 4/19/19 6:58 PM: -- So by including the generics of {{oldMethod}}, {{equalParametersWithGenerics}} can get from {{O -> Object}} to {{O -> T -> Object}}. Since {{genericsSpec}} is only used to convert types from {{oldMethod}}, I removed the existing call {{addMethodGenerics(overridingMethod, genericsSpec)}}. {code:java} // org.codehaus.groovy.classgen.Verifier private MethodNode getCovariantImplementation(final MethodNode oldMethod, final MethodNode overridingMethod, Map genericsSpec, boolean ignoreError) { // method name if (!oldMethod.getName().equals(overridingMethod.getName())) return null; if ((overridingMethod.getModifiers() & ACC_BRIDGE) != 0) return null; if (oldMethod.isPrivate()) return null; // GRECLIPSE add -- GROOVY-9059 genericsSpec = GenericsUtils.addMethodGenerics(oldMethod, genericsSpec); // GRECLIPSE end // parameters boolean normalEqualParameters = equalParametersNormal(overridingMethod, oldMethod); boolean genericEqualParameters = equalParametersWithGenerics(overridingMethod, oldMethod, genericsSpec); if (!normalEqualParameters && !genericEqualParameters) return null; /* GRECLIPSE edit -- GROOVY-9059 //correct to method level generics for the overriding method genericsSpec = GenericsUtils.addMethodGenerics(overridingMethod, genericsSpec); */ // return type ClassNode mr = overridingMethod.getReturnType(); ClassNode omr = oldMethod.getReturnType(); boolean equalReturnType = mr.equals(omr); ClassNode testmr = correctToGenericsSpec(genericsSpec, omr); {code} >From there, it needs some help to use the entry {{T=T->java.lang.String}} from >{{genericsSpec}}. I did it using a special method from ClassNode that was >introduced for a previous fix: {code:java} // org.codehaus.groovy.ast.tools.GenericsUtils public static ClassNode correctToGenericsSpec(Map genericsSpec, ClassNode type) { if (type.isArray()) { return correctToGenericsSpec(genericsSpec, type.getComponentType()).makeArray(); } if (type.isGenericsPlaceHolder()) { String name = type.getGenericsTypes()[0].getName(); type = genericsSpec.get(name); // GRECLIPSE add -- GROOVY-9059 if (type != null && type.isGenericsPlaceHolder()) { type = type.asGenericsType().getUpperBounds()[0]; return correctToGenericsSpec(genericsSpec, type); } // GRECLIPSE end } if (type == null) type = ClassHelper.OBJECT_TYPE; return type; } {code} {code:java} // org.codehaus.groovy.ast.ClassNode public GenericsType asGenericsType() { if (!isGenericsPlaceHolder()) { return new GenericsType(this); } else { ClassNode upper = (redirect != null ? redirect : this); return new GenericsType(this, new ClassNode[]{upper}, null); } } {code} With that in place, you can do this without error: {code:groovy} class Why implements Y { @Override public CS foo(CS cs) { cs } } // or def why = new Y() { @Override public CS foo(CS cs) { cs } } {code} However, your example of using String and no method generics still produces 1 error (from groovyc) and 1 warning (from eclipse): 1. Method 'foo' from class 'Bar$1' does not override method from its superclass or interfaces but is annotated with @Override. 2. The return type String for foo(String) from the type new Y(){} needs unchecked conversion to conform to O from the type Y was (Author: emilles): So by including the generics of {{oldMethod}}, {{equalParametersWithGenerics}} can get from {{O -> Object}} to {{O -> T -> Object}}. Since {{genericsSpec}} is only used to convert types from {{oldMethod}}, I removed the existing call {{addMethodGenerics(overridingMethod, genericsSpec)}}. {code:java} // org.codehaus.groovy.classgen.Verifier private MethodNode getCovariantImplementation(final MethodNode oldMethod, final MethodNode overridingMethod, Map genericsSpec, boolean ignoreError) { // method name if (!oldMethod.getName().equals(overridingMethod.getName())) return null; if ((overridingMethod.getModifiers() & ACC_BRIDGE) != 0) return null; if (oldMethod.isPrivate()) return null; // GRECLIPSE add -- GROOVY-9059 genericsSpec = GenericsUtils.addMethodGenerics(oldMethod, genericsSpec); // GRECLIPSE end // parameters boolean normalEqualParameters = equalParametersNormal(overridingMethod, oldMethod); boolean genericEqualParameters =
[jira] [Comment Edited] (GROOVY-9059) Failed to parse/compile generic methods with "extends"
[ https://issues.apache.org/jira/browse/GROOVY-9059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16822125#comment-16822125 ] Eric Milles edited comment on GROOVY-9059 at 4/19/19 6:42 PM: -- So by including the generics of {{oldMethod}}, {{equalParametersWithGenerics}} can get from {{O -> Object}} to {{O -> T -> Object}}. Since {{genericsSpec}} is only used to convert types from {{oldMethod}}, I removed the existing call {{addMethodGenerics(overridingMethod, genericsSpec)}}. {code:java} // org.codehaus.groovy.classgen.Verifier private MethodNode getCovariantImplementation(final MethodNode oldMethod, final MethodNode overridingMethod, Map genericsSpec, boolean ignoreError) { // method name if (!oldMethod.getName().equals(overridingMethod.getName())) return null; if ((overridingMethod.getModifiers() & ACC_BRIDGE) != 0) return null; if (oldMethod.isPrivate()) return null; // GRECLIPSE add -- GROOVY-9059 genericsSpec = GenericsUtils.addMethodGenerics(oldMethod, genericsSpec); // GRECLIPSE end // parameters boolean normalEqualParameters = equalParametersNormal(overridingMethod, oldMethod); boolean genericEqualParameters = equalParametersWithGenerics(overridingMethod, oldMethod, genericsSpec); if (!normalEqualParameters && !genericEqualParameters) return null; /* GRECLIPSE edit -- GROOVY-9059 //correct to method level generics for the overriding method genericsSpec = GenericsUtils.addMethodGenerics(overridingMethod, genericsSpec); */ // return type ClassNode mr = overridingMethod.getReturnType(); ClassNode omr = oldMethod.getReturnType(); boolean equalReturnType = mr.equals(omr); ClassNode testmr = correctToGenericsSpec(genericsSpec, omr); {code} >From there, it needs some help to use the entry {{T=T->java.lang.String}} from >{{genericsSpec}}. I did it using a special method from ClassNode that was >introduced for a previous fix: {code:java} // org.codehaus.groovy.ast.tools.GenericsUtils public static ClassNode correctToGenericsSpec(Map genericsSpec, ClassNode type) { if (type.isArray()) { return correctToGenericsSpec(genericsSpec, type.getComponentType()).makeArray(); } if (type.isGenericsPlaceHolder()) { String name = type.getGenericsTypes()[0].getName(); type = genericsSpec.get(name); // GRECLIPSE add -- GROOVY-9059 if (type != null && type.isGenericsPlaceHolder()) { type = type.asGenericsType().getUpperBounds()[0]; return correctToGenericsSpec(genericsSpec, type); } // GRECLIPSE end } if (type == null) type = ClassHelper.OBJECT_TYPE; return type; } {code} {code:java} // org.codehaus.groovy.ast.ClassNode public GenericsType asGenericsType() { if (!isGenericsPlaceHolder()) { return new GenericsType(this); } else { ClassNode upper = (redirect != null ? redirect : this); return new GenericsType(this, new ClassNode[]{upper}, null); } } {code} With that in place, you can do this without error: {code:groovy} class Why implements Y { @Override public CS foo(CS s) { s } } // or def why = new Y() { @Override public CS foo(CS s) { s } } {code} However, your example of using String and no method generics still produces 1 error (from groovyc) and 1 warning (from eclipse): 1. Method 'foo' from class 'Bar$1' does not override method from its superclass or interfaces but is annotated with @Override. 2. The return type String for foo(String) from the type new Y(){} needs unchecked conversion to conform to O from the type Y was (Author: emilles): So by including the generics of {{oldMethod}}, {{equalParametersWithGenerics}} can get from {{O -> Object}} to {{O -> T -> Object}}. Since {{genericsSpec}} is only used to convert types from {{oldMethod}}, I removed the existing call {{addMethodGenerics(overridingMethod, genericsSpec)}}. {code:java} // org.codehaus.groovy.classgen.Verifier private MethodNode getCovariantImplementation(final MethodNode oldMethod, final MethodNode overridingMethod, Map genericsSpec, boolean ignoreError) { // method name if (!oldMethod.getName().equals(overridingMethod.getName())) return null; if ((overridingMethod.getModifiers() & ACC_BRIDGE) != 0) return null; if (oldMethod.isPrivate()) return null; // GRECLIPSE add -- GROOVY-9059 genericsSpec = GenericsUtils.addMethodGenerics(oldMethod, genericsSpec); // GRECLIPSE end // parameters boolean normalEqualParameters = equalParametersNormal(overridingMethod, oldMethod); boolean genericEqualParameters =
[jira] [Commented] (GROOVY-9059) Failed to parse/compile generic methods with "extends"
[ https://issues.apache.org/jira/browse/GROOVY-9059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16822125#comment-16822125 ] Eric Milles commented on GROOVY-9059: - So by including the generics of {{oldMethod}}, {{equalParametersWithGenerics}} can get from {{O -> Object}} to {{O -> T -> Object}}. Since {{genericsSpec}} is only used to convert types from {{oldMethod}}, I removed the existing call {{addMethodGenerics(overridingMethod, genericsSpec)}}. {code:java} // org.codehaus.groovy.classgen.Verifier private MethodNode getCovariantImplementation(final MethodNode oldMethod, final MethodNode overridingMethod, Map genericsSpec, boolean ignoreError) { // method name if (!oldMethod.getName().equals(overridingMethod.getName())) return null; if ((overridingMethod.getModifiers() & ACC_BRIDGE) != 0) return null; if (oldMethod.isPrivate()) return null; // GRECLIPSE add -- GROOVY-9059 genericsSpec = GenericsUtils.addMethodGenerics(oldMethod, genericsSpec); // GRECLIPSE end // parameters boolean normalEqualParameters = equalParametersNormal(overridingMethod, oldMethod); boolean genericEqualParameters = equalParametersWithGenerics(overridingMethod, oldMethod, genericsSpec); if (!normalEqualParameters && !genericEqualParameters) return null; /* GRECLIPSE edit -- GROOVY-9059 //correct to method level generics for the overriding method genericsSpec = GenericsUtils.addMethodGenerics(overridingMethod, genericsSpec); */ // return type ClassNode mr = overridingMethod.getReturnType(); ClassNode omr = oldMethod.getReturnType(); boolean equalReturnType = mr.equals(omr); ClassNode testmr = correctToGenericsSpec(genericsSpec, omr); {code} >From there, it needs some help to use the entry {{T=T->java.lang.String}} from >{{genericsSpec}}. I did it using a special method from ClassNode that was >introduced for a previous fix: {code:java} // org.codehaus.groovy.ast.tools.GenericsUtils public static ClassNode correctToGenericsSpec(Map genericsSpec, ClassNode type) { if (type.isArray()) { return correctToGenericsSpec(genericsSpec, type.getComponentType()).makeArray(); } if (type.isGenericsPlaceHolder()) { String name = type.getGenericsTypes()[0].getName(); type = genericsSpec.get(name); // GRECLIPSE add -- GROOVY-9059 if (type != null && type.isGenericsPlaceHolder()) { type = type.asGenericsType().getUpperBounds()[0]; return correctToGenericsSpec(genericsSpec, type); } // GRECLIPSE end } if (type == null) type = ClassHelper.OBJECT_TYPE; return type; } {code} {code:java} // org.codehaus.groovy.ast.ClassNode public GenericsType asGenericsType() { if (!isGenericsPlaceHolder()) { return new GenericsType(this); } else { ClassNode upper = (redirect != null ? redirect : this); return new GenericsType(this, new ClassNode[]{upper}, null); } } {code} With that in place, you can do this without error: {code:groovy} class Why implements Y { @Override public CS foo(CS s) { s } } // or def why = new Y() { @Override public CS foo(CS s) { s } } {code} However, your example of using String and no method generics still produces 1 errors (from groovyc) and 1 warning (from eclipse): 1. Method 'foo' from class 'Bar$1' does not override method from its superclass or interfaces but is annotated with @Override. 2. The return type String for foo(String) from the type new Y(){} needs unchecked conversion to conform to O from the type Y > Failed to parse/compile generic methods with "extends" > -- > > Key: GROOVY-9059 > URL: https://issues.apache.org/jira/browse/GROOVY-9059 > Project: Groovy > Issue Type: Bug > Components: Static compilation >Affects Versions: 2.4.16, 3.0.0-alpha-4, 2.5.6 >Reporter: Xiaoguang Wang >Priority: Major > Attachments: image-2019-03-30-13-10-20-819.png > > > > {code:java} > import groovy.transform.CompileStatic > // This bug affects: groovy-2.4.16, groovy-2.5.6, groovy-3.0.0-alpha-4 > // This bug also affect IDEA's syntax parser > interface X { > // Intellij IDEA reports that 'public' is not necessary > // BUT without the 'public' modifier, there is a syntax error > public T foo(T o); > } > interface Y { > public O foo(O o); > } > @CompileStatic > class TestGroovyGeneric { > static void main(String[] args) { > def x = new X() { > // it compiles > // BUT: Intellij IDEA reports: ERROR: Method 'foo' is not > implemented >
[jira] [Issue Comment Deleted] (GROOVY-9059) Failed to parse/compile generic methods with "extends"
[ https://issues.apache.org/jira/browse/GROOVY-9059?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Eric Milles updated GROOVY-9059: Comment: was deleted (was: {code:java} private MethodNode getCovariantImplementation(final MethodNode oldMethod, final MethodNode overridingMethod, Map genericsSpec, boolean ignoreError) { // method name if (!oldMethod.getName().equals(overridingMethod.getName())) return null; if ((overridingMethod.getModifiers() & ACC_BRIDGE) != 0) return null; if (oldMethod.isPrivate()) return null; // GRECLIPSE add -- GROOVY-9059 // correct to method level generics for the overriding method genericsSpec = GenericsUtils.addMethodGenerics(overridingMethod, genericsSpec); // GRECLIPSE end // parameters boolean normalEqualParameters = equalParametersNormal(overridingMethod, oldMethod); boolean genericEqualParameters = equalParametersWithGenerics(overridingMethod, oldMethod, genericsSpec); if (!normalEqualParameters && !genericEqualParameters) return null; /* GRECLIPSE edit -- GROOVY-9059 //correct to method level generics for the overriding method genericsSpec = GenericsUtils.addMethodGenerics(overridingMethod, genericsSpec); */ {code}) > Failed to parse/compile generic methods with "extends" > -- > > Key: GROOVY-9059 > URL: https://issues.apache.org/jira/browse/GROOVY-9059 > Project: Groovy > Issue Type: Bug > Components: Static compilation >Affects Versions: 2.4.16, 3.0.0-alpha-4, 2.5.6 >Reporter: Xiaoguang Wang >Priority: Major > Attachments: image-2019-03-30-13-10-20-819.png > > > > {code:java} > import groovy.transform.CompileStatic > // This bug affects: groovy-2.4.16, groovy-2.5.6, groovy-3.0.0-alpha-4 > // This bug also affect IDEA's syntax parser > interface X { > // Intellij IDEA reports that 'public' is not necessary > // BUT without the 'public' modifier, there is a syntax error > public T foo(T o); > } > interface Y { > public O foo(O o); > } > @CompileStatic > class TestGroovyGeneric { > static void main(String[] args) { > def x = new X() { > // it compiles > // BUT: Intellij IDEA reports: ERROR: Method 'foo' is not > implemented > @Override > String foo(String o) { return o } > } > // Strangely, such code compiles > // BUT: Intellij IDEA reports: ERROR: Method 'foo' is not implemented > def y1 = new Y() { > @Override > public String foo(String o) { return o } > } > // Can not compile: > // BUT: Intellij IDEA reports no error > def y2 = new Y() { > @Override > String foo(String o) { return o } > } > } > } > {code} > !image-2019-03-30-13-10-20-819.png! > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Issue Comment Deleted] (GROOVY-9059) Failed to parse/compile generic methods with "extends"
[ https://issues.apache.org/jira/browse/GROOVY-9059?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Eric Milles updated GROOVY-9059: Comment: was deleted (was: Just after this, the method generics spec is loaded: {code} genericsSpec = GenericsUtils.addMethodGenerics(overridingMethod, genericsSpec); {code} This is probably needed to correctly determine covariance.) > Failed to parse/compile generic methods with "extends" > -- > > Key: GROOVY-9059 > URL: https://issues.apache.org/jira/browse/GROOVY-9059 > Project: Groovy > Issue Type: Bug > Components: Static compilation >Affects Versions: 2.4.16, 3.0.0-alpha-4, 2.5.6 >Reporter: Xiaoguang Wang >Priority: Major > Attachments: image-2019-03-30-13-10-20-819.png > > > > {code:java} > import groovy.transform.CompileStatic > // This bug affects: groovy-2.4.16, groovy-2.5.6, groovy-3.0.0-alpha-4 > // This bug also affect IDEA's syntax parser > interface X { > // Intellij IDEA reports that 'public' is not necessary > // BUT without the 'public' modifier, there is a syntax error > public T foo(T o); > } > interface Y { > public O foo(O o); > } > @CompileStatic > class TestGroovyGeneric { > static void main(String[] args) { > def x = new X() { > // it compiles > // BUT: Intellij IDEA reports: ERROR: Method 'foo' is not > implemented > @Override > String foo(String o) { return o } > } > // Strangely, such code compiles > // BUT: Intellij IDEA reports: ERROR: Method 'foo' is not implemented > def y1 = new Y() { > @Override > public String foo(String o) { return o } > } > // Can not compile: > // BUT: Intellij IDEA reports no error > def y2 = new Y() { > @Override > String foo(String o) { return o } > } > } > } > {code} > !image-2019-03-30-13-10-20-819.png! > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Comment Edited] (GROOVY-9059) Failed to parse/compile generic methods with "extends"
[ https://issues.apache.org/jira/browse/GROOVY-9059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16822059#comment-16822059 ] Eric Milles edited comment on GROOVY-9059 at 4/19/19 5:03 PM: -- {code:java} private MethodNode getCovariantImplementation(final MethodNode oldMethod, final MethodNode overridingMethod, Map genericsSpec, boolean ignoreError) { // method name if (!oldMethod.getName().equals(overridingMethod.getName())) return null; if ((overridingMethod.getModifiers() & ACC_BRIDGE) != 0) return null; if (oldMethod.isPrivate()) return null; // GRECLIPSE add -- GROOVY-9059 // correct to method level generics for the overriding method genericsSpec = GenericsUtils.addMethodGenerics(overridingMethod, genericsSpec); // GRECLIPSE end // parameters boolean normalEqualParameters = equalParametersNormal(overridingMethod, oldMethod); boolean genericEqualParameters = equalParametersWithGenerics(overridingMethod, oldMethod, genericsSpec); if (!normalEqualParameters && !genericEqualParameters) return null; /* GRECLIPSE edit -- GROOVY-9059 //correct to method level generics for the overriding method genericsSpec = GenericsUtils.addMethodGenerics(overridingMethod, genericsSpec); */ {code} was (Author: emilles): {code:java} private MethodNode getCovariantImplementation(final MethodNode oldMethod, final MethodNode overridingMethod, Map genericsSpec, boolean ignoreError) { // method name if (!oldMethod.getName().equals(overridingMethod.getName())) return null; if ((overridingMethod.getModifiers() & ACC_BRIDGE) != 0) return null; if (oldMethod.isPrivate()) return null; // GRECLIPSE add -- GROOVY-9059 genericsSpec = GenericsUtils.addMethodGenerics(overridingMethod, genericsSpec); // GRECLIPSE end // parameters boolean normalEqualParameters = equalParametersNormal(overridingMethod, oldMethod); boolean genericEqualParameters = equalParametersWithGenerics(overridingMethod, oldMethod, genericsSpec); if (!normalEqualParameters && !genericEqualParameters) return null; /* GRECLIPSE edit -- GROOVY-9059 //correct to method level generics for the overriding method genericsSpec = GenericsUtils.addMethodGenerics(overridingMethod, genericsSpec); */ {code} > Failed to parse/compile generic methods with "extends" > -- > > Key: GROOVY-9059 > URL: https://issues.apache.org/jira/browse/GROOVY-9059 > Project: Groovy > Issue Type: Bug > Components: Static compilation >Affects Versions: 2.4.16, 3.0.0-alpha-4, 2.5.6 >Reporter: Xiaoguang Wang >Priority: Major > Attachments: image-2019-03-30-13-10-20-819.png > > > > {code:java} > import groovy.transform.CompileStatic > // This bug affects: groovy-2.4.16, groovy-2.5.6, groovy-3.0.0-alpha-4 > // This bug also affect IDEA's syntax parser > interface X { > // Intellij IDEA reports that 'public' is not necessary > // BUT without the 'public' modifier, there is a syntax error > public T foo(T o); > } > interface Y { > public O foo(O o); > } > @CompileStatic > class TestGroovyGeneric { > static void main(String[] args) { > def x = new X() { > // it compiles > // BUT: Intellij IDEA reports: ERROR: Method 'foo' is not > implemented > @Override > String foo(String o) { return o } > } > // Strangely, such code compiles > // BUT: Intellij IDEA reports: ERROR: Method 'foo' is not implemented > def y1 = new Y() { > @Override > public String foo(String o) { return o } > } > // Can not compile: > // BUT: Intellij IDEA reports no error > def y2 = new Y() { > @Override > String foo(String o) { return o } > } > } > } > {code} > !image-2019-03-30-13-10-20-819.png! > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (GROOVY-9059) Failed to parse/compile generic methods with "extends"
[ https://issues.apache.org/jira/browse/GROOVY-9059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16822059#comment-16822059 ] Eric Milles commented on GROOVY-9059: - {code:java} private MethodNode getCovariantImplementation(final MethodNode oldMethod, final MethodNode overridingMethod, Map genericsSpec, boolean ignoreError) { // method name if (!oldMethod.getName().equals(overridingMethod.getName())) return null; if ((overridingMethod.getModifiers() & ACC_BRIDGE) != 0) return null; if (oldMethod.isPrivate()) return null; // GRECLIPSE add -- GROOVY-9059 genericsSpec = GenericsUtils.addMethodGenerics(overridingMethod, genericsSpec); // GRECLIPSE end // parameters boolean normalEqualParameters = equalParametersNormal(overridingMethod, oldMethod); boolean genericEqualParameters = equalParametersWithGenerics(overridingMethod, oldMethod, genericsSpec); if (!normalEqualParameters && !genericEqualParameters) return null; /* GRECLIPSE edit -- GROOVY-9059 //correct to method level generics for the overriding method genericsSpec = GenericsUtils.addMethodGenerics(overridingMethod, genericsSpec); */ {code} > Failed to parse/compile generic methods with "extends" > -- > > Key: GROOVY-9059 > URL: https://issues.apache.org/jira/browse/GROOVY-9059 > Project: Groovy > Issue Type: Bug > Components: Static compilation >Affects Versions: 2.4.16, 3.0.0-alpha-4, 2.5.6 >Reporter: Xiaoguang Wang >Priority: Major > Attachments: image-2019-03-30-13-10-20-819.png > > > > {code:java} > import groovy.transform.CompileStatic > // This bug affects: groovy-2.4.16, groovy-2.5.6, groovy-3.0.0-alpha-4 > // This bug also affect IDEA's syntax parser > interface X { > // Intellij IDEA reports that 'public' is not necessary > // BUT without the 'public' modifier, there is a syntax error > public T foo(T o); > } > interface Y { > public O foo(O o); > } > @CompileStatic > class TestGroovyGeneric { > static void main(String[] args) { > def x = new X() { > // it compiles > // BUT: Intellij IDEA reports: ERROR: Method 'foo' is not > implemented > @Override > String foo(String o) { return o } > } > // Strangely, such code compiles > // BUT: Intellij IDEA reports: ERROR: Method 'foo' is not implemented > def y1 = new Y() { > @Override > public String foo(String o) { return o } > } > // Can not compile: > // BUT: Intellij IDEA reports no error > def y2 = new Y() { > @Override > String foo(String o) { return o } > } > } > } > {code} > !image-2019-03-30-13-10-20-819.png! > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (GROOVY-9059) Failed to parse/compile generic methods with "extends"
[ https://issues.apache.org/jira/browse/GROOVY-9059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16822054#comment-16822054 ] Eric Milles commented on GROOVY-9059: - Just after this, the method generics spec is loaded: {code} genericsSpec = GenericsUtils.addMethodGenerics(overridingMethod, genericsSpec); {code} This is probably needed to correctly determine covariance. > Failed to parse/compile generic methods with "extends" > -- > > Key: GROOVY-9059 > URL: https://issues.apache.org/jira/browse/GROOVY-9059 > Project: Groovy > Issue Type: Bug > Components: Static compilation >Affects Versions: 2.4.16, 3.0.0-alpha-4, 2.5.6 >Reporter: Xiaoguang Wang >Priority: Major > Attachments: image-2019-03-30-13-10-20-819.png > > > > {code:java} > import groovy.transform.CompileStatic > // This bug affects: groovy-2.4.16, groovy-2.5.6, groovy-3.0.0-alpha-4 > // This bug also affect IDEA's syntax parser > interface X { > // Intellij IDEA reports that 'public' is not necessary > // BUT without the 'public' modifier, there is a syntax error > public T foo(T o); > } > interface Y { > public O foo(O o); > } > @CompileStatic > class TestGroovyGeneric { > static void main(String[] args) { > def x = new X() { > // it compiles > // BUT: Intellij IDEA reports: ERROR: Method 'foo' is not > implemented > @Override > String foo(String o) { return o } > } > // Strangely, such code compiles > // BUT: Intellij IDEA reports: ERROR: Method 'foo' is not implemented > def y1 = new Y() { > @Override > public String foo(String o) { return o } > } > // Can not compile: > // BUT: Intellij IDEA reports no error > def y2 = new Y() { > @Override > String foo(String o) { return o } > } > } > } > {code} > !image-2019-03-30-13-10-20-819.png! > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Comment Edited] (GROOVY-9076) Debugger Step Into doesn't work in Groovy-compiled classes
[ https://issues.apache.org/jira/browse/GROOVY-9076?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16822047#comment-16822047 ] Eric Milles edited comment on GROOVY-9076 at 4/19/19 4:47 PM: -- You can add a compiler config script with the following contents: {code} configuration.optimizationOptions.'int' = false //configuration.optimizationOptions.indy = true {code} Either line will disable the "int" optimization. Or you can disable directly in build.gradle: {code} compileGroovy { groovyOptions.optimizationOptions.'int' = false //groovyOptions.optimizationOptions.indy = true //groovyOptions.configurationScript = file('src/groovyCompile/config.groovy') } {code} was (Author: emilles): You can add a compiler config script with the following contents: {code} configuration.optimizationOptions.'int' = false //configuration.optimizationOptions.indy = true {code} Either line will disable the "int" optimization. > Debugger Step Into doesn't work in Groovy-compiled classes > -- > > Key: GROOVY-9076 > URL: https://issues.apache.org/jira/browse/GROOVY-9076 > Project: Groovy > Issue Type: Bug >Affects Versions: 2.5.6 > Environment: $ java -version > java version "1.8.0_211" > Java(TM) SE Runtime Environment (build 1.8.0_211-b12) > Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode) >Reporter: Daniil Ovchinnikov >Priority: Blocker > > Please see https://github.com/dovchinnikov/debug-groovy-bug > {code:title=GC.groovy} > package foo.bar > class GC { > GC() { > int i = 42 > } > int getStuff() { > return 70 > } > } > {code} > {code:title=GMain.groovy} > package foo.bar > class GMain { > static void main(String[] args) { > new GC().stuff // set breakpoint here > } > } > {code} > This issue is reproducible with plain raw jdb: > {noformat} > $ ./gradlew clean classes > $ jdb -classpath build/classes/groovy/main: > {noformat} > Inside jdb prompt: > {noformat} > > sourcepath src/main/groovy > > exclude > > java.*,sun.*,com.sun.*,groovy.*,org.codehaus.groovy.*,org.apache.groovy.* > > stop in foo.bar.GMain.main > > run foo.bar.GMain > {noformat} > Then {{step}} until the end and observe the behaviour. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (GROOVY-9076) Debugger Step Into doesn't work in Groovy-compiled classes
[ https://issues.apache.org/jira/browse/GROOVY-9076?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16822047#comment-16822047 ] Eric Milles commented on GROOVY-9076: - You can add a compiler config script with the following contents: {code} configuration.optimizationOptions.'int' = false //configuration.optimizationOptions.indy = true {code} Either line will disable the "int" optimization. > Debugger Step Into doesn't work in Groovy-compiled classes > -- > > Key: GROOVY-9076 > URL: https://issues.apache.org/jira/browse/GROOVY-9076 > Project: Groovy > Issue Type: Bug >Affects Versions: 2.5.6 > Environment: $ java -version > java version "1.8.0_211" > Java(TM) SE Runtime Environment (build 1.8.0_211-b12) > Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode) >Reporter: Daniil Ovchinnikov >Priority: Blocker > > Please see https://github.com/dovchinnikov/debug-groovy-bug > {code:title=GC.groovy} > package foo.bar > class GC { > GC() { > int i = 42 > } > int getStuff() { > return 70 > } > } > {code} > {code:title=GMain.groovy} > package foo.bar > class GMain { > static void main(String[] args) { > new GC().stuff // set breakpoint here > } > } > {code} > This issue is reproducible with plain raw jdb: > {noformat} > $ ./gradlew clean classes > $ jdb -classpath build/classes/groovy/main: > {noformat} > Inside jdb prompt: > {noformat} > > sourcepath src/main/groovy > > exclude > > java.*,sun.*,com.sun.*,groovy.*,org.codehaus.groovy.*,org.apache.groovy.* > > stop in foo.bar.GMain.main > > run foo.bar.GMain > {noformat} > Then {{step}} until the end and observe the behaviour. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (GROOVY-9076) Debugger Step Into doesn't work in Groovy-compiled classes
[ https://issues.apache.org/jira/browse/GROOVY-9076?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16822044#comment-16822044 ] Daniil Ovchinnikov commented on GROOVY-9076: [~emilles] what's the "int" optimization and how to disable it? > Debugger Step Into doesn't work in Groovy-compiled classes > -- > > Key: GROOVY-9076 > URL: https://issues.apache.org/jira/browse/GROOVY-9076 > Project: Groovy > Issue Type: Bug >Affects Versions: 2.5.6 > Environment: $ java -version > java version "1.8.0_211" > Java(TM) SE Runtime Environment (build 1.8.0_211-b12) > Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode) >Reporter: Daniil Ovchinnikov >Priority: Blocker > > Please see https://github.com/dovchinnikov/debug-groovy-bug > {code:title=GC.groovy} > package foo.bar > class GC { > GC() { > int i = 42 > } > int getStuff() { > return 70 > } > } > {code} > {code:title=GMain.groovy} > package foo.bar > class GMain { > static void main(String[] args) { > new GC().stuff // set breakpoint here > } > } > {code} > This issue is reproducible with plain raw jdb: > {noformat} > $ ./gradlew clean classes > $ jdb -classpath build/classes/groovy/main: > {noformat} > Inside jdb prompt: > {noformat} > > sourcepath src/main/groovy > > exclude > > java.*,sun.*,com.sun.*,groovy.*,org.codehaus.groovy.*,org.apache.groovy.* > > stop in foo.bar.GMain.main > > run foo.bar.GMain > {noformat} > Then {{step}} until the end and observe the behaviour. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (GROOVY-9059) Failed to parse/compile generic methods with "extends"
[ https://issues.apache.org/jira/browse/GROOVY-9059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16822042#comment-16822042 ] Eric Milles commented on GROOVY-9059: - This last line in {{Verifier.getCovariantImplementation}} fails to identify the link between {{String foo(String o)}} in the impl and {{ O foo(O o)}} in the interface. And so, without the covariant method, the abstract method errors are produced. {code:java} private MethodNode getCovariantImplementation(final MethodNode oldMethod, final MethodNode overridingMethod, Map genericsSpec, boolean ignoreError) { // method name if (!oldMethod.getName().equals(overridingMethod.getName())) return null; if ((overridingMethod.getModifiers() & ACC_BRIDGE) != 0) return null; if (oldMethod.isPrivate()) return null; // parameters boolean normalEqualParameters = equalParametersNormal(overridingMethod, oldMethod); boolean genericEqualParameters = equalParametersWithGenerics(overridingMethod, oldMethod, genericsSpec); {code} > Failed to parse/compile generic methods with "extends" > -- > > Key: GROOVY-9059 > URL: https://issues.apache.org/jira/browse/GROOVY-9059 > Project: Groovy > Issue Type: Bug > Components: Static compilation >Affects Versions: 2.4.16, 3.0.0-alpha-4, 2.5.6 >Reporter: Xiaoguang Wang >Priority: Major > Attachments: image-2019-03-30-13-10-20-819.png > > > > {code:java} > import groovy.transform.CompileStatic > // This bug affects: groovy-2.4.16, groovy-2.5.6, groovy-3.0.0-alpha-4 > // This bug also affect IDEA's syntax parser > interface X { > // Intellij IDEA reports that 'public' is not necessary > // BUT without the 'public' modifier, there is a syntax error > public T foo(T o); > } > interface Y { > public O foo(O o); > } > @CompileStatic > class TestGroovyGeneric { > static void main(String[] args) { > def x = new X() { > // it compiles > // BUT: Intellij IDEA reports: ERROR: Method 'foo' is not > implemented > @Override > String foo(String o) { return o } > } > // Strangely, such code compiles > // BUT: Intellij IDEA reports: ERROR: Method 'foo' is not implemented > def y1 = new Y() { > @Override > public String foo(String o) { return o } > } > // Can not compile: > // BUT: Intellij IDEA reports no error > def y2 = new Y() { > @Override > String foo(String o) { return o } > } > } > } > {code} > !image-2019-03-30-13-10-20-819.png! > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (GROOVY-9076) Debugger Step Into doesn't work in Groovy-compiled classes
[ https://issues.apache.org/jira/browse/GROOVY-9076?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16822034#comment-16822034 ] Daniil Ovchinnikov commented on GROOVY-9076: [~emilles] the issue is reproducible with class files produced by {{gradle clean classes}} > Debugger Step Into doesn't work in Groovy-compiled classes > -- > > Key: GROOVY-9076 > URL: https://issues.apache.org/jira/browse/GROOVY-9076 > Project: Groovy > Issue Type: Bug >Affects Versions: 2.5.6 > Environment: $ java -version > java version "1.8.0_211" > Java(TM) SE Runtime Environment (build 1.8.0_211-b12) > Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode) >Reporter: Daniil Ovchinnikov >Priority: Blocker > > Please see https://github.com/dovchinnikov/debug-groovy-bug > {code:title=GC.groovy} > package foo.bar > class GC { > GC() { > int i = 42 > } > int getStuff() { > return 70 > } > } > {code} > {code:title=GMain.groovy} > package foo.bar > class GMain { > static void main(String[] args) { > new GC().stuff // set breakpoint here > } > } > {code} > This issue is reproducible with plain raw jdb: > {noformat} > $ ./gradlew clean classes > $ jdb -classpath build/classes/groovy/main: > {noformat} > Inside jdb prompt: > {noformat} > > sourcepath src/main/groovy > > exclude > > java.*,sun.*,com.sun.*,groovy.*,org.codehaus.groovy.*,org.apache.groovy.* > > stop in foo.bar.GMain.main > > run foo.bar.GMain > {noformat} > Then {{step}} until the end and observe the behaviour. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Comment Edited] (GROOVY-9076) Debugger Step Into doesn't work in Groovy-compiled classes
[ https://issues.apache.org/jira/browse/GROOVY-9076?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16822008#comment-16822008 ] Eric Milles edited comment on GROOVY-9076 at 4/19/19 3:56 PM: -- How is the code compiled? That is, what are the groovyc settings used? I have found that using the "indy" option (or at least disabling the "int" optimization) instead of the default "fast-path" code generation yields simpler bytecode for the debugger to understand. In the default mode, most methods have two paths through them and both paths get assigned the line number information of the method. This tends to confuse the debugger. was (Author: emilles): How is the code compiled? That is, what are the groovyc settings used? I have found that using the "indy" option instead of the default "fast-path" code generation yields simpler bytecode for the debugger to understand. In the default mode, most methods have two paths through them and both paths get assigned the line number information of the method. This tends to confuse the debugger. > Debugger Step Into doesn't work in Groovy-compiled classes > -- > > Key: GROOVY-9076 > URL: https://issues.apache.org/jira/browse/GROOVY-9076 > Project: Groovy > Issue Type: Bug >Affects Versions: 2.5.6 > Environment: $ java -version > java version "1.8.0_211" > Java(TM) SE Runtime Environment (build 1.8.0_211-b12) > Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode) >Reporter: Daniil Ovchinnikov >Priority: Blocker > > Please see https://github.com/dovchinnikov/debug-groovy-bug > {code:title=GC.groovy} > package foo.bar > class GC { > GC() { > int i = 42 > } > int getStuff() { > return 70 > } > } > {code} > {code:title=GMain.groovy} > package foo.bar > class GMain { > static void main(String[] args) { > new GC().stuff // set breakpoint here > } > } > {code} > This issue is reproducible with plain raw jdb: > {noformat} > $ ./gradlew clean classes > $ jdb -classpath build/classes/groovy/main: > {noformat} > Inside jdb prompt: > {noformat} > > sourcepath src/main/groovy > > exclude > > java.*,sun.*,com.sun.*,groovy.*,org.codehaus.groovy.*,org.apache.groovy.* > > stop in foo.bar.GMain.main > > run foo.bar.GMain > {noformat} > Then {{step}} until the end and observe the behaviour. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (GROOVY-9076) Debugger Step Into doesn't work in Groovy-compiled classes
[ https://issues.apache.org/jira/browse/GROOVY-9076?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16822008#comment-16822008 ] Eric Milles commented on GROOVY-9076: - How is the code compiled? That is, what are the groovyc settings used? I have found that using the "indy" option instead of the default "fast-path" code generation yields simpler bytecode for the debugger to understand. In the default mode, most methods have two paths through them and both paths get assigned the line number information of the method. This tends to confuse the debugger. > Debugger Step Into doesn't work in Groovy-compiled classes > -- > > Key: GROOVY-9076 > URL: https://issues.apache.org/jira/browse/GROOVY-9076 > Project: Groovy > Issue Type: Bug >Affects Versions: 2.5.6 > Environment: $ java -version > java version "1.8.0_211" > Java(TM) SE Runtime Environment (build 1.8.0_211-b12) > Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode) >Reporter: Daniil Ovchinnikov >Priority: Blocker > > Please see https://github.com/dovchinnikov/debug-groovy-bug > {code:title=GC.groovy} > package foo.bar > class GC { > GC() { > int i = 42 > } > int getStuff() { > return 70 > } > } > {code} > {code:title=GMain.groovy} > package foo.bar > class GMain { > static void main(String[] args) { > new GC().stuff // set breakpoint here > } > } > {code} > This issue is reproducible with plain raw jdb: > {noformat} > $ ./gradlew clean classes > $ jdb -classpath build/classes/groovy/main: > {noformat} > Inside jdb prompt: > {noformat} > > sourcepath src/main/groovy > > exclude > > java.*,sun.*,com.sun.*,groovy.*,org.codehaus.groovy.*,org.apache.groovy.* > > stop in foo.bar.GMain.main > > run foo.bar.GMain > {noformat} > Then {{step}} until the end and observe the behaviour. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (GROOVY-9076) Debugger Step Into doesn't work in Groovy-compiled classes
[ https://issues.apache.org/jira/browse/GROOVY-9076?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Daniil Ovchinnikov updated GROOVY-9076: --- Description: Please see https://github.com/dovchinnikov/debug-groovy-bug {code:title=GC.groovy} package foo.bar class GC { GC() { int i = 42 } int getStuff() { return 70 } } {code} {code:title=GMain.groovy} package foo.bar class GMain { static void main(String[] args) { new GC().stuff // set breakpoint here } } {code} This issue is reproducible with plain raw jdb: {noformat} $ ./gradlew clean classes $ jdb -classpath build/classes/groovy/main: {noformat} Inside jdb prompt: {noformat} > sourcepath src/main/groovy > exclude > java.*,sun.*,com.sun.*,groovy.*,org.codehaus.groovy.*,org.apache.groovy.* > stop in foo.bar.GMain.main > run foo.bar.GMain {noformat} Then {{step}} until the end and observe the behaviour. was: Please see https://github.com/dovchinnikov/debug-groovy-bug {code:title=GC.groovy} package foo.bar class GC { GC() { int i = 42 } int getStuff() { return 70 } } {code} {code:title=GMain.groovy} package foo.bar class GMain { static void main(String[] args) { new GC().stuff // set breakpoint here } } {code} > Debugger Step Into doesn't work in Groovy-compiled classes > -- > > Key: GROOVY-9076 > URL: https://issues.apache.org/jira/browse/GROOVY-9076 > Project: Groovy > Issue Type: Bug >Affects Versions: 2.5.6 > Environment: $ java -version > java version "1.8.0_211" > Java(TM) SE Runtime Environment (build 1.8.0_211-b12) > Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode) >Reporter: Daniil Ovchinnikov >Priority: Blocker > > Please see https://github.com/dovchinnikov/debug-groovy-bug > {code:title=GC.groovy} > package foo.bar > class GC { > GC() { > int i = 42 > } > int getStuff() { > return 70 > } > } > {code} > {code:title=GMain.groovy} > package foo.bar > class GMain { > static void main(String[] args) { > new GC().stuff // set breakpoint here > } > } > {code} > This issue is reproducible with plain raw jdb: > {noformat} > $ ./gradlew clean classes > $ jdb -classpath build/classes/groovy/main: > {noformat} > Inside jdb prompt: > {noformat} > > sourcepath src/main/groovy > > exclude > > java.*,sun.*,com.sun.*,groovy.*,org.codehaus.groovy.*,org.apache.groovy.* > > stop in foo.bar.GMain.main > > run foo.bar.GMain > {noformat} > Then {{step}} until the end and observe the behaviour. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (GROOVY-9076) Debugger Step Into doesn't work in Groovy-compiled classes
[ https://issues.apache.org/jira/browse/GROOVY-9076?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Daniil Ovchinnikov updated GROOVY-9076: --- Environment: $ java -version java version "1.8.0_211" Java(TM) SE Runtime Environment (build 1.8.0_211-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode) > Debugger Step Into doesn't work in Groovy-compiled classes > -- > > Key: GROOVY-9076 > URL: https://issues.apache.org/jira/browse/GROOVY-9076 > Project: Groovy > Issue Type: Bug >Affects Versions: 2.5.6 > Environment: $ java -version > java version "1.8.0_211" > Java(TM) SE Runtime Environment (build 1.8.0_211-b12) > Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode) >Reporter: Daniil Ovchinnikov >Priority: Blocker > > Please see https://github.com/dovchinnikov/debug-groovy-bug > {code:title=GC.groovy} > package foo.bar > class GC { > GC() { > int i = 42 > } > int getStuff() { > return 70 > } > } > {code} > {code:title=GMain.groovy} > package foo.bar > class GMain { > static void main(String[] args) { > new GC().stuff // set breakpoint here > } > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (GROOVY-9091) Grape's @GrabConfig systemProperties set too late
[ https://issues.apache.org/jira/browse/GROOVY-9091?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Christian Bach updated GROOVY-9091: --- Description: This minimalistic example with {{@GrabConfig(systemProperties='ivy.message.logger.level=3')}} does not cause logging output to be produced, i.e. {{Grape.grab(...)}} does not execute with the additional systemProperties being set. {code} @GrabConfig(systemProperties='ivy.message.logger.level=3') @Grab(group='commons-lang', module='commons-lang', version='2.6') import org.apache.commons.lang.StringUtils assert StringUtils.name == 'org.apache.commons.lang.StringUtils' {code} On setting properties explicitly before the {{grab()}} in {{GrabAnnotationTransformation.java}} as done in the attached version of the class, it works as expected, but of course is not a proper fix ;) The properties are only set by the {{ResolveVisitor}} after the Ivy dependency resolution completed, which is too late for being effective for Grape grabbing dependencies. This bug is problematic in our enterprise setup where we try to configure proxy settings through a {{@GrabConfig(systemProperties='http.proxyHost=10.0.0.100,...}} annotation. was: This minimalistic example with {{@GrabConfig(systemProperties='ivy.message.logger.level=3')}} does not cause logging output to be produced, i.e. {{Grape.grab(...)}} does not execute with the additional systemProperties being set. {code} GrabConfig(systemProperties='ivy.message.logger.level=3') @Grab(group='commons-lang', module='commons-lang', version='2.6') import org.apache.commons.lang.StringUtils assert StringUtils.name == 'org.apache.commons.lang.StringUtils' {code} On setting properties explicitly before the {{grab()}} in {{GrabAnnotationTransformation.java}} as done in the attached version of the class, it works as expected, but of course is not a proper fix ;) The properties are only set by the {{ResolveVisitor}} after the Ivy dependency resolution completed, which is too late for being effective for Grape grabbing dependencies. This bug is problematic in our enterprise setup where we try to configure proxy settings through a {{@GrabConfig(systemProperties='http.proxyHost=10.0.0.100,...}} annotation. > Grape's @GrabConfig systemProperties set too late > - > > Key: GROOVY-9091 > URL: https://issues.apache.org/jira/browse/GROOVY-9091 > Project: Groovy > Issue Type: Bug > Components: Grape >Affects Versions: 2.5.6 >Reporter: Christian Bach >Priority: Major > Attachments: Screenshot 2019-04-18 at 19.46.23.png > > > This minimalistic example with > {{@GrabConfig(systemProperties='ivy.message.logger.level=3')}} does not cause > logging output to be produced, i.e. {{Grape.grab(...)}} does not execute with > the additional systemProperties being set. > {code} > @GrabConfig(systemProperties='ivy.message.logger.level=3') > @Grab(group='commons-lang', module='commons-lang', version='2.6') > import org.apache.commons.lang.StringUtils > assert StringUtils.name == 'org.apache.commons.lang.StringUtils' > {code} > On setting properties explicitly before the {{grab()}} in > {{GrabAnnotationTransformation.java}} as done in the attached version of the > class, it works as expected, but of course is not a proper fix ;) > The properties are only set by the {{ResolveVisitor}} after the Ivy > dependency resolution completed, which is too late for being effective for > Grape grabbing dependencies. > This bug is problematic in our enterprise setup where we try to configure > proxy settings through a > {{@GrabConfig(systemProperties='http.proxyHost=10.0.0.100,...}} annotation. -- This message was sent by Atlassian JIRA (v7.6.3#76005)