| Summary: | Java Code Formatter is severely confused by following code | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Bruce Hodge <bruce> |
| Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | bruce |
| Version: | 3.0.2 | ||
| Target Milestone: | 3.1 RC2 | ||
| Hardware: | PC | ||
| OS: | Windows 2000 | ||
| Whiteboard: | |||
I am investigating. Bug is present in 3.1RC1. Bug is not present in 2.1. +1 for RC2 Fixed and released in HEAD. Regression tests added in org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests.test579/580 Verified for 3.1 RC2 using build N20050607-0010 + JDT/Core HEAD Verified for 3.1 RC2 using build I20050610-0010 |
The formatter refuses to format the foo() method in the example below. In general the formatter will appear to be disabled (for the entire file) when a file contains any usage of static inner classes. public class Foo { static class Point { static class Float{ float x; float y; } } // formatter bug // change "Point.Float pts[]" to "Point pts[]" and foo() formats correctly void foo(Point.Float pts[]) { int bar = 0;int jay = 1;for (int i = 0; i < 5;);} }