Re: Repetitive method name
- From: Ross Bamford <ross@xxxxxxxxxxxx>
- Date: Sat, 21 May 2005 23:56:04 +0100
On Sat, 2005-05-21 at 16:46 +0300, Daniel Sjöblom wrote:
> Ross Bamford wrote:
> > On Fri, 2005-05-20 at 14:09 +0000, Mohd Hanafiah Abdullah wrote:
> >
> >>Is there a limit to the number of characters in a method's name?
> >>
> > No.
> >
> > There is a limit (of 255 characters) on the canonical representations of
> > the parameters in the signature, but not the name. The name is a UTF-8
> > string from the constant pool.
>
> Nitpick. This is not true. The limit of 255 is on number of parameters
> (calculated in a specific way, long and double parameters are counted
> twice), not on the length of the UTF-8 string. The UTF-8 string cannot
> contain more than 2^16 - 1 characters.
>
Right, it was that bit that threw me. I originally thought it was 255
params, but then looked it up and the double-contributions of double and
long made me doubt myself. I read it as 255 characters after the type id
resolutions.
> > Remember you can't overload on return type alone.
>
> It is very much possible to do so in bytecode. It is however not
> possible to have a static method and an instance method with the same
> name and same descriptor.
>
Intriguing. I've never tried it... What happens when you load the
bytecode?
--
[Ross A. Bamford] [ross AT the.website.domain]
Roscopeco Open Tech ++ Open Source + Java + Apache + CMF
http://www.roscopec0.f9.co.uk/ + info@xxxxxxxxxxxxxxxxxx
.
- Follow-Ups:
- Re: Repetitive method name
- From: Daniel Sjöblom
- Re: Repetitive method name
- References:
- Re: Repetitive method name
- From: Ross Bamford
- Re: Repetitive method name
- From: Daniel Sjöblom
- Re: Repetitive method name
- Prev by Date: Re: what design pattern is this?
- Next by Date: Re: Monitoring threads in Java.
- Previous by thread: Re: Repetitive method name
- Next by thread: Re: Repetitive method name
- Index(es):
Relevant Pages
|