Sometimes, Java project needs to do code cleanup tasks in Netbeans.
The following tasks
- Code format all files in a project
- Removed Unused imports
How to code cleanup in Netbeans
Refactor Code with inspection Rules
- Go to
Refactor
Menu -> SelectInspect and Transform
option - It opens Popup window to select Inspect rule to inspect in single file or a current project.
- Select
Inspect
dropdown value asCurrent Project
- Check one of the below option
- Default settings
- Single Inspection dropdown to select different inspection rules
- Go to
Fixing Imports