OK, status, eh?  java.lang.reflect is completely coded, but it is
almost impossible to test until we have control over java.lang.Class (since
we need to be able to create the Methods and Constructors and Fields using
getMethods(), getDeclaredMethods(), etc.).  We won't have that for a while,
I think, though I have a few ideas on how we can have control over it and
still maintain (sort of) VM independence.  java.lang.reflect.Array is the
only one that can really be tested, and it has been.
     Another interesting control issue is the JNI control.  In 1.2 we have
(*env)-><To/From>ReflectedMethod().  If we write java.lang.reflect.Method,
we need to write that too (there is no public constructor for
java.lang.reflect.Method, so non-public methods or fields must be called,
requiring non-spec knowledge of the system).
     In the course of writing java.lang.reflect, I had to do a fair amount
of native code.  Whenever possible, I generalized and put stuff into
native/lib.  The fruits so far are a generic library (jcl), which handles
basic things like malloc'ing and throwing appropriate exceptions when those
basic functions fail; a primitive class library (primlib), which allows lots
of different conversions to and from primitive types to wrapper types
(java.lang.Integer, for example); and the link library (jnilink), which
allows easier, faster, and safer linking of jmethodIDs and jfieldIDs.  All
of these libraries are tested (though not exhaustively).
     After polishing that code a bit, I moved on to java.beans.
     java.beans is now completely written.  However, I wrote it to the spec,
and it turns out that there are so many ambiguities in the spec that it's
unlikely one will write it right the first time.  I am tweaking the
algorithm until it comes into accord with Sun's output.  I have made some
major strides tonight (most classes Introspect just fine), and I will check
some more tomorrow (having some weird stuff happen with java.awt, probably
rooted in their sun.beans.infos.ComponentBeanInfo class.).
     Everything comes with very complete javadoc, though a complete
testsuite for java.beans is waiting until I iron the thing into accordance
with Sun, and tests for java.lang.reflect await the time when both we and
Japhar are mature enough to merge (so that they stop relying on Sun's
classes' internal formats).

--John Keiser

Reply via email to