-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.2.0
-
sparc
-
solaris_2.5.1
Name: akC45999 Date: 08/21/98
The section "6.4 The Java Virtual Machine Instruction Set" of JVM specification
says about linking exeptions for invokeinterface instruction:
" During resolution of the symbolic reference to the interface method,
any of the exceptions documented in 5.4.3d can be thrown.
...
Otherwise, if the selected method is not public,
invokeinterface throws an IllegalAccessError."
But JDK1.2fcsF JVM on Solaris(jit) throws AbstractMethodError instead.
SOURCE:
------------------------------------- file invokeinterface02003.jasm
// modified version of the test
public interface invokeinterface02003i {
public abstract Method f1:"(IF)I";
} // end invokeinterface02003i
public class invokeinterface02003c implements invokeinterface02003i {
Method f1:"(IF)I"
stack 1 locals 3
{
iconst_0;
ireturn;
}
public Method <init>:"()V"
stack 1 locals 1
{
aload_0;
invokenonvirtual Method java/lang/Object.<init>:"()V";
return;
}
} // end class invokeinterface02003c
public class invokeinterface02003 {
public static Method run:"([Ljava/lang/String;Ljava/io/PrintStream;)I"
stack 10 locals 6
{
try t1;
new class invokeinterface02003c;
dup;
invokenonvirtual Method invokeinterface02003c.<init>:"()V";
iconst_1;
fconst_1;
invokeinterface InterfaceMethod invokeinterface02003i.f1:"(IF)I", 3;
aload_1;
ldc String "no exception - test failed";
invokevirtual Method java/io/PrintStream.println:"(Ljava/lang/String;)V";
iconst_2; // no exception - test failed
ireturn;
endtry t1;
catch t1 java/lang/IllegalAccessError;
aload_1;
ldc String "IllegalAccessError - test passed";
invokevirtual Method java/io/PrintStream.println:"(Ljava/lang/String;)V";
iconst_0; // passed
ireturn;
catch t1 java/lang/AbstractMethodError;
aload_1;
ldc String "AbstractMethodError - test failed";
invokevirtual Method java/io/PrintStream.println:"(Ljava/lang/String;)V";
iconst_2; // failed
ireturn;
}
public static Method main:"([Ljava/lang/String;)V"
stack 2 locals 1
{
aload_0;
getstatic Field java/lang/System.out:"Ljava/io/PrintStream;";
invokestatic Method run:"([Ljava/lang/String;Ljava/io/PrintStream;)I";
bipush 95/*STATUS_TEMP*/;
iadd;
invokestatic Method java/lang/System.exit:"(I)V";
return;
}
} // end Class invokeinterface02003
----------------------------------------- end of file invokeinterface02003.jasm
LOG:
Running the test with JIT:
novo50% /export/ld14/java/dest/jdk1.2fcsF/solaris/bin/java -fullversion
java full version "JDK-1.2fcs-F"
novo50% /export/ld14/java/dest/jdk1.2fcsF/solaris/bin/java -verify invokeinterface02003
AbstractMethodError - test failed
novo50% /export/ld14/java/dest/jdk1.2fcsE/solaris/bin/java -fullversion
java full version "JDK-1.2fcs-E"
novo50% /export/ld14/java/dest/jdk1.2fcsE/solaris/bin/java -verify invokeinterface02003
IllegalAccessError - test passed
Running the test without JIT:
novo50% setenv JAVA_COMPILER none
novo50% /export/ld14/java/dest/jdk1.2fcsF/solaris/bin/java -verify invoke_interface
Warning: JIT compiler "none" not found. Will use interpreter.
IllegalAccessError - test passed
----------------------------------------- end of log
======================================================================
- duplicates
-
JDK-4136415 interface method implemented as private causes IllegalAccessError at link time
- Closed
- relates to
-
JDK-4104856 AbstractMethodError instead of IllegalAccessError
- Closed