Bug 309706 - [formatter] doesn't work when code has three semicolons side by side
Summary: [formatter] doesn't work when code has three semicolons side by side
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M7   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-19 12:10 EDT by Larsen Doe CLA
Modified: 2010-04-27 01:40 EDT (History)
3 users (show)

See Also:


Attachments
Proposed patch (3.64 KB, patch)
2010-04-20 07:52 EDT, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Larsen Doe CLA 2010-04-19 12:10:35 EDT
Build Identifier: 3.5.2

Eclipse formatter doesn´t format the code when there is a field ending with three semicolons at the top like this:

public class test {

	private int id;;;

	private void dummy() {

		if (true) {
					System.out.println("bla");
		}
	}
}

I don´t exactly know how the three semicolon where added in my real code, but I guess it could relate to bug 280801.


Reproducible: Always

Steps to Reproduce:
1. Have code as in example
2. Press Ctrl+Shift+F
Comment 1 Dani Megert CLA 2010-04-20 04:14:13 EDT
Indeed. Reproduced using I20100414-1200.
Comment 2 Frederic Fusier CLA 2010-04-20 07:52:23 EDT
Created attachment 165411 [details]
Proposed patch

Just loop to consume any consecutive extra semi-colons between type members...
Comment 3 Frederic Fusier CLA 2010-04-20 07:54:33 EDT
Released for 3.6M7 in HEAD stream.

Note that it will not be in today's integration build (i.e. I20100420-0800) as the fix was released after the v_A45 build input was done...
Comment 4 Srikanth Sankaran CLA 2010-04-27 01:40:40 EDT
Verified for 3.6M7 using build I20100424-2000