1. Well, it's not exactly the same thing. I'm talking about when they pass in just "boolean" or "int". In that case, we construct the name "[B" or "[I" and pass that to Class.forName() with the "initialize" parameter, thereby telling it whether to initialize the array class and not (necessarily) the component type class.
2. Your parsing code didn't support the "proper" type format for arrays. We want this method to do so. -----Original Message----- From: Thomas Dudziak [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 06, 2005 10:12 AM To: Jakarta Commons Developers List Subject: Re: [lang] enhanced version of Class.forName 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
