[GitHub] [groovy] danielsun1106 commented on issue #924: [GROOVY-9109] GroovyShell: don't override classloader if parent is al…

2019-07-31 Thread GitBox
danielsun1106 commented on issue #924: [GROOVY-9109] GroovyShell: don't 
override classloader if parent is al…
URL: https://github.com/apache/groovy/pull/924#issuecomment-517058240
 
 
   We will merge PRs into branches, so just submit PRs to master ;-)
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [groovy] danielsun1106 commented on issue #923: [GROOVY-9109] GroovyShell: don't override classloader if parent is al…

2019-07-31 Thread GitBox
danielsun1106 commented on issue #923: [GROOVY-9109] GroovyShell: don't 
override classloader if parent is al…
URL: https://github.com/apache/groovy/pull/923#issuecomment-517056996
 
 
   Merged. Thanks!
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [groovy] danielsun1106 merged pull request #923: [GROOVY-9109] GroovyShell: don't override classloader if parent is al…

2019-07-31 Thread GitBox
danielsun1106 merged pull request #923: [GROOVY-9109] GroovyShell: don't 
override classloader if parent is al…
URL: https://github.com/apache/groovy/pull/923
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Commented] (GROOVY-9209) Compiler throws an exception in ClassNode#getTypeClass after checking ClassNode#isResolved

2019-07-31 Thread Daniil Ovchinnikov (JIRA)


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

Daniil Ovchinnikov commented on GROOVY-9209:


[~blackdrag] thank you for looking into this. 

bq. Maybe it would be more correct for DecompiledClassNode to not to return 
true for isResolved
That was my first thought, I'm not sure about semantics of isResolved. I seems 
that generally it's used to determine whether ClassNode is _resolved_, i.e. 
whether it's possible to obtain its methods or to obtain ClassNode for its 
super, etc, so I'd say DecompiledClassNode must return true if it was found and 
instantiated. 

bq. getTypeClass should be removed from ClassNode
I'd say this is the way, but it'll break AST transformations, so I'm not the 
right person to do it, so I'm leaving this up to you.

cc [~graemerocher1]

> Compiler throws an exception in ClassNode#getTypeClass after checking 
> ClassNode#isResolved
> --
>
> Key: GROOVY-9209
> URL: https://issues.apache.org/jira/browse/GROOVY-9209
> Project: Groovy
>  Issue Type: Bug
>  Components: Compiler
>Affects Versions: 2.5.6
> Environment: intellij idea
>Reporter: Daniil Ovchinnikov
>Priority: Critical
>
> {noformat}
> Error:Groovyc: While compiling mn-gorm-example.main: BUG! exception in phase 
> 'canonicalization' in source unit 
> '/Users/pditommaso/Projects/mn-gorm-example/src/main/groovy/example/gorm/Bootstrap.groovy'
>  JVM class can't be loaded for example.gorm.service.PersonService
>   at 
> org.codehaus.groovy.ast.decompiled.AsmReferenceResolver.resolveJvmClass(AsmReferenceResolver.java:86)
>   at 
> org.codehaus.groovy.ast.decompiled.DecompiledClassNode.getTypeClass(DecompiledClassNode.java:175)
>   at org.codehaus.groovy.ast.ClassNode.getTypeClass(ClassNode.java:1381)
>   at 
> io.micronaut.ast.groovy.InjectTransform$InjectVisitor.resolveParameterType(InjectTransform.groovy:1117)
> ...
> {noformat}
> {code:java|title=InjectVisitor#resolveParameterType}
> ClassNode parameterType = parameter.type
> if (parameterType.isResolved()) {
>   parameterType.typeClass // here 
> } else {
>   parameterType.name
> }
> {code}
> Code: [https://github.com/pditommaso/mn-gorm-example]
>  Steps to reproduce:
>  1. make sure the build is not delegated to Gradle in Preferences | Build, 
> Execution, Deployment | Build Tools | Gradle
>  2. rebuild project
>  3. make changes in Person.groovy and Bootstrap.groovy (to mark them as 
> subject for recompilation)
>  4. build project
> What happens with {{-Dgroovyc.asm.resolving.only=false}}:
>  1. Bootstrap.groovy and Person.groovy are added to 
> {{CompilationUnit#queuedSources}}
>  2. {{ResolveVisitor}} visits Bootstrap.groovy and tries to load PersonService
>  3. {{asmResolving}} flag is set to {{false}} by IntelliJ, this results in 
> skipping {{findDecompiled}} call inside 
> {{ClassNodeResolver#tryAsLoaderClassOrScript}}
>  4. the PersonService class fails to load because of missing Person class
>  5. {{tryAsScript}} kicks in and adds PersonService to 
> {{CompilationUnit#queuedSources}}
>  6. when it comes to Micronaut {{ClassNode#isResolved}} returns {{false}} for 
> PersonService
> What happens without {{-Dgroovyc.asm.resolving.only=false}}:
>  1. same
>  2. same
>  3. {{asmResolving}} is not set by IntellliJ
>  4. {{findDecompiled}} returns {{DecompiledClassNode}} for PersonService
>  5. when it comes to Micronaut {{ClassNode#isResolved}} returns {{true}} for 
> PersonService, and this results in an exception because the class cannot be 
> loaded actually.
> I've tried to fix it in the compiler but I'm not sure what's the proper fix 
> would be. 
>  Please let me know if I can do something within IntelliJ. 
>  The issue in JB YouTrack for the reference: 
> [https://youtrack.jetbrains.com/issue/IDEA-218698]



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)