Summary: | [formatter] Java formater trangresses line length limit | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | benson margulies <bimargulies> |
Component: | Core | Assignee: | Frederic Fusier <frederic_fusier> |
Status: | VERIFIED WORKSFORME | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | srikanth_sankaran |
Version: | 3.4.1 | ||
Target Milestone: | 3.6 M6 | ||
Hardware: | PC | ||
OS: | Mac OS X - Carbon (unsup.) | ||
Whiteboard: |
Description
benson margulies
2008-12-15 07:20:18 EST
The Eclipse built-in profile already set the maximum line length to 80, did you change this default value while formatting your snippet? Yes we changed it. However, the point is this, for any length we set it to, the formatter will make lines longer than that length. Hmm, using 3.5.0 and I format the following snippet using Eclipse built-in profile:
public class X {
void foo() {
for (Element el = XDOMUtil.getFirstChildElementNS(constraintEl, XmlSchema.SCHEMA_NS);
el != null; el = XDOMUtil.getNextSiblingElementNS(el, XmlSchema.SCHEMA_NS)) {
}
}
}
And I get the following output:
public class X {
>> void foo() {
>> >> for (Element el = XDOMUtil.getFirstChildElementNS(constraintEl,
>> >> >> >> XmlSchema.SCHEMA_NS); el != null; el = XDOMUtil
>> >> >> >> .getNextSiblingElementNS(el, XmlSchema.SCHEMA_NS)) {
>> >> }
>> }
}
I've replaced the tabulation character with '>> ' and space with '.' to make lines fit into the bugzilla comment...
I observed that the max line length of 80 characters is honored in this peculiar case. Is it the split of the lines which does not fit your expectation or is there something I'm missing?
As there is no answer on my last comment, I close this bug as worksforme for the while. Feel free to reopen if you have more information about this, thx Verified for 3.6M6 |