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 2020/07/14 03:47:25 UTC

[groovy] branch GROOVY_3_0_X updated: GROOVY-9643: Using Spock thrown() method causes IllegalAccessError for 2.0-M2-groovy-3.0 on JDK 8 with noverify switch

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch GROOVY_3_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/GROOVY_3_0_X by this push:
     new 864dace  GROOVY-9643: Using Spock thrown() method causes IllegalAccessError for 2.0-M2-groovy-3.0 on JDK 8 with noverify switch
864dace is described below

commit 864dace72c691fd6e0106bded36d724de888a9c0
Author: Paul King <pa...@asert.com.au>
AuthorDate: Tue Jul 14 13:47:07 2020 +1000

    GROOVY-9643: Using Spock thrown() method causes IllegalAccessError for 2.0-M2-groovy-3.0 on JDK 8 with noverify switch
---
 .../org/codehaus/groovy/runtime/callsite/GroovySunClassLoader.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/codehaus/groovy/runtime/callsite/GroovySunClassLoader.java b/src/main/java/org/codehaus/groovy/runtime/callsite/GroovySunClassLoader.java
index 3d504bf..0231c52 100644
--- a/src/main/java/org/codehaus/groovy/runtime/callsite/GroovySunClassLoader.java
+++ b/src/main/java/org/codehaus/groovy/runtime/callsite/GroovySunClassLoader.java
@@ -20,6 +20,7 @@ package org.codehaus.groovy.runtime.callsite;
 
 import org.codehaus.groovy.control.CompilerConfiguration;
 import org.codehaus.groovy.reflection.SunClassLoader;
+import org.codehaus.groovy.vmplugin.VMPluginFactory;
 import org.objectweb.asm.ClassReader;
 import org.objectweb.asm.ClassVisitor;
 import org.objectweb.asm.ClassWriter;
@@ -32,9 +33,10 @@ import java.security.PrivilegedAction;
 public class GroovySunClassLoader extends SunClassLoader {
 
     public static final SunClassLoader sunVM;
+    public static final boolean pre9 = VMPluginFactory.getPlugin().getVersion() < 9;
 
     static {
-        sunVM = AccessController.doPrivileged((PrivilegedAction<SunClassLoader>) () -> {
+        sunVM = pre9 ? null : AccessController.doPrivileged((PrivilegedAction<SunClassLoader>) () -> {
             try {
                 if (SunClassLoader.sunVM != null) {
                     return new GroovySunClassLoader();