On 9/6/05, James Carman <[EMAIL PROTECTED]> wrote:
> Okay, I caved (or compromised)! :-) I re-wrote the method to use your
> little trick of loading the array version of the class and taking the
> component type. The only problem I have with this is that I'm passing the
> "initialize" parameter in when I call forName() for the array version. I
> guess it doesn't really hurt to initialize the array version, but does that
> cause the component class to get initialized? Of course, this only happens
> for primitives, so it's probably not a big issue, since the primitive
> classes will most likely be loaded by the bootstrap classloader. I'm
> attaching the code as a patch for others to review.
Since all we're doing is creating the "[I" / "[L..." version and pass
it to the classloader, we would get the same effect as by using the
bytecode version directly. Isn't that desired ?
> I still have the problem that my code uses a regex to check the validity of
> the class name that's passed in. Darn backward compatibility!
Why don't you merge our versions ? I think my stringtokenizer usage is
reasonably well behaved and its 1.2 compatible. It should not be too
difficult to adapt it so that the bytecode specifications
("[I"/"L...;") can also be parsed.
Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]