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.
Cleaning methods with refactoring is dangerous if you select more than one method in a row. Just right-click on a unused method name (or into the unused method) > refactor > safe delete... > preview -> ok, this method will be deleted. Select 2 methods (with both whole logical blocks) > refactor > safe delete... > preview -> ko, the entire class will be deleted. from the about: Product Version: NetBeans IDE 6.0 Beta 2 (Build 200710212201) Java: 1.6.0_01; Java HotSpot(TM) Client VM 1.6.0_01-b06 System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb)
This refactoring is sensitive to cursor position, not editor selection. I guess, that if you selected 2 methods and invoked [Refactor | Safe Delete], cursor was not inside any method, but inside class and this is why class gets deleted.
You're right, the cursor position is the key. Select 2 methods but not the last '}' (so the cursor stays into the last method block) > refactor > safe delete... > preview -> ok, only the second method will be deleted. Quite dangerous, so ALWAYS preview the refactoring process :)
Resolving all issues with milestone "future" as LATER. If you feel strongly that it should be implemented please reopen and set the target milestone to "next".
NetBeans.org Migration: changing resolution from LATER to WONTFIX