bug-classpath
[Top][All Lists]
Advanced

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

[Bug classpath/22788] java.lang.reflect.Method.toString() and array para


From: gcc-bugzilla at gcc dot gnu dot org
Subject: [Bug classpath/22788] java.lang.reflect.Method.toString() and array parameters, etc
Date: 16 Oct 2005 01:27:13 -0000

The toString() method in the reference implementation of
the Method class gives the wrong answer when called on a
method with a parameter or a result type that is an array
type.  You get "void foo([I)" instead of "void foo(int[])"
for example.

The bug is due to the use of 'getName()' on the respective
Class objects to get the type strings.  Unfortunately, 
getName() is specified to return a "[..." string for
an array type.


------- Comment #1 from from-classpath at savannah dot gnu dot org  2004-10-13 
10:48 -------
Hi,


I wrote the attached patch which fixes the problem when applied into jamvm.
Unfortunately this is VM specific code ... We will have to chanhge this perhaps
in the future.

Can you please test this patch with your testcase and report any results ? I
have extended your testcase a bit to check for more cases too. With jamvm+patch
this passes them all.


------- Comment #2 from from-classpath at savannah dot gnu dot org  2004-10-14 
15:26 -------
Michael:  unfortunately your patch is not quite correct.
It applies getUserTypeName to the method's exception 
types rather than its parameter types.

I'm also seeing an unexpected NullPointerException at
line 125 of toString.java, but I think that's probably
a Kissme bug.


------- Comment #3 from from-classpath at savannah dot gnu dot org  2004-10-14 
15:48 -------
Damn, that happens when the JVM version is partly different and you cant test
the actual patch directly. I have updated the patch. Does it look otherwise
corret to you ? If yes I will apply it and write a mail to the mailing list to
make all JVM implementers aware of it.


------- Comment #4 from from-classpath at savannah dot gnu dot org  2004-10-15 
15:24 -------
Michael: the patch now looks correct and passes your revised
Mauve test cases (apart from one which is failing due to a
bug in Kissme's implementation of java.lang.Class.getMethod)

I recommend checking it in.

Thanks,

-- Steve


------- Comment #5 from from-classpath at savannah dot gnu dot org  2004-10-16 
08:39 -------
I commited the patch. Thanks for your report and help with this.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22788





reply via email to

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