Skip to main content


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 19:51 Go to next message
Michael Moser is currently offline Michael MoserFriend
Messages: 64
Registered: October 2012
Location: Zürich, Switzerland
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] Tue, 09 October 2012 01:56 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
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 21:44 Go to previous message
Michael Moser is currently offline Michael MoserFriend
Messages: 64
Registered: October 2012
Location: Zürich, Switzerland
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 21: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 Mar 29 06:56:28 GMT 2024

Powered by FUDForum. Page generated in 0.02111 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top