Bug 389118

Summary: [quick fix] "Assign parameter to new field" may generate bad formatting
Product: [Eclipse Project] JDT Reporter: Lukas Eder <lukas.eder>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: REOPENED --- QA Contact:
Severity: minor    
Priority: P3    
Version: 4.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Lukas Eder CLA 2012-09-09 05:08:16 EDT
The quick fix action "Assign parameter to new field" may generate bad formatting. Take the following sample class:

-------------------------------------
class Test {
    Test(int newField) {}
}
-------------------------------------

Note that the closing curly brace is placed on the same line as the opening one.

Applying "Assign parameter to new field" on "newField" will generate this code here:


-------------------------------------
class Test {
    private final int newField;

    Test(int newField) {
        this.newField = newField;}
}
-------------------------------------

The closing curly brace should probably be put on a new line
Comment 1 Eclipse Genie CLA 2019-11-18 13:12:35 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 Lukas Eder CLA 2020-03-20 11:11:36 EDT
This issue still persists in 4.15.0
Comment 3 Eclipse Genie CLA 2022-03-11 03:57:01 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 4 Eclipse Genie CLA 2024-03-02 14:33:12 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.