This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When reformatting the code there is not an option to remove space lines in the code so if you have code that was incorrectly formatted with a space between each line of code the extra lines remain. The formatter need to have a few more options like the ability to specify where empty lines should and should not be.
I don't know when this was fixed but it is not leaving the spaces any more.