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 04:40:41 UTC
[groovy] branch master updated: 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 master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new 263ae8f GROOVY-8972: CompilationUnit#createClassVisitor should use the class node resolver rather than the class loader directly
263ae8f is described below
commit 263ae8f26b554992ff517055211d6f09f86cca83
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 765bb9e..6d722ad 100644
--- a/src/main/java/org/codehaus/groovy/control/CompilationUnit.java
+++ b/src/main/java/org/codehaus/groovy/control/CompilationUnit.java
@@ -899,15 +899,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