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 262307 - Source code reformatting creates invalid code
Summary: Source code reformatting creates invalid code
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-02 09:59 UTC by tetrode
Modified: 2016-06-02 12:53 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (279.21 KB, text/plain)
2016-06-02 09:59 UTC, tetrode
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tetrode 2016-06-02 09:59:08 UTC
Product Version = NetBeans IDE 8.1 (Build 201510222201)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.7.0_67
Runtime = Java HotSpot(TM) 64-Bit Server VM 24.65-b04

Reproducibility: Happens every time

STEPS:
Go to: Options - Editor - Formatting - Braces
Set the Class Declaration to Same Line

Create class as follows:

class reformatError // extends someOtherClass - no longer needed
{
    // here comes the class
}

Save the class or press Shift-Alt-F

ACTUAL:

source code is reformatted as: 

class reformatError // extends someOtherClass - no longer needed {
    // here comes the class
}

which is wrong - brace is at the end, it becomes part of the comment

EXPECTED:
source code should be reformatted as:

class reformatError { // extends someOtherClass - no longer needed
    // here comes the class
}
Comment 1 tetrode 2016-06-02 09:59:23 UTC
Created attachment 159943 [details]
IDE log