Tips & Tricks

Handy Method Parameters List Lookup

When you need to modify code containing the usages of methods with long parameter lists, it’s sometimes too complicated to realize what parameter you are modifying.

For example, you have a call like the following and need to know what exactly you are changing.

Method parameters lookup
You might already know that IntelliJ IDEA has the CTRL+P shortcut that brings up a brief description of which parameters are passed to the method. It’s very handy and saves a lot of time that otherwise would have been spent looking up the method declaration.

Method parameters lookup
The trick I want to tell you about is that you can use the TAB and SHIFT+TAB shortcuts, when the parameter description popup is open, to scroll through the list. IntelliJ IDEA will move the caret and highlight the parameter so you can easily see which value you are going to alter.
Method parameters lookup
Though using too many parameters in a method is rare for our team, this little feature helped out when we used code like this:

Method parameters lookup

This tip was originally posted on Javalobby
Technorati tags: , ,

Discover more