View | Details | Raw Unified | Return to bug 329709
Collapse All | Expand All

(-)formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java (+5 lines)
Lines 2041-2046 Link Here
2041
			do {
2041
			do {
2042
				try {
2042
				try {
2043
					for (int i = startIndex, max = members.length; i < max; i++) {
2043
					for (int i = startIndex, max = members.length; i < max; i++) {
2044
						while (isNextToken(TerminalTokens.TokenNameSEMICOLON)) {
2045
							this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
2046
							this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
2047
						}
2048
						this.scribe.printNewLine();
2044
						ASTNode member = members[i];
2049
						ASTNode member = members[i];
2045
						if (member instanceof FieldDeclaration) {
2050
						if (member instanceof FieldDeclaration) {
2046
							isChunkStart = memberAlignment.checkChunkStart(Alignment.CHUNK_FIELD, i, this.scribe.scanner.currentPosition);
2051
							isChunkStart = memberAlignment.checkChunkStart(Alignment.CHUNK_FIELD, i, this.scribe.scanner.currentPosition);
(-)src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java (-4 / +66 lines)
Lines 61-68 Link Here
61
	Map formatterOptions;
61
	Map formatterOptions;
62
62
63
	static {
63
	static {
64
//		TESTS_NUMBERS = new int[] { 723 };
64
//		TESTS_NUMBERS = new int[] { 730 };
65
//		TESTS_RANGE = new int[] { 715, -1 };
65
		TESTS_RANGE = new int[] { 730, -1 };
66
	}
66
	}
67
	public static Test suite() {
67
	public static Test suite() {
68
		return buildModelTestSuite(FormatterRegressionTests.class);
68
		return buildModelTestSuite(FormatterRegressionTests.class);
Lines 10892-10898 Link Here
10892
		"}\n"
10892
		"}\n"
10893
	);
10893
	);
10894
}
10894
}
10895
public void testONLY_729() {
10895
public void test729() {
10896
	this.formatterPrefs = null;
10896
	this.formatterPrefs = null;
10897
	String profilePath = getResource("profiles", "b308000.xml");
10897
	String profilePath = getResource("profiles", "b308000.xml");
10898
	this.formatterOptions = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(profilePath, "b308000");
10898
	this.formatterOptions = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(profilePath, "b308000");
Lines 10918-10922 Link Here
10918
		"}\n"
10918
		"}\n"
10919
	);
10919
	);
10920
}
10920
}
10921
10921
public void test730() {
10922
	this.formatterPrefs = null;
10923
	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10924
	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10925
	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
10926
	String source = "enum Fail1 {A;;{}}";
10927
	formatSource(
10928
		source,
10929
		"enum Fail1 {\n" + 
10930
		"	A;\n" + 
10931
		"	;\n" + 
10932
		"	{\n" + 
10933
		"	}\n" + 
10934
		"}"
10935
	);
10936
}
10937
public void test731() {
10938
	this.formatterPrefs = null;
10939
	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10940
	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10941
	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
10942
	String source = "enum Fail2 {A,B;;{}}";
10943
	formatSource(
10944
		source,
10945
		"enum Fail2 {\n" + 
10946
		"	A, B;\n" + 
10947
		"	;\n" + 
10948
		"	{\n" + 
10949
		"	}\n" + 
10950
		"}"
10951
	);
10952
}
10953
public void test732() {
10954
	this.formatterPrefs = null;
10955
	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10956
	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10957
	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
10958
	String source = "enum Fail3 {A;;public void foo() {}}";
10959
	formatSource(
10960
		source,
10961
		"enum Fail3 {\n" + 
10962
		"	A;\n" + 
10963
		"	;\n" + 
10964
		"	public void foo() {\n" + 
10965
		"	}\n" + 
10966
		"}"
10967
	);
10968
}
10969
public void test733() {
10970
	this.formatterPrefs = null;
10971
	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10972
	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10973
	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
10974
	String source = "enum Fail4 {A;;public int i = 0;}";
10975
	formatSource(
10976
		source,
10977
		"enum Fail4 {\n" + 
10978
		"	A;\n" + 
10979
		"	;\n" + 
10980
		"	public int i = 0;\n" + 
10981
		"}"
10982
	);
10983
}
10922
}
10984
}

Return to bug 329709