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 193883 - Encapsulate Field breaks switch blocks
Summary: Encapsulate Field breaks switch blocks
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: PC Windows 7 x64
: P1 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-28 14:31 UTC by _ gtzabari
Modified: 2010-12-29 08:10 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Class before modification (31.42 KB, application/octet-stream)
2010-12-28 14:32 UTC, _ gtzabari
Details
Class after modification (31.70 KB, application/octet-stream)
2010-12-28 14:32 UTC, _ gtzabari
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2010-12-28 14:31:46 UTC
Product Version: NetBeans IDE Dev (Build 201012150001)
Java: 1.6.0_23; Java HotSpot(TM) Client VM 19.0-b09
System: Windows 7 version 6.1 running on x86; Cp1252; en_CA (nb)

Notice in the attached files how Netbeans removes a "break" statement in a switch-block when "encapsulate field" is invoked. This kind of bug will silently break code and will be very hard to track down.
Comment 1 _ gtzabari 2010-12-28 14:32:19 UTC
Created attachment 104565 [details]
Class before modification
Comment 2 _ gtzabari 2010-12-28 14:32:31 UTC
Created attachment 104566 [details]
Class after modification
Comment 3 Quality Engineering 2010-12-29 07:08:30 UTC
Integrated into 'main-golden', will be available in build *201012290001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/a73061f8d0a7
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #193883: ImmutableTreeTranslator.optimize should not strip statements following a block.
Comment 4 Jan Lahoda 2010-12-29 08:10:52 UTC
Fixed by the above commit. Thanks for the report.