Summary: | [formatter] IAE when pasting a snippet | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Frederic Fusier <frederic_fusier> | ||||||
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P3 | CC: | daniel_megert, markus.kell.r, Olivier_Thomann, srikanth_sankaran | ||||||
Version: | 3.5 | ||||||||
Target Milestone: | 3.6 M1 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows XP | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Frederic Fusier
2009-07-10 08:55:31 EDT
Created attachment 141289 [details]
Stack trace
I would argue that this is better fixed in JDT Core by loosening the spec: clients call that API by feeding the corresponding JDT Core options and since JDT Core allows 0 for the indent it would be fair to also allow it here. Also, if not changed in JDT Core then all clients which followed that pattern have to add some special case code. Moving back to JDT Core for consideration. I concur with Daniel's comment. We have an inconsistency. If we allow 0 for the indentation level, we must loosen the spec of the method in measureIndentUnits. If indentWidth is 0, we could return 0. Created attachment 141562 [details]
Proposed fix
Released for 3.6M1. Added regression test org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#test722 Bug 285565 requests that the rest of the IndentManipulation methods should also accept 0 for indentWidth. Verified for 3.6M1 by code inspection. This point fix needs to be applied to several other places to address bug 285565 |