Bug 98139 - Java Code Formatter is severely confused by following code
Summary: Java Code Formatter is severely confused by following code
Status: CLOSED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0.2   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.1 RC2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-02 12:33 EDT by Bruce Hodge CLA
Modified: 2005-06-10 10:08 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bruce Hodge CLA 2005-06-02 12:33:25 EDT
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;);}
}
Comment 1 Olivier Thomann CLA 2005-06-02 13:07:21 EDT
I am investigating.
Comment 2 Bruce Hodge CLA 2005-06-02 13:23:53 EDT
Bug is present in 3.1RC1.  Bug is not present in 2.1.
Comment 3 Philipe Mulet CLA 2005-06-02 15:54:51 EDT
+1 for RC2
Comment 4 Olivier Thomann CLA 2005-06-02 15:56:46 EDT
Fixed and released in HEAD.
Regression tests added in
org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests.test579/580
Comment 5 Frederic Fusier CLA 2005-06-07 12:09:25 EDT
Verified for 3.1 RC2 using build N20050607-0010 + JDT/Core HEAD
Comment 6 David Audel CLA 2005-06-10 10:08:23 EDT
Verified for 3.1 RC2 using build I20050610-0010