Name: viR10068 Date: 03/28/2002
The JVMS ed 2 section 5.3.3 Creating Array Classes says:
"If L has already been recorded as an initiating loader of an array class
with the same component type as N, that class is C, and no array class creation
is necessary. Otherwise, the following steps are performed to create C:
1.If the component type is a reference type, the algorithm of this section (5.3)
is applied recursively using class loader L in order to load and thereby create
the component type of C."
But the reference implementation allows to create array of
inaccessible types instead of throwing IllegalAccessError.
See log for details.
Execution log:
% cat T.java
class MainTest {
public static void main(String[] args) {
System.out.println("Hello");
}
private class Test {
}
}
% cat Test.jasm
class tst {
public static Method main:"([Ljava/lang/String;)V"
stack 2 locals 1
{
iconst_1;
anewarray class MainTest$Test;
pop;
return;
}
} // end Class Test
% javac -d . T.java && jasm -d . Test.jasm && java -Xfuture tst; echo $status
0
% java -version
java version "1.4.1-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b06)
Java HotSpot(TM) Client VM (build 1.4.1-beta-b06, mixed mode)
%
Please, reassign this bug to the specification subcategory if you think
the VM behavior is correct.
======================================================================