This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: merge several Number classes with Classpath
- To: Mark Wielaard <mark at klomp dot org>
- Subject: Re: Patch: merge several Number classes with Classpath
- From: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- Date: Tue, 24 Jul 2001 16:16:39 +1200
- CC: Tom Tromey <tromey at redhat dot com>, Java Patch List <java-patches at gcc dot gnu dot org>, classpath at gnu dot org
- References: <87zo9vmm2m.fsf@creche.redhat.com> <20010723230815.A736@klomp.org>
Mark Wielaard wrote:
> On Mon, Jul 23, 2001 at 02:23:29PM -0600, Tom Tromey wrote:
> > +
> > + /**
> > + * Helper for java.lang.Integer, Byte, etc. to get the TYPE class
> > + * at initialization time. If there are multiple classloaders, this
> > + * method may be called once per ClassLoader per type.
> > + *
> > + * @param type name of the primitive type; i.e. "int", "byte", etc.
> > + * @return a "bogus" class representing the primitive type.
> > + */
> > + static final Class getPrimitiveClass(String type)
> > + {
> > + if ("int".equals (type))
> > + return int.class;
This method is also kind of inefficient, particularly if, as the doc says, it
can be called "once per ClassLoader per type".
I propose it be replaced with something like "final Class
getPrimitiveClass(char type)" where the char is one of the standard mappings
used in method signatures, eg 'B' for byte, 'I' for int, etc. Is there any
objection to that?
regards
Bryce.