Bug 12444 - strange types names in ReorderParameters error dialog
Summary: strange types names in ReorderParameters error dialog
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M5   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-28 11:09 EST by Adam Kiezun CLA
Modified: 2002-04-04 12:07 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Kiezun CLA 2002-03-28 11:09:54 EST
fully qualified names contain '/' instead of '.'
from bug 8731

Test Case: Create a class that implements IAdapterFactory

Select getAdapter(...) and try to modify method parameters. In the error 
message I get, the method is called 'java/lang/Object getAdapter
(java/lang/Object adaptableObject, java/lang/Class adapterType)'.

The fully qualified names, especially for classes like Object and Class, make 
it hard to recognize the method. But in any case the '/' should be replaced 
with the usual '.'
Comment 1 Adam Kiezun CLA 2002-03-28 11:27:16 EST
simpler test case is to create a class that implements java.util.List,
override methods,
select addAll(int arg0, Collection arg1)

and 'modify parameters'

the problem comes from Signature.toString(String methodSignature, String 
methodName, String[] parameterNames, boolean fullyQualifyTypeNames, boolean 
includeReturnType)

i call it with: 
(ILjava/util/Collection;)Z
addAll
[arg0, arg1]
false
true

and it returns: boolean addAll(int arg0, java.util.Collection arg1)
and not the expected boolean addAll(int arg0, Collection arg1)

another thing - by looking at code in Signature.toString it seems that it 
ignores the fullyQualifyTypeNames for the return type (running this test case 
on the subList(int, int) method confirms it)



Comment 2 Olivier Thomann CLA 2002-03-28 12:18:07 EST
In all examples the '/' is never used. You should call it 
with:
(ILjava.util.Collection;)Z
addAll
[arg0, arg1]
false
true

And then you 
will get the expected result. Should we handle the '/' to '.' conversion inside the Signature 
methods?
Comment 3 Olivier Thomann CLA 2002-03-28 15:07:55 EST
I fixed the problem for fully qualified name in the return type and added regression tests, but I 
don't think we should handle '/' internally.
Comment 4 Adam Kiezun CLA 2002-04-02 03:52:43 EST
the '/' is returned by jcore itself

here's what i call (is this code a resonable use of jcore api?):

String sig= Signature.toString(method.getSignature(), method.getElementName(), 
method.getParameterNames(), false, true);

should i really be converting '/' to '.' myself? 
for me, as a client of that api the '/' thing is only an implementation detail
Comment 5 Olivier Thomann CLA 2002-04-03 13:09:40 EST
For now the specification of the Signature methods will specified they are dot-based and not /-
based. Then it is up to the client to do the conversion and ensure that '.' are used instead of '/'.
Comment 6 Olivier Thomann CLA 2002-04-04 12:07:41 EST
Specifications of Signature methods is updated to specified they are always 
dot-based.
Fixed and released in HEAD.