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 247475 - Refactoring introduce local variable does not properly indent
Summary: Refactoring introduce local variable does not properly indent
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 8.0.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-25 14:22 UTC by mclaborn
Modified: 2016-07-07 07:18 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Before refactoring (28.10 KB, image/png)
2014-09-25 14:23 UTC, mclaborn
Details
After refactoring (32.45 KB, image/png)
2014-09-25 14:23 UTC, mclaborn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mclaborn 2014-09-25 14:22:53 UTC
Product Version = NetBeans IDE 8.0.1 (Build 201408251540)
Operating System = Linux version 3.13.0-36-generic running on amd64
Java; VM; Vendor = 1.7.0_67
Runtime = Java HotSpot(TM) 64-Bit Server VM 24.65-b04

See screen shots coming shortly. Refactoring to introduce a local variable in and "if" block inside of a "case" block in a "switch" does not properly indent the new line.
Comment 1 mclaborn 2014-09-25 14:23:26 UTC
Created attachment 149515 [details]
Before refactoring
Comment 2 mclaborn 2014-09-25 14:23:55 UTC
Created attachment 149516 [details]
After refactoring
Comment 3 Svata Dedic 2015-09-01 12:47:44 UTC
Reproduced on code fragment:

public class Format {
    public void t(String code, Long l_amount) {
        switch (code) {
            case "sayDollars":
                if (l_amount != null) {
                    String l_dollars = new DecimalFormat("0").format(Math.floor(l_amount));
                    long l_cents = Math.round((l_amount - Math.floor(l_amount)) * 100.0);
                    System.err.println(l_cents);
                }
                
        }
    }
}
Comment 4 Martin Balin 2016-07-07 07:18:28 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss