Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 551251

Summary: Save action "remove redundant modifiers" remove non-redundant modifier
Product: [Eclipse Project] JDT Reporter: Clovis Seragiotto <clovis.seragiotto>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: noopur_gupta
Version: 4.12   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
Whiteboard:

Description Clovis Seragiotto CLA 2019-09-19 10:06:45 EDT
When saving the following code, the modifier "final" (which is not redundant) is removed if the save action "Remove redundant modifiers" is on. 

var o = new Object() { final int i = 1; };

Even funnier: if the save action "add final modifier to private fields" is also on, then for

var o = new Object() { private int i = 1; };

you see that the final modifier is added and immediately removed.
Comment 1 Noopur Gupta CLA 2019-09-20 02:23:06 EDT
Please try with Eclipse 2019-09 release build as I don't see this issue.
Comment 2 Clovis Seragiotto CLA 2019-09-20 04:08:21 EDT
The behavior cannot be reproduced with Eclipse 2019-09.