| Summary: | ASTRewrite does not obey preference for empty line between fields | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> |
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | dirk_baeumer |
| Version: | 3.1 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | stalebug | ||
the ast rewrite has a own heuristic for new lines between elements: It probes the spacing between existing elements, and if not exist uses 0 for between fields and 1 beween methods. I agree that it should probe the formatter at least for the first field/method *** Bug 64954 has been marked as a duplicate of this bug. *** not for 3.1 As of now 'LATER' and 'REMIND' resolutions are no longer supported. Please reopen this bug if it is still valid for you. Bug was LATER but is still valid in HEAD. 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. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. 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. |
I20050217-2000 Create new CodeFormatter settings by editing "Java Conventions [built-in]", enabling "Use tab character" and saving with a new name. In a project with that formatter, create class p.A: -------------------------- package p; public class A { private int field; public void add() { field += INC; } } -------------------------- - formatting the class should not change anything - use quick fix to create constant INC - The new field is inserted without an empty line in between: private int field; private static final int INC = 0; - format the class -> an empty line is inserted I think this is a problem of the ListRewrite. With Extract Constant from HEAD (rewritten to use ASTRewrite), I see the missing empty line as well.