[BUG] cicular dependencies between Toolkit & Defaults during class initialization.
pjb at imaginet.fr
Thu Aug 6 04:01:40 PDT 1998
There is some cicular dependencies that can appear while initializing.
When starting FreeBuilder, we get:
========> nativeValue = Toolkit.clrGetPixelValue( rgbValue);
========> static Color WndForeground = Color.black;
========> tlkInit( tkName);
So, in Toolkit, we're at the begining of the static initialization of the
class, and although there is a comment some lines below stating that:
// we should refer to Defaults as late as possible (since it may
// directly or indirectly refer to Toolkit.singleton)
the Defaults class is initialized anyway.
(What I don't understand is why Defaults class is not initialized even
before starting the initialization of the Toolkit class since there is this
dependency, is it a bug/feature of Java, or is it a bug of the compiler, or
is it a bug of the virtual machine?)
Anyway, I have kludge patches to initialize the colorMaps and be able to let
the Defaults class initialize its Color statics, and to initialize the
toolkit singleton even before the static initialization of the Toolkit class
is completed, if you want them, but the bug remains...
More information about the kaffe