O'Reilly logo

IntelliJ IDEA Essentials by Jarosław Krochmalski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Refactoring actions

There are many different refactoring actions available in IntelliJ IDEA. Let's cover the important ones first: Rename, Copy, Move, and Safe Delete.

Rename

This is probably the most commonly used refactoring. The target for the rename action can be any symbol in the source code: class, method, field, method parameter, or local variable.

To rename, just pick the target and press Shift + F6. This action will start the in-place prompt, as shown in the following screenshot:

Rename

If you use the Shift + F6 shortcut twice, the Rename dialog box will offer additional options such as searching within comments and text strings, as shown here:

IntelliJ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required