
Enter a name for the extracted expression (if the chosen one doesn't suit us)Īs for renaming, it's possible to use keyboard shortcuts instead of using the menu.Choose between the Replace this occurrence only or Replace all x occurrences options, if proposed.


Public int add(int firstNumber, int b) įinally, we must note that IntelliJ is smart and searches mostly for usages in the scope of the renamed element. Let's add some Javadoc to our method, and then rename its first parameter, a: /**īy checking the first option in the confirmation pop-up, IntelliJ matches any mention of the parameters in the Javadoc comment of the method and offers to rename them as well: /** So, if any match is found with one of those two options, IntelliJ will show them and offer us the possibility to opt out of some of the changes (say, in case it matches something unrelated with our renaming). Finally, the Rename parameters in hierarchy option is available for method parameters only. As for the Search for text occurrences option, it's not available for method parameters and local variables. The Search in comments and strings option is available for any renaming.
