O'Reilly logo

NetBeans IDE 8 Cookbook by Rhawi Dantas, David Salter

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

Delete refactoring

After writing code for a while, it's a common practice to review what you've written. At that point, you may decide that you want to delete some of the code as it's no longer needed. Deleting code, however, can be dangerous, especially on larger projects, as you don't always know how many references you have to the code to delete and where they are.

Fortunately, NetBeans provides a Safely Delete refactor.

Getting ready

First we will need a Java project to perform some safe delete refactoring. We will use the same project from the earlier recipe, Rename refactoring, and so ensure that you have the project open from the end of that recipe. If you have not followed that recipe, the project is available from the code download bundle ...

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