Re: Repetitive method name



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


.



Relevant Pages

  • Re: Repetitive method name
    ... >>Or perhaps you have 2 Analyzer classes that are getting importes? ... > Is there a limit to the number of characters in a method's name? ... the parameters in the signature, ... You have two methods in your bytecode with the same ...
    (comp.lang.java.programmer)
  • Re: Repetitive method name
    ... >>Or perhaps you have 2 Analyzer classes that are getting importes? ... > Is there a limit to the number of characters in a method's name? ... the parameters in the signature, ... You have two methods in your bytecode with the same ...
    (comp.lang.java.help)
  • Re: Acquiring UTF-8 string length
    ... http://en.wikipedia.org/wiki/Multi-byte_character_set, this UTF-8 string ... The number of codepoints is four, plus the terminating NUL. ... Four characters plus a terminating NUL. ...
    (microsoft.public.vc.language)
  • Re: Defacto standard string library
    ... concatenation of values using functions that are not Unicode aware. ... Concatenating one valid UTF-8 string to ... If all we are doing it to move normal ASCII range characters around, ... or concatenating a representation of a Chinese character will give you ...
    (comp.lang.c)
  • Re: Delphi Quiz: SetLength( WideString, 10 );
    ... a UTF-8 string is not a string of characters but a ... > If you have that many characters in the string, ... Similar to UTF-8, UTF-16 is a word format, not a character format. ...
    (alt.comp.lang.borland-delphi)