Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 196513 - When creating subclass of compiled class, guess arguments if available
Summary: When creating subclass of compiled class, guess arguments if available
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-13 17:48 EDT by Alex Blewitt CLA
Modified: 2007-07-29 09:23 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Blewitt CLA 2007-07-13 17:48:07 EDT
I created a subclass of Mylyn's AbstractRepositoryConnector, which apparently has .class attributes that maintain the argument names (and shows up as such in the byte-code view). The generated methods all used argument names of the form 'arg0,arg1' etc.

It would be nice if in those situations the argument names could be guessed from the compiled class if the source/JavaDoc isn't available.
Comment 1 Olivier Thomann CLA 2007-07-16 11:07:43 EDT
Moving to JDT/UI.
Comment 2 Martin Aeschlimann CLA 2007-07-17 06:10:51 EDT
We use the parameter names provided by IMethod.getParameterNames().
I think the idea of using the class files attributes is very good and I suggest that the algorithm of getParameterNames is extended to do this.

Moving to jdt.core.
Comment 3 Olivier Thomann CLA 2007-07-17 10:57:49 EDT
Martin, this is already done.
The problem is that for abstract methods there is no Code attribute and therefore there is no debug information we could use to retrieve the parameter names.
Alex, if you look at the abstract methods in the class file editor, you will see that they have parameter named arg0, arg1,...
If you define a method stub for a method from the superclass that contains some code, you should get the expected parameter names.
OK to close?
Comment 4 Martin Aeschlimann CLA 2007-07-17 11:07:06 EDT
Oh, I didn't know, great. I would say ok to close.
Comment 5 Alex Blewitt CLA 2007-07-17 11:33:25 EDT
Yeah, it's a shame, but basically there's nothing we can do I guess. So Interfaces can't have parameter names stored in the .class file either? Bummer; interfaces and abstract classes are likely to be the two main places this is used.

Let's close invalid.
Comment 6 Eclipse Webmaster CLA 2007-07-29 09:23:23 EDT
Changing OS from Mac OS to Mac OS X as per bug 185991