Bug 389118 - [quick fix] "Assign parameter to new field" may generate bad formatting
Summary: [quick fix] "Assign parameter to new field" may generate bad formatting
Status: REOPENED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows 7
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-09 05:08 EDT by Lukas Eder CLA
Modified: 2024-03-02 14:33 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.