Community
Participate
Working Groups
Build ID: I20080617-2000 Steps To Reproduce: 1. create a file that contains a construct like "final String [] empty = new String[] {,};" 2. Try to format the file (either Shift+Strg+F or Cleanup or...) 3. Nothing happens. If the line is replaced with "final String [] empty = new String[0];" everything works as expected More information:
Fix is trivial.
Created attachment 110305 [details] Proposed fix + regression tests Jérôme, since the formatter fails, I think this might be a good candidate for 3.4.1.
Released for 3.5M2. Regression tests added in org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#test715 org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#test716 org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#test717 org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#test718
Is this a regression comparing to 3.3.2?
I don't think so, but it is a crash in the formatter. The unit that contains such piece of code cannot be formatted. Since the fix is trivial, I think it is a good idea for a maintenance release.
The description of this bug doesn't talk about a crash. Since this is not a regression, it cannot go in 3.4.1.
(In reply to comment #6) > The description of this bug doesn't talk about a crash. Since this is not a > regression, it cannot go in 3.4.1. > I confirm that 3.3.2 already has the same issue
(In reply to comment #6) > The description of this bug doesn't talk about a crash. Since this is not a > regression, it cannot go in 3.4.1. When the contents of the compilation unit is not modified after a formatting operation, it means that the code formatter failed. This affects the whole unit and there is no way for the user to know what caused the failure in the formatter.
Verified for 3.5M2 using I20080914-2000