classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch: merge several Number classes with Classpath


From: Mark Wielaard
Subject: Re: Patch: merge several Number classes with Classpath
Date: Tue, 24 Jul 2001 09:32:34 +0200
User-agent: Mutt/1.3.18i

Hi,

On Tue, Jul 24, 2001 at 04:16:39PM +1200, Bryce McKinlay wrote:
> 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 think the doc is wrong. Since the primitive wrapper classes are always
loaded by the system class loader they should only be loaded and initialized
once. Additional classloaders should never redefine primordial classes.

> 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?
If you make that change please also update the vmintegration documentation
in the classpath/doc directory.

Cheers,

Mark

-- 
Stuff to read:
    <http://www.toad.com/gnu/whatswrong.html>
  What's Wrong with Copy Protection, by John Gilmore



reply via email to

[Prev in Thread] Current Thread [Next in Thread]