-
Bug
-
Resolution: Fixed
-
P3
-
1.2.0
-
1.2fcs
-
sparc
-
solaris_2.4
-
Verified
Name: akC45999 Date: 06/02/98
The Java VM spec chapter 5.4.3a Class and Interface Resolution reads:
...
7.Finally, access permissions to C are checked:
If D does not have permission to access C, class or interface resolution throws an
IllegalAccessError.
But the attached test shows that interface case don't throw an IllegalAccessError
when a superinterfaces is not accessible.
--------------------------------- AlienInterface.jasm
package res;
interface AlienInterface
{
} // end Class AlienInterface
--------------------------------- TestClass.jasm
class TestClass implements res/AlienInterface {}
--------------------------------- resolveClass00704.java
import java.io.PrintStream;
public class resolveClass00704 {
public static int run(String argv[], PrintStream out) {
try{
Class.forName("TestClass");
out.println("No exception");
return 2;
} catch (IllegalAccessError e) {
return 0;
} catch (Throwable e) {
out.println("Unexpected exception " + e);
return 2;
}
}
public static void main(String argv[]) {
System.exit(run(argv, System.out) + 95/*STATUS_TEMP*/);
}
}
------------------------------------- dotest
#!/bin/sh
javac -d . *.java
jasm -d . *.jasm
java -verify resolveClass00704
echo res=$?
----------------------------------------
Running the test:
novo36% dotest
No exception
res=97
======================================================================
======================================================================