| Summary: | [formatter] doesn't align fields in declarations of annotations, enums and anonymous classes | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Ferry Huberts <mailings> |
| Component: | Core | Assignee: | Mateusz Matela <mateusz.matela> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | daniel_megert, jarthana, manoj.palat |
| Version: | 4.5 | Flags: | daniel_megert:
pmc_approved+
manoj.palat: review+ |
| Target Milestone: | 4.5.1 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| See Also: |
https://git.eclipse.org/r/54538 https://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=80f1e7c4e4b868f26698d3e483443bcf19375a87 https://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=R4_5_maintenance&id=3639fd3f62bc92c49e5f646d1aba9cc41d2c3ae0 |
||
| Whiteboard: | |||
|
Description
Ferry Huberts
Hmm.. I don't see any problem with build I20150811-1400. You have an example where you see this? Also, what build did you use? (In reply to Jay Arthanareeswaran from comment #1) > Hmm.. I don't see any problem with build I20150811-1400. > > You have an example where you see this? Also, what build did you use? I used the Eclipse Mars release I can confirm, "Align fields on columns" doesn't work for something like this:
public @interface Anno {
int aaaaaaaaa;
String bbbbbbbbb;
}
* actual:
package nl.mindef.ahr.interfaceenable.manager;
public @interface Try {
int aaaaaa = 1;
String bbbbbbbbb = "default";
}
* expected:
package nl.mindef.ahr.interfaceenable.manager;
public @interface Try {
int aaaaaa = 1;
String bbbbbbbbb = "default";
}
(simulated by '@interface' -> 'interface'
The same problem exists inside anonymous classes and enum declarations. Also, if a field is initialized with an anonymous class or a lambda expression, its body is not aligned with its header. New Gerrit change created: https://git.eclipse.org/r/54538 Gerrit change https://git.eclipse.org/r/54538 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=80f1e7c4e4b868f26698d3e483443bcf19375a87 Verified for 4.6 using N20150830-2000 build I am requesting for PMC approval for 4.5.1 Field alignment is broken, so it would be nice to include this in SR1. Backported to 4.5.1 with http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=R4_5_maintenance&id=3639fd3f62bc92c49e5f646d1aba9cc41d2c3ae0 Verified for 4.5.1 using M20150902-1200 build With Mars.1 the formatter now does NOT restart the alignment after whitespace. So now ALL fields in the file are aligned. This is quite annoying to me since my files are divided in 'functional blocks'. Please fix this so that the alignment is restarted after whitespace |