jakarta-bcel-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark R. Diggory" <mdigg...@latte.harvard.edu>
Subject Re: [OT - sort of] Primitives hurt!
Date Sat, 18 Jan 2003 18:53:18 GMT
Huw Evans wrote:

> So, you need to check the need to do something with the primitive type, and 
> instead of call Class.forName(<primitive type name>), you need to call the 
> appropriate wrapper.TYPE.

Thank you for the tip, I didn't realize that was available in the 
wrapper classes too. I do end up having to create a map of some sort to 
get from the string representation to the actual class still. Jouzas' 
code captures this issue (thank you!).

> This is a pain, I agree, and it is a little sucky, I agree.  However, it does 
> do the job :)  Don't get me started on the use of primitives in Java, it's one 
> of my favourite rants about the language :)
> Huw

It's just amazing to me, I bet this one little issue with 
Class.classForName(...) and primitives probibly creates "hundreds of 
thousands" of extra lines of replicated javacode spanning many Java 
Development Projects the world over.


To unsubscribe, e-mail:   <mailto:bcel-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:bcel-user-help@jakarta.apache.org>

View raw message