commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <ja...@carmanconsulting.com>
Subject RE: [lang] enhanced version of Class.forName
Date Tue, 06 Sep 2005 14:45:00 GMT
Do you think we need to go through the trouble of throwing an
IllegalArgumentException if it's not a well-formed class name (starts with
character, blah blah blah)?  Or, can we just let it throw a
ClassNotFoundException after doing as much as we can with the string that's
passed in (i.e. transforming it into the proper format)? 


-----Original Message-----
From: Thomas Dudziak [mailto:tomdzk@gmail.com] 
Sent: Tuesday, September 06, 2005 10:39 AM
To: Jakarta Commons Developers List
Subject: Re: [lang] enhanced version of Class.forName

On 9/6/05, James Carman <james@carmanconsulting.com> wrote:
> 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.

If I understand the VM spec correctly, the initialization is
recursively applied to the component type:

http://java.sun.com/docs/books/vmspec/2nd-edition/html/ConstantPool.doc.html
#79473

> 2.  Your parsing code didn't support the "proper" type format for arrays.
> We want this method to do so.

If you want me to, I can enhance it accordingly this evening.

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message