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.

Bug 191527 - Introduce method in a guarded block puts new method inside the guarded block
Summary: Introduce method in a guarded block puts new method inside the guarded block
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-01 16:06 UTC by swpalmer
Modified: 2012-10-22 14:51 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description swpalmer 2010-11-01 16:06:36 UTC
Product Version = NetBeans IDE 6.9.1 (Build 201007282301)
Operating System = Windows XP version 5.1 running on x86
Java; VM; Vendor = 1.6.0_22
Runtime = Java HotSpot(TM) Client VM 17.1-b03

Create a Swing JPanel form and add a button.
Double click the button to add an action event handler for the button.
The event handler is created with the first line declaring the method and the last closing brace as guarded blocks.
Add a few lines of code to the event handler (between the guarded blocks).
Select ALL of the code in the event handler method and Refactor to introduce a new method.

The new method is placed between the guarded blocks for the event handler with the closing brace of the introduced method being a guarded block.
Comment 1 MackSix 2011-11-12 01:02:17 UTC
This works for me in:

Product Version: NetBeans IDE Dev (Build 201111110600)
Java: 1.7.0_01; Java HotSpot(TM) Client VM 21.1-b02
System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb)
User directory: C:\Users\Mark\.netbeans\dev
Cache directory: C:\Users\Mark\.netbeans\dev\var\cache
Comment 2 Marian Mirilovic 2012-10-22 14:51:12 UTC
Works for me in 
Product Version: NetBeans IDE Dev (Build 201210220002)
Java: 1.7.0_07; Java HotSpot(TM) Client VM 23.3-b01
System: Linux version 3.2.0-32-generic running on i386; UTF-8; en_US (nb)