Bug 542757 - Auto Save Action "Use blocks in if/while/for/do statements" deletes comments
Summary: Auto Save Action "Use blocks in if/while/for/do statements" deletes comments
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.11   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-13 08:16 EST by Ralph Gerbig CLA
Modified: 2022-12-15 13:12 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Gerbig CLA 2018-12-13 08:16:34 EST
1) Activate: Java Editor -> Save Actions -> Additional actions -> Configure -> Code Style -> Use blocks in if/while/for/do statements

2) Create a method with the following three ingredients:
   1 - for loop without brackets
   2 - comment
   3 - statement

e.g.:

public static void main(String[] args) {
  int[] iArray = {1,2,3};

  for(int i : iArray)

  // deleted after save

  System.out.println(i);

}

3) press save

Result: The comment "deleted after save" is deleted
Comment 1 Eclipse Genie CLA 2020-12-03 11:30:58 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 Eclipse Genie CLA 2022-12-15 13:12:30 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.