You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2019/01/27 06:11:00 UTC
[groovy] 02/03: GROOVY-8972: CompilationUnit#createClassVisitor
should use the class node resolver rather than the class loader directly
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch GROOVY_2_5_X
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit d0563aab334212e5dd57bf83579ef5c252903961
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sun Jan 27 14:40:33 2019 +1000
GROOVY-8972: CompilationUnit#createClassVisitor should use the class node resolver rather than the class loader directly
---
.../java/org/codehaus/groovy/control/CompilationUnit.java | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/src/main/java/org/codehaus/groovy/control/CompilationUnit.java b/src/main/java/org/codehaus/groovy/control/CompilationUnit.java
index 5ecc461..5df90d9 100644
--- a/src/main/java/org/codehaus/groovy/control/CompilationUnit.java
+++ b/src/main/java/org/codehaus/groovy/control/CompilationUnit.java
@@ -893,15 +893,8 @@ public class CompilationUnit extends ProcessingUnit {
// try inner classes
cn = cu.getGeneratedInnerClass(name);
if (cn!=null) return cn;
- // try class loader classes
- try {
- cn = ClassHelper.make(
- cu.getClassLoader().loadClass(name,false,true),
- false);
- } catch (Exception e) {
- throw new GroovyBugError(e);
- }
- return cn;
+ ClassNodeResolver.LookupResult lookupResult = getClassNodeResolver().resolveName(name, CompilationUnit.this);
+ return lookupResult == null ? null : lookupResult.getClassNode();
}
private ClassNode getCommonSuperClassNode(ClassNode c, ClassNode d) {
// adapted from ClassWriter code