- 
    Type:
Bug
 - 
    Resolution: Unresolved
 - 
    Priority:
  P4                     
     - 
    None
 - 
    Affects Version/s: 8u241, 11.0.6
 - 
    Component/s: hotspot
 
                    When passing a PrivilegedExceptionAction object to AccessController.doPrivileged(PrivilegedAction<T> action), a java.lang.IncompatibleClassChangeError is expected.
Following jasm testcase can reveal the problem:
super public class a/se/java_security/MydoPriv
version 52:0
{
public Method "<init>":"()V" stack 1 locals 1 {
aload_0;
invokespecial Method a/se/java_security/MydoPriv."<init>":"()V";
return;
}
public static Method method:"()Ljava/lang/String;" stack 16 locals 4 {
invokestatic Method a/se/java_security/TestRIAccdoPriv."getPEA":"()Ljava/security/PrivilegedExceptionAction;";
invokestatic Method java/security/AccessController."doPrivileged":"(Ljava/security/PrivilegedAction;)Ljava/lang/Object;";
ldc String "FAILED: this should NOT be called";
areturn;
}
}
Output:
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_242-202001200720-b08)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.242-b08, mixed mode)
FAILED: this should NOT be called
            
Following jasm testcase can reveal the problem:
super public class a/se/java_security/MydoPriv
version 52:0
{
public Method "<init>":"()V" stack 1 locals 1 {
aload_0;
invokespecial Method a/se/java_security/MydoPriv."<init>":"()V";
return;
}
public static Method method:"()Ljava/lang/String;" stack 16 locals 4 {
invokestatic Method a/se/java_security/TestRIAccdoPriv."getPEA":"()Ljava/security/PrivilegedExceptionAction;";
invokestatic Method java/security/AccessController."doPrivileged":"(Ljava/security/PrivilegedAction;)Ljava/lang/Object;";
ldc String "FAILED: this should NOT be called";
areturn;
}
}
Output:
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_242-202001200720-b08)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.242-b08, mixed mode)
FAILED: this should NOT be called