Here is what is left to be done for integration to be complete. I will
do these unless you would like to, Petter.
Note that I am right now not even thinking about making Japhar
runtime-compatible with Classpath and JDK. Let me know if you would rather
have a runtime switch; I can do it that way without much difficulty.
Instead of #ifdef FOR_CLASSPATH I'd use if(for_classpath).
INTERNAL CHANGES
1. init.c: if we decide to make a runtime switch, this is probably where the
function to detect whether we're using Classpath or JDK would go.
2. jnistr.c: switch names of string length and string character array based
on Classpath/JDK. I have this patch, just waiting for everything else.
This change is irreducible unless we change our internal variable names
3. init.c: initialize_system_threads(): grab the static var ThreadGroup.root
from ThreadGroup instead of creating the system thread group. NOTE: it is
possible to have this function work the same as before and still work with
Classpath. I will think this one out a little while longer.
4. nativeglue.c:to_reflected_{method/field}: don't set so many variables
when using Classpath. Classpath is smart enough to grab them only when it
needs to. NOTE: you can make java.lang.reflect.* work exactly the same way
as JDK if you like, thus eliminating the need for this internal change. But
that would turn down both the speed and space efficiency of the way of doing
it now.
CHANGES RELATING TO HAVING TWO SETS OF LIBRARIES TO IMPLEMENT
1. libnative/Makefile.am: if using compile-time switch, decide which
libraries to compile
2. dynamic_loading.c: depending on whether it's Classpath or JDK, load
different libraries. This will only load the libraries Japhar provides.
3. Create the libraries. It is *not possible* to put Classpath native
method bodies into the existing libraries and remain runtime compatible:
some java.lang and java.lang.reflect methods are also loaded by Classpath
and that would cause conflicts. Two separate sets of libraries,
unfortunately, *must* be created. Luckily, the Classpath native libs are
rather small.
--John Keiser