-
Type:
Bug
-
Resolution: Not an Issue
-
Priority:
P4
-
None
-
Affects Version/s: 1.0
-
Component/s: tools
-
sparc
-
generic
The following class:
class HasDependency
{
int array[] = new int[arraySize];
static HasDependency instance;
static int arraySize = 10;
}
has a forward dependency between the two static initializers
that is "hidden" by the instance initializer. Javac will compile
this and when the class is loaded you will find that
HasDependency.instance.array.length == 0.
-Theron, 20 Oct 95
Oops, I've over-simplified the example. The first static
initializer should be:
static HasDependency instance = new HasDependency();
-Theron, 20 Oct 95
class HasDependency
{
int array[] = new int[arraySize];
static HasDependency instance;
static int arraySize = 10;
}
has a forward dependency between the two static initializers
that is "hidden" by the instance initializer. Javac will compile
this and when the class is loaded you will find that
HasDependency.instance.array.length == 0.
-Theron, 20 Oct 95
Oops, I've over-simplified the example. The first static
initializer should be:
static HasDependency instance = new HasDependency();
-Theron, 20 Oct 95