You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2021/06/14 08:14:11 UTC
[groovy] branch danielsun/tweak-build updated: Fix illegal access
to `loadClass`
This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch danielsun/tweak-build
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/danielsun/tweak-build by this push:
new 7267398 Fix illegal access to `loadClass`
7267398 is described below
commit 72673988657e50caa94cf10e36ce819237dac28c
Author: Daniel Sun <su...@apache.org>
AuthorDate: Mon Jun 14 16:13:26 2021 +0800
Fix illegal access to `loadClass`
---
.../classloading/TransformsAndCustomClassLoadersTest.groovy | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/test/org/codehaus/groovy/transform/classloading/TransformsAndCustomClassLoadersTest.groovy b/src/test/org/codehaus/groovy/transform/classloading/TransformsAndCustomClassLoadersTest.groovy
index c04c371..4676486 100644
--- a/src/test/org/codehaus/groovy/transform/classloading/TransformsAndCustomClassLoadersTest.groovy
+++ b/src/test/org/codehaus/groovy/transform/classloading/TransformsAndCustomClassLoadersTest.groovy
@@ -137,7 +137,10 @@ class TransformsAndCustomClassLoadersTest extends GroovyTestCase {
}
if (name.startsWith("java.") || name.startsWith("groovy.")
|| name.startsWith("org.codehaus.groovy.") || name.startsWith("org.apache.groovy.")) {
- return getClass().classLoader.loadClass(name, resolve)
+ def loader = getClass().classLoader
+ def result = loader.loadClass(name)
+ if (resolve) loader.resolveClass(result)
+ return result
}
throw new ClassNotFoundException(name)
}