Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » interface implemenation methods with reasonable argument names?(Can we have interface implementation methods with more reasonable argument names, please?)
interface implemenation methods with reasonable argument names? [message #936190] Sun, 07 October 2012 15:51 Go to next message
Michael Moser is currently offline Michael Moser
Messages: 7
Registered: October 2012
Location: Zürich, Switzerland
Junior Member
One thing I always hate about the automatically generated methods that are created to implement an interface is, that their arguments are always generically called arg0, arg1, arg2, etc.

Couldn't the code that generates these method headers copy the argument names from the actual interface definitions? There the arguments usualy have more meaningful names and that would help a lot to make the headers more self-explanatory.

Esp. if there are several subsequent arguments of the same type one always has to refer back to the definition to figure out, which one is which. If the arguments had proper names, that would often be superfluous.

M.

Re: interface implemenation methods with reasonable argument names? [message #937473 is a reply to message #936190] Mon, 08 October 2012 21:56 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 995
Registered: July 2009
Senior Member
One thing I "love" about letting JDT add unimplemented methods is that in most cases their argument names are taken from the super interface.
If this doesn't work it probably means that JDT somehow cannot find these argument names, perhaps because it's reading the interface from a jar which does not contain this information and has neither source code nor javadoc attached.
Re: interface implemenation methods with reasonable argument names? [message #938423 is a reply to message #937473] Tue, 09 October 2012 17:44 Go to previous message
Michael Moser is currently offline Michael Moser
Messages: 7
Registered: October 2012
Location: Zürich, Switzerland
Junior Member
OK. I have to admit I never noticed that any reasonable names were taken. So maybe I was always using/implementing interfaces from .jar's so far. But thanks for letting me know!
M.

[Updated on: Tue, 09 October 2012 17:44]

Report message to a moderator

Previous Topic:groovy class cannot be resolved to a type
Next Topic:Clean way of getting fully qualified types of imethod parameters?
Goto Forum:
  


Current Time: Fri Aug 22 02:12:31 EDT 2014

Powered by FUDForum. Page generated in 0.15376 seconds