1 /*******************************************************************************
2  * Copyright (c) 2000, 2019 IBM Corporation and others.
3  *
4  * This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License 2.0
6  * which accompanies this distribution, and is available at
7  * https://www.eclipse.org/legal/epl-2.0/
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  *     IBM Corporation - initial API and implementation
13  *     Brock Janiczak - Contribution for bug 150741
14  *     Ray V. (voidstar@gmail.com) - Contribution for bug 282988
15  *     Mateusz Matela <mateusz.matela@gmail.com> - [formatter] Formatter does not format Java code correctly, especially when max line width is set - https://bugs.eclipse.org/303519
16  *******************************************************************************/
17 package org.eclipse.jdt.core.tests.formatter;
18 
19 import java.io.BufferedInputStream;
20 import java.io.IOException;
21 import java.util.ArrayList;
22 import java.util.HashMap;
23 import java.util.Hashtable;
24 import java.util.Map;
25 import java.util.zip.ZipEntry;
26 import java.util.zip.ZipFile;
27 
28 import junit.framework.Test;
29 
30 import org.eclipse.core.resources.IResource;
31 import org.eclipse.core.resources.IWorkspaceDescription;
32 import org.eclipse.core.resources.IWorkspaceRoot;
33 import org.eclipse.core.resources.ResourcesPlugin;
34 import org.eclipse.core.runtime.Path;
35 import org.eclipse.jdt.core.ICompilationUnit;
36 import org.eclipse.jdt.core.IJavaProject;
37 import org.eclipse.jdt.core.JavaCore;
38 import org.eclipse.jdt.core.JavaModelException;
39 import org.eclipse.jdt.core.ToolFactory;
40 import org.eclipse.jdt.core.compiler.CharOperation;
41 import org.eclipse.jdt.core.dom.ASTNode;
42 import org.eclipse.jdt.core.formatter.CodeFormatter;
43 import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants;
44 import org.eclipse.jdt.core.formatter.IndentManipulation;
45 import org.eclipse.jdt.core.tests.model.AbstractJavaModelTests;
46 import org.eclipse.jdt.core.tests.util.Util;
47 import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
48 import org.eclipse.jdt.internal.formatter.DefaultCodeFormatter;
49 import org.eclipse.jdt.internal.formatter.DefaultCodeFormatterOptions;
50 import org.eclipse.jdt.internal.formatter.DefaultCodeFormatterOptions.Alignment;
51 import org.eclipse.jface.text.IRegion;
52 import org.eclipse.jface.text.Region;
53 import org.eclipse.text.edits.TextEdit;
54 
55 @SuppressWarnings({"rawtypes", "unchecked"})
56 public class FormatterRegressionTests extends AbstractJavaModelTests {
57 
58 	protected static IJavaProject JAVA_PROJECT;
59 
60 	public static final int UNKNOWN_KIND = 0;
61 	public static final String IN = "_in";
62 	public static final String OUT = "_out";
63 	public static final boolean DEBUG = false;
64 	static final String LINE_SEPARATOR = System.getProperty("line.separator");
65 	private long time;
66 
67 	DefaultCodeFormatterOptions formatterPrefs;
68 	Map formatterOptions;
69 
70 	static {
71 //		TESTS_NUMBERS = new int[] { 783 };
72 //		TESTS_RANGE = new int[] { 734, -1 };
73 //		TESTS_NAMES = new String[] {"testBug432593"};
74 	}
suite()75 	public static Test suite() {
76 		return buildModelTestSuite(FormatterRegressionTests.class);
77 	}
78 
FormatterRegressionTests(String name)79 	public FormatterRegressionTests(String name) {
80 		super(name);
81 	}
82 
83 	/**
84 	 * Helper method for tests that require a certain compiler compliance level.
85 	 * @param level use one of the {@code CompilerOptions.VERSION_***} constants
86 	 */
setComplianceLevel(String level)87 	protected void setComplianceLevel(String level) {
88 		this.formatterOptions.put(CompilerOptions.OPTION_Compliance, level);
89 		this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, level);
90 		this.formatterOptions.put(CompilerOptions.OPTION_Source, level);
91 	}
92 
93 	/*
94 	 * helper function for tests that are compatible with earlier page width
95 	 */
setPageWidth80()96 	protected void setPageWidth80() {
97 		this.formatterPrefs.page_width = 80;
98 	}
99 
100 	/*
101 	 * helper function for tests that are compatible with earlier page width
102 	 */
setPageWidth80(DefaultCodeFormatterOptions preferences)103 	protected void setPageWidth80(DefaultCodeFormatterOptions preferences) {
104 		preferences.page_width = 80;
105 	}
106 
107 	/*
108 	 * helper function for tests that are compatible with earlier page width
109 	 */
setFormatterOptions80()110 	private void setFormatterOptions80() {
111 		this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, Integer.toString(80));
112 	}
113 
114 	/*
115 	 * helper function for tests that are compatible with earlier Javadoc formatting rules
116 	 */
useOldJavadocTagsFormatting()117 	protected void useOldJavadocTagsFormatting() {
118 		this.formatterPrefs.comment_insert_new_line_for_parameter = true;
119 		this.formatterPrefs.comment_align_tags_descriptions_grouped = false;
120 		this.formatterPrefs.comment_indent_root_tags = true;
121 		this.formatterPrefs.comment_indent_parameter_description = true;
122 	}
123 
124 	/**
125 	 * Helper function for tests that are expect comment width counted from the
126 	 * beginning of the line, not from comment's starting position.
127 	 */
useOldCommentWidthCounting()128 	protected void useOldCommentWidthCounting() {
129 		this.formatterPrefs.comment_count_line_length_from_starting_position = false;
130 	}
131 
132 	/**
133 	 * Helper function for old tests that are expect comment line comments
134 	 * on first column to be formatted.
135 	 */
setFormatLineCommentOnFirstColumn()136 	protected void setFormatLineCommentOnFirstColumn() {
137 		this.formatterPrefs.comment_format_line_comment_starting_on_first_column = true;
138 	}
139 
getResource(String packageName, String resourceName)140 	private String getResource(String packageName, String resourceName) {
141 		IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
142 		IResource resource = workspaceRoot.findMember(new Path("/Formatter/" + packageName + "/" + resourceName));
143 		assertNotNull("No resource found", resource);
144 		return resource.getLocation().toOSString();
145 	}
146 
getZipEntryContents(String fileName, String zipEntryName)147 	private String getZipEntryContents(String fileName, String zipEntryName) {
148 		ZipFile zipFile = null;
149 		BufferedInputStream inputStream  = null;
150 		try {
151 			zipFile = new ZipFile(fileName);
152 			ZipEntry zipEntry = zipFile.getEntry(zipEntryName);
153 			inputStream = new BufferedInputStream(zipFile.getInputStream(zipEntry));
154 			return new String(org.eclipse.jdt.internal.compiler.util.Util.getInputStreamAsCharArray(inputStream, -1, null));
155 		} catch (IOException e) {
156 		} finally {
157 			try {
158 				if (inputStream != null) {
159 					inputStream.close();
160 				}
161 				if (zipFile != null) {
162 					zipFile.close();
163 				}
164 			} catch (IOException e1) {
165 				// Do nothing
166 			}
167 		}
168 		return null;
169 	}
170 
171 	/*
172 	public String getSourceWorkspacePath() {
173 		return getPluginDirectoryPath() +  java.io.File.separator + "workspace";
174 	}
175 	*/
176 
runFormatter(CodeFormatter codeFormatter, String source, int kind, int indentationLevel, int offset, int length, String lineSeparator, boolean repeat)177 	String runFormatter(CodeFormatter codeFormatter, String source, int kind, int indentationLevel, int offset, int length, String lineSeparator, boolean repeat) {
178 //		long time = System.currentTimeMillis();
179 		TextEdit edit = codeFormatter.format(kind, source, offset, length, indentationLevel, lineSeparator);//$NON-NLS-1$
180 //		System.out.println((System.currentTimeMillis() - time) + " ms");
181 		if (edit == null) return null;
182 //		System.out.println(edit.getChildrenSize() + " edits");
183 		String result = org.eclipse.jdt.internal.core.util.Util.editedString(source, edit);
184 
185 		if (repeat && length == source.length()) {
186 //			time = System.currentTimeMillis();
187 			edit = codeFormatter.format(kind, result, 0, result.length(), indentationLevel, lineSeparator);//$NON-NLS-1$
188 //			System.out.println((System.currentTimeMillis() - time) + " ms");
189 			if (edit == null) return null;
190 //			assertEquals("Should not have edits", 0, edit.getChildren().length);
191 			final String result2 = org.eclipse.jdt.internal.core.util.Util.editedString(result, edit);
192 			if (!result.equals(result2)) {
193 				assertSourceEquals("Second formatting is different from first one!", Util.convertToIndependantLineDelimiter(result), Util.convertToIndependantLineDelimiter(result2));
194 			}
195 		}
196 		return result;
197 	}
198 
runFormatter(CodeFormatter codeFormatter, String source, int kind, int indentationLevel, IRegion[] regions, String lineSeparator)199 	String runFormatter(CodeFormatter codeFormatter, String source, int kind, int indentationLevel, IRegion[] regions, String lineSeparator) {
200 //		long time = System.currentTimeMillis();
201 		TextEdit edit = codeFormatter.format(kind, source, regions, indentationLevel, lineSeparator);//$NON-NLS-1$
202 //		System.out.println((System.currentTimeMillis() - time) + " ms");
203 		if (edit == null) return null;
204 
205 		return org.eclipse.jdt.internal.core.util.Util.editedString(source, edit);
206 	}
207 
208 	/**
209 	 * Init formatter preferences with Eclipse default settings.
210 	 */
211 	@Override
setUp()212 	protected void setUp() throws Exception {
213 	    super.setUp();
214 		this.formatterPrefs = DefaultCodeFormatterOptions.getEclipseDefaultSettings();
215 		if (JAVA_PROJECT != null) {
216 			this.formatterOptions = JAVA_PROJECT.getOptions(true);
217 		}
218 	}
219 
220 	/**
221 	 * Create project and set the jar placeholder.
222 	 */
223 	@Override
setUpSuite()224 	public void setUpSuite() throws Exception {
225 		// ensure autobuilding is turned off
226 		IWorkspaceDescription description = getWorkspace().getDescription();
227 		if (description.isAutoBuilding()) {
228 			description.setAutoBuilding(false);
229 			getWorkspace().setDescription(description);
230 		}
231 
232 		if (JAVA_PROJECT == null) {
233 			JAVA_PROJECT = setUpJavaProject("Formatter"); //$NON-NLS-1$
234 		}
235 
236 		if (DEBUG) {
237 			this.time = System.currentTimeMillis();
238 		}
239 	}
240 
241 	/**
242 	 * Reset the jar placeholder and delete project.
243 	 */
244 	@Override
tearDownSuite()245 	public void tearDownSuite() throws Exception {
246 		deleteProject(JAVA_PROJECT); //$NON-NLS-1$
247 		JAVA_PROJECT = null;
248 		if (DEBUG) {
249 			System.out.println("Time spent = " + (System.currentTimeMillis() - this.time));//$NON-NLS-1$
250 		}
251 		super.tearDownSuite();
252 	}
253 
getIn(String compilationUnitName)254 	private String getIn(String compilationUnitName) {
255 		assertNotNull(compilationUnitName);
256 		int dotIndex = compilationUnitName.indexOf('.');
257 		assertTrue(dotIndex != -1);
258 		return compilationUnitName.substring(0, dotIndex) + IN + compilationUnitName.substring(dotIndex);
259 	}
260 
getOut(String compilationUnitName)261 	private String getOut(String compilationUnitName) {
262 		assertNotNull(compilationUnitName);
263 		int dotIndex = compilationUnitName.indexOf('.');
264 		assertTrue(dotIndex != -1);
265 		return compilationUnitName.substring(0, dotIndex) + OUT + compilationUnitName.substring(dotIndex);
266 	}
267 
assertLineEquals(String actualContents, String originalSource, String expectedContents, boolean checkNull)268 	void assertLineEquals(String actualContents, String originalSource, String expectedContents, boolean checkNull) {
269 		if (actualContents == null) {
270 			assertTrue("actualContents is null", checkNull);
271 			assertEquals(expectedContents, originalSource);
272 			return;
273 		}
274 		assertSourceEquals("Different number of length", Util.convertToIndependantLineDelimiter(expectedContents), actualContents);
275 	}
276 
assertLineEquals(String actualContents, String originalSource, String expectedContents)277 	void assertLineEquals(String actualContents, String originalSource, String expectedContents) {
278 		String outputSource = expectedContents == null ? originalSource : expectedContents;
279 		assertLineEquals(actualContents, originalSource, outputSource, false /* do not check null */);
280 	}
281 
codeFormatter()282 	DefaultCodeFormatter codeFormatter() {
283 		if (this.formatterOptions == null) {
284 			this.formatterOptions = JAVA_PROJECT.getOptions(true);
285 		}
286 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(this.formatterPrefs, this.formatterOptions);
287 		return codeFormatter;
288 	}
289 
formatSource(String source)290 	void formatSource(String source) {
291 		// expect unchanged source after formatting
292 		formatSource(source, source);
293 	}
294 
formatSource(String source, String formattedOutput)295 	void formatSource(String source, String formattedOutput) {
296 		formatSource(source, formattedOutput, CodeFormatter.K_COMPILATION_UNIT | CodeFormatter.F_INCLUDE_COMMENTS, 0, true /*repeat formatting twice*/);
297 	}
298 
formatSource(String source, String formattedOutput, int kind)299 	void formatSource(String source, String formattedOutput, int kind) {
300 		formatSource(source, formattedOutput, kind, 0, true /*repeat formatting twice*/);
301 	}
302 
formatSource(String source, String formattedOutput, boolean repeat)303 	void formatSource(String source, String formattedOutput, boolean repeat) {
304 		formatSource(source, formattedOutput, CodeFormatter.K_COMPILATION_UNIT | CodeFormatter.F_INCLUDE_COMMENTS, 0, repeat);
305 	}
306 
formatSource(String source, String formattedOutput, int kind, int indentationLevel, boolean repeat)307 	void formatSource(String source, String formattedOutput, int kind, int indentationLevel, boolean repeat) {
308 		int regionStart = source.indexOf("[#");
309 		if (regionStart != -1) {
310 			ArrayList<IRegion> regions =  new ArrayList<>();
311 			int start = 0;
312 			int delta = 0;
313 			StringBuffer buffer = new StringBuffer();
314 			while (regionStart != -1) {
315 				buffer.append(source.substring(start, regionStart));
316 				int regionEnd = source.indexOf("#]", regionStart+2);
317 				buffer.append(source.substring(regionStart+2, regionEnd));
318 				regions.add(new Region(regionStart-delta, regionEnd-(regionStart+2)));
319 				delta += 4;
320 				start = regionEnd + 2;
321 				regionStart = source.indexOf("[#", start);
322 			}
323 			buffer.append(source.substring(start, source.length()));
324 			String newSource = buffer.toString();
325 			String result;
326 			if (regions.size() == 1) {
327 				// Use offset and length until bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=233967 is fixed
328 				result = runFormatter(codeFormatter(), newSource, kind, indentationLevel, regions.get(0).getOffset(), regions.get(0).getLength(), LINE_SEPARATOR, repeat);
329 			} else {
330 				IRegion[] regionsArray = regions.toArray(new IRegion[regions.size()]);
331 				result = runFormatter(codeFormatter(), newSource, kind, indentationLevel, regionsArray, LINE_SEPARATOR);
332 			}
333 			assertLineEquals(result, newSource, formattedOutput);
334 		} else {
335 			formatSource(source, formattedOutput, kind, indentationLevel, 0, -1, null, repeat);
336 		}
337 	}
338 
formatSource(String source, String formattedOutput, int kind, int indentationLevel, int offset, int length, String lineSeparator, boolean repeat)339 	void formatSource(String source, String formattedOutput, int kind, int indentationLevel, int offset, int length, String lineSeparator, boolean repeat) {
340 		DefaultCodeFormatter codeFormatter = codeFormatter();
341 		String result;
342 		if (length == -1) {
343 			result = runFormatter(codeFormatter, source, kind, indentationLevel, offset, source.length(), lineSeparator, repeat);
344 		} else {
345 			result = runFormatter(codeFormatter, source, kind, indentationLevel, offset, length, lineSeparator, repeat);
346 		}
347 		if (lineSeparator == null) {
348 			assertLineEquals(result, source, formattedOutput);
349 		} else {
350 			// Do not convert line delimiter while comparing result when a specific one is specified
351 			assertNotNull("Error(s) occured while formatting", result);
352 			String outputSource = formattedOutput == null ? source : formattedOutput;
353 			assertSourceEquals("Different number of length", outputSource, result, false/*do not convert line delimiter*/);
354 		}
355 	}
356 
formatSourceInWorkspace(String packageName, String inputCuName, String outputCuName)357 	void formatSourceInWorkspace(String packageName, String inputCuName, String outputCuName) throws JavaModelException {
358 		String input = getCompilationUnit("Formatter", "", packageName, inputCuName).getSource();
359 		formatSource(input, getCompilationUnit("Formatter", "", packageName, outputCuName).getSource());
360 	}
361 
362 
runTest(String packageName, String compilationUnitName)363 	private void runTest(String packageName, String compilationUnitName) {
364 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
365 		preferences.number_of_empty_lines_to_preserve = 0;
366 		setPageWidth80(preferences);
367 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
368 		runTest(codeFormatter, packageName, compilationUnitName, CodeFormatter.K_COMPILATION_UNIT, 0);
369 	}
370 
runTest(CodeFormatter codeFormatter, String packageName, String compilationUnitName)371 	private void runTest(CodeFormatter codeFormatter, String packageName, String compilationUnitName) {
372 		runTest(codeFormatter, packageName, compilationUnitName, CodeFormatter.K_COMPILATION_UNIT, 0);
373 	}
374 
runTest(String packageName, String compilationUnitName, int kind)375 	private void runTest(String packageName, String compilationUnitName, int kind) {
376 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
377 		preferences.number_of_empty_lines_to_preserve = 0;
378 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
379 		runTest(codeFormatter, packageName, compilationUnitName, kind, 0);
380 	}
381 
runTest(CodeFormatter codeFormatter, String packageName, String compilationUnitName, int kind)382 	private void runTest(CodeFormatter codeFormatter, String packageName, String compilationUnitName, int kind) {
383 		runTest(codeFormatter, packageName, compilationUnitName, kind, 0, false, 0, -1);
384 	}
385 
runTest(CodeFormatter codeFormatter, String packageName, String compilationUnitName, int kind, boolean checkNull)386 	private void runTest(CodeFormatter codeFormatter, String packageName, String compilationUnitName, int kind, boolean checkNull) {
387 		runTest(codeFormatter, packageName, compilationUnitName, kind, 0, checkNull, 0, -1);
388 	}
389 
runTest(CodeFormatter codeFormatter, String packageName, String compilationUnitName, int kind, int indentationLevel)390 	private void runTest(CodeFormatter codeFormatter, String packageName, String compilationUnitName, int kind, int indentationLevel) {
391 		runTest(codeFormatter, packageName, compilationUnitName, kind, indentationLevel, false, 0, -1);
392 	}
runTest(CodeFormatter codeFormatter, String packageName, String compilationUnitName, int kind, int indentationLevel, boolean checkNull, int offset, int length)393 	private void runTest(CodeFormatter codeFormatter, String packageName, String compilationUnitName, int kind, int indentationLevel, boolean checkNull, int offset, int length) {
394 		runTest(codeFormatter, packageName, compilationUnitName, kind, indentationLevel, checkNull, offset, length, null);
395 	}
396 
runTest(String input, String output, CodeFormatter codeFormatter, int kind, int indentationLevel, boolean checkNull, int offset, int length, String lineSeparator)397 	private void runTest(String input, String output, CodeFormatter codeFormatter, int kind, int indentationLevel, boolean checkNull, int offset, int length, String lineSeparator) {
398 		String result;
399 		if (length == -1) {
400 			result = runFormatter(codeFormatter, input, kind, indentationLevel, offset, input.length(), lineSeparator, true);
401 		} else {
402 			result = runFormatter(codeFormatter, input, kind, indentationLevel, offset, length, lineSeparator, true);
403 		}
404 		assertLineEquals(result, input, output, checkNull);
405 	}
406 
runTest(String source, String expectedResult, CodeFormatter codeFormatter, int kind, int indentationLevel, boolean checkNull, int offset, int length)407 	private void runTest(String source, String expectedResult, CodeFormatter codeFormatter, int kind, int indentationLevel, boolean checkNull, int offset, int length) {
408 		String result;
409 		if (length == -1) {
410 			result = runFormatter(codeFormatter, source, kind, indentationLevel, offset, source.length(), null, true);
411 		} else {
412 			result = runFormatter(codeFormatter, source, kind, indentationLevel, offset, length, null, true);
413 		}
414 		assertLineEquals(result, source, expectedResult, checkNull);
415 	}
416 
runTest(CodeFormatter codeFormatter, String packageName, String compilationUnitName, int kind, int indentationLevel, boolean checkNull, int offset, int length, String lineSeparator)417 	private void runTest(CodeFormatter codeFormatter, String packageName, String compilationUnitName, int kind, int indentationLevel, boolean checkNull, int offset, int length, String lineSeparator) {
418 		try {
419 			ICompilationUnit sourceUnit = getCompilationUnit("Formatter" , "", packageName, getIn(compilationUnitName)); //$NON-NLS-1$ //$NON-NLS-2$
420 			String source = sourceUnit.getSource();
421 			assertNotNull(source);
422 			ICompilationUnit outputUnit = getCompilationUnit("Formatter" , "", packageName, getOut(compilationUnitName)); //$NON-NLS-1$ //$NON-NLS-2$
423 			assertNotNull(outputUnit);
424 			String result;
425 			if (length == -1) {
426 				result = runFormatter(codeFormatter, source, kind, indentationLevel, offset, source.length(), lineSeparator, true);
427 			} else {
428 				result = runFormatter(codeFormatter, source, kind, indentationLevel, offset, length, lineSeparator, true);
429 			}
430 			assertLineEquals(result, source, outputUnit.getSource(), checkNull);
431 		} catch (JavaModelException e) {
432 			e.printStackTrace();
433 			assertTrue(false);
434 		}
435 	}
436 
runTest(CodeFormatter codeFormatter, String packageName, String compilationUnitName, int kind, int indentationLevel, boolean checkNull, IRegion[] regions, String lineSeparator)437 	private void runTest(CodeFormatter codeFormatter, String packageName, String compilationUnitName, int kind, int indentationLevel, boolean checkNull, IRegion[] regions, String lineSeparator) {
438 		try {
439 			ICompilationUnit sourceUnit = getCompilationUnit("Formatter" , "", packageName, getIn(compilationUnitName)); //$NON-NLS-1$ //$NON-NLS-2$
440 			String s = sourceUnit.getSource();
441 			assertNotNull(s);
442 			ICompilationUnit outputUnit = getCompilationUnit("Formatter" , "", packageName, getOut(compilationUnitName)); //$NON-NLS-1$ //$NON-NLS-2$
443 			assertNotNull(outputUnit);
444 			setPageWidth80();
445 			String result= runFormatter(codeFormatter, s, kind, indentationLevel, regions, lineSeparator);
446 			assertLineEquals(result, s, outputUnit.getSource(), checkNull);
447 		} catch (JavaModelException e) {
448 			e.printStackTrace();
449 			assertTrue(false);
450 		}
451 	}
452 
getSource(ASTNode astNode, char[] source)453 	String getSource(ASTNode astNode, char[] source) {
454 		String result = new String(CharOperation.subarray(source, astNode.getStartPosition() + 1, astNode.getStartPosition() + astNode.getLength() - 1));
455 		if (result.endsWith("\\n")) {
456 			return result.substring(0, result.length() - 2) + LINE_SEPARATOR;
457 		}
458 		return result;
459 	}
460 
test001()461 	public void test001() {
462 		runTest("test001", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
463 	}
test002()464 	public void test002() {
465 		runTest("test002", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
466 	}
467 
test003()468 	public void test003() {
469 		runTest("test003", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
470 	}
471 
test004()472 	public void test004() {
473 		runTest("test004", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
474 	}
test005()475 	public void test005() {
476 		runTest("test005", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
477 	}
478 
test006()479 	public void test006() {
480 		runTest("test006", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
481 	}
482 
test007()483 	public void test007() {
484 		runTest("test007", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
485 	}
486 
test008()487 	public void test008() {
488 		runTest("test008", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
489 	}
490 
test009()491 	public void test009() {
492 		runTest("test009", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
493 	}
494 
test010()495 	public void test010() {
496 		runTest("test010", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
497 	}
498 
test011()499 	public void test011() {
500 		runTest("test011", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
501 	}
502 
test012()503 	public void test012() {
504 		runTest("test012", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
505 	}
506 
test013()507 	public void test013() {
508 		runTest("test013", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
509 	}
510 
test014()511 	public void test014() {
512 		runTest("test014", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
513 	}
514 
test015()515 	public void test015() {
516 		runTest("test015", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
517 	}
518 
test016()519 	public void test016() {
520 		runTest("test016", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
521 	}
522 
test017()523 	public void test017() {
524 		runTest("test017", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
525 	}
526 
test018()527 	public void test018() {
528 		runTest("test018", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
529 	}
530 
test019()531 	public void test019() {
532 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
533 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
534 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
535 		runTest(codeFormatter, "test019", "A_1.java");//$NON-NLS-1$ //$NON-NLS-2$
536 
537 		preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
538 		codeFormatter = new DefaultCodeFormatter(preferences);
539 		runTest(codeFormatter, "test019", "A_2.java");//$NON-NLS-1$ //$NON-NLS-2$
540 	}
541 
test020()542 	public void test020() {
543 		runTest("test020", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
544 	}
545 
test021()546 	public void test021() {
547 		runTest("test021", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
548 	}
549 
test022()550 	public void test022() {
551 		runTest("test022", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
552 	}
553 
test023()554 	public void test023() {
555 		runTest("test023", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
556 	}
557 
test024()558 	public void test024() {
559 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
560 		setPageWidth80(preferences);
561 		preferences.keep_simple_if_on_one_line = true;
562 		preferences.keep_then_statement_on_same_line = true;
563 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
564 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
565 		runTest(codeFormatter, "test024", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
566 	}
567 
test025()568 	public void test025() {
569 		runTest("test025", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
570 	}
571 
test026()572 	public void test026() {
573 		runTest("test026", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
574 	}
575 
test026b()576 	public void test026b() {
577 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
578 		preferences.wrap_outer_expressions_when_nested = false;
579 		setPageWidth80(preferences);
580 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
581 		runTest(codeFormatter, "test026b", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
582 	}
583 
test027()584 	public void test027() {
585 		runTest("test027", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
586 	}
587 
test028()588 	public void test028() {
589 		runTest("test028", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
590 	}
591 
test029()592 	public void test029() {
593 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
594 		preferences.keep_simple_if_on_one_line = true;
595 		preferences.keep_then_statement_on_same_line = true;
596 		preferences.keep_guardian_clause_on_one_line = true;
597 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
598 		preferences.compact_else_if = true;
599 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
600 		runTest(codeFormatter,"test029", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
601 	}
602 
test030()603 	public void test030() {
604 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
605 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
606 		preferences.keep_simple_if_on_one_line = true;
607 		preferences.keep_then_statement_on_same_line = true;
608 		preferences.keep_guardian_clause_on_one_line = true;
609 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
610 		runTest(codeFormatter, "test030", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
611 	}
612 
test031()613 	public void test031() {
614 		runTest("test031", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
615 	}
616 
test032()617 	public void test032() {
618 		runTest("test032", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
619 	}
620 
test033()621 	public void test033() {
622 		runTest("test033", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
623 	}
624 
test034()625 	public void test034() {
626 		runTest("test034", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
627 	}
628 
test035()629 	public void test035() {
630 		runTest("test035", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
631 	}
632 
test036()633 	public void test036() {
634 		runTest("test036", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
635 	}
636 
test037()637 	public void test037() {
638 		runTest("test037", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
639 	}
640 
test038()641 	public void test038() {
642 		runTest("test038", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
643 	}
644 
test039()645 	public void test039() {
646 		runTest("test039", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
647 	}
648 
test040()649 	public void test040() {
650 		runTest("test040", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
651 	}
652 
test041()653 	public void test041() {
654 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
655 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
656 		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
657 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
658 		runTest(codeFormatter, "test041", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
659 	}
660 
test042()661 	public void test042() {
662 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
663 		preferences.number_of_empty_lines_to_preserve = 0;
664 		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
665 		preferences.insert_space_before_opening_brace_in_block = true;
666 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
667 		runTest(codeFormatter, "test042", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
668 	}
669 
test043()670 	public void test043() {
671 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
672 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
673 		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
674 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
675 		runTest(codeFormatter, "test043", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
676 	}
677 
test044()678 	public void test044() {
679 		runTest("test044", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
680 	}
681 
test045()682 	public void test045() {
683 		runTest("test045", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
684 	}
685 
test046()686 	public void test046() {
687 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
688 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
689 		preferences.insert_space_after_assignment_operator = false;
690 		preferences.insert_space_before_assignment_operator = false;
691 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
692 		runTest(codeFormatter, "test046", "A.java", CodeFormatter.K_EXPRESSION);//$NON-NLS-1$ //$NON-NLS-2$
693 	}
694 
test047()695 	public void test047() {
696 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
697 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
698 		preferences.insert_space_after_assignment_operator = true;
699 		preferences.insert_space_before_assignment_operator = true;
700 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
701 		runTest(codeFormatter, "test047", "A.java", CodeFormatter.K_STATEMENTS, 2);//$NON-NLS-1$ //$NON-NLS-2$
702 	}
703 
test048()704 	public void test048() {
705 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
706 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
707 		preferences.insert_space_after_assignment_operator = true;
708 		preferences.insert_space_before_assignment_operator = false;
709 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
710 		runTest(codeFormatter, "test048", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
711 	}
712 
test049()713 	public void test049() {
714 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
715 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
716 		preferences.insert_space_after_assignment_operator = true;
717 		preferences.insert_space_before_assignment_operator = false;
718 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
719 		runTest(codeFormatter, "test049", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
720 	}
721 
test050()722 	public void test050() {
723 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
724 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
725 		preferences.insert_space_after_additive_operator = false;
726 		preferences.insert_space_before_unary_operator = false;
727 		preferences.insert_space_after_unary_operator = false;
728 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
729 		runTest(codeFormatter, "test050", "A.java", CodeFormatter.K_EXPRESSION);//$NON-NLS-1$ //$NON-NLS-2$
730 	}
731 
test051()732 	public void test051() {
733 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
734 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
735 		preferences.insert_space_after_assignment_operator = true;
736 		preferences.insert_space_before_assignment_operator = false;
737 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
738 		runTest(codeFormatter, "test051", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
739 	}
740 
test052()741 	public void test052() {
742 		runTest("test052", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
743 	}
744 
test053()745 	public void test053() {
746 		runTest("test053", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
747 	}
748 
test054()749 	public void test054() {
750 		runTest("test054", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
751 	}
752 
test055()753 	public void test055() {
754 		runTest("test055", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
755 	}
756 
test056()757 	public void test056() {
758 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
759 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
760 		preferences.keep_simple_if_on_one_line = true;
761 		preferences.keep_then_statement_on_same_line = true;
762 		preferences.keep_else_statement_on_same_line = true;
763 		preferences.keep_guardian_clause_on_one_line = true;
764 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
765 		runTest(codeFormatter, "test056", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
766 	}
767 
test057()768 	public void test057() {
769 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
770 		options.put(
771 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
772 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
773 		assertEquals(false, DefaultCodeFormatterConstants.getForceWrapping((String)options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER)));
774 		assertEquals(DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.getWrappingStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER)));
775 		assertEquals(DefaultCodeFormatterConstants.INDENT_DEFAULT, DefaultCodeFormatterConstants.getIndentStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER)));
776 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
777 		preferences.number_of_empty_lines_to_preserve = 0;
778 		preferences.align_type_members_on_columns = true;
779 		setPageWidth80(preferences);
780 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
781 		runTest(codeFormatter, "test057", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
782 	}
783 
test058()784 	public void test058() {
785 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
786 		options.put(
787 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
788 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
789 		assertEquals(false, DefaultCodeFormatterConstants.getForceWrapping((String)options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER)));
790 		assertEquals(DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.getWrappingStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER)));
791 		assertEquals(DefaultCodeFormatterConstants.INDENT_DEFAULT, DefaultCodeFormatterConstants.getIndentStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER)));
792 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
793 		preferences.align_type_members_on_columns = true;
794 		preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
795 		preferences.number_of_empty_lines_to_preserve = 0;
796 		preferences.blank_lines_between_import_groups = 0;
797 		setPageWidth80(preferences);
798 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
799 		runTest(codeFormatter, "test058", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
800 	}
801 
test059()802 	public void test059() {
803 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
804 		preferences.number_of_empty_lines_to_preserve = 0;
805 		preferences.align_type_members_on_columns = false;
806 		setPageWidth80(preferences);
807 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
808 		runTest(codeFormatter, "test059", "Parser.java");//$NON-NLS-1$ //$NON-NLS-2$
809 	}
810 
test060()811 	public void test060() {
812 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
813 		preferences.align_type_members_on_columns = false;
814 		preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
815 		preferences.number_of_empty_lines_to_preserve = 0;
816 		preferences.blank_lines_between_import_groups = 0;
817 		setPageWidth80(preferences);
818 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
819 		//long time = System.currentTimeMillis();
820 		runTest(codeFormatter, "test060", "Parser.java");//$NON-NLS-1$ //$NON-NLS-2$
821 	}
822 
test061()823 	public void test061() {
824 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
825 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
826 		preferences.number_of_empty_lines_to_preserve = 0;
827 		preferences.blank_lines_between_import_groups = 0;
828 		preferences.align_type_members_on_columns = false;
829 		setPageWidth80(preferences);
830 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
831 		runTest(codeFormatter, "test061", "Parser.java");//$NON-NLS-1$ //$NON-NLS-2$
832 	}
833 
test062()834 	public void test062() {
835 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
836 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
837 		preferences.insert_space_after_assignment_operator = true;
838 		preferences.insert_space_before_assignment_operator = false;
839 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
840 		runTest(codeFormatter, "test062", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
841 	}
842 
test063()843 	public void test063() {
844 		runTest("test063", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
845 	}
846 
test064()847 	public void test064() {
848 		runTest("test064", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
849 	}
850 
851 	// Line break inside an array initializer (line comment)
test065()852 	public void test065() {
853 		runTest("test065", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
854 	}
855 
test066()856 	public void test066() {
857 		runTest("test066", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
858 	}
859 
test067()860 	public void test067() {
861 		runTest("test067", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
862 	}
863 
864 	// bug 3181
test068()865 	public void test068() {
866 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
867 		options.put(
868 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION,
869 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
870 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
871 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
872 		preferences.number_of_empty_lines_to_preserve = 0;
873 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
874 		runTest(codeFormatter, "test068", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
875 	}
876 
877 	// bug 3327
test069()878 	public void test069() {
879 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
880 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
881 		preferences.number_of_empty_lines_to_preserve = 0;
882 		preferences.blank_lines_before_first_class_body_declaration = 1;
883 		preferences.blank_lines_before_method = 1;
884 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
885 		runTest(codeFormatter, "test069", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
886 	}
887 
888 	// 5691
test070()889 	public void test070() {
890 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
891 		preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
892 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
893 		runTest(codeFormatter, "test070", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
894 	}
895 
test071()896 	public void test071() {
897 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
898 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
899 		preferences.indent_body_declarations_compare_to_type_header = false;
900 		preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
901 		preferences.align_type_members_on_columns = true;
902 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
903 		runTest(codeFormatter, "test071", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
904 	}
905 
906 	// bug 7224
test072()907 	public void test072() {
908 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
909 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
910 		preferences.number_of_empty_lines_to_preserve = 1;
911 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
912 		runTest(codeFormatter, "test072", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
913 	}
914 
915 	// bug 7439
test073()916 	public void test073() {
917 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
918 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
919 		preferences.number_of_empty_lines_to_preserve = 0;
920 		preferences.keep_simple_if_on_one_line = true;
921 		preferences.keep_then_statement_on_same_line = true;
922 		preferences.keep_guardian_clause_on_one_line = true;
923 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
924 		runTest(codeFormatter, "test073", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
925 	}
926 
927 	// bug 12321
test074()928 	public void test074() {
929 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
930 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
931 		preferences.number_of_empty_lines_to_preserve = 0;
932 		preferences.insert_new_line_before_catch_in_try_statement = true;
933 		preferences.insert_new_line_before_else_in_if_statement = true;
934 		preferences.insert_new_line_before_finally_in_try_statement = true;
935 		preferences.insert_new_line_before_while_in_do_statement = true;
936 		preferences.keep_simple_if_on_one_line = false;
937 		preferences.keep_then_statement_on_same_line = false;
938 		preferences.keep_else_statement_on_same_line = false;
939 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
940 		runTest(codeFormatter, "test074", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
941 	}
942 
943 	// bug 14659
test075()944 	public void test075() {
945 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
946 		options.put(
947 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
948 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
949 		options.put(
950 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION,
951 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
952 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
953 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
954 		preferences.page_width = 57;
955 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
956 		runTest(codeFormatter, "test075", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
957 	}
958 
959 	// bug 16231
test076()960 	public void test076() {
961 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
962 		options.put(
963 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
964 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
965 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
966 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
967 		setPageWidth80(preferences);
968 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
969 		runTest(codeFormatter, "test076", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
970 	}
971 
972 	// bug 16233
test077()973 	public void test077() {
974 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
975 		options.put(
976 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
977 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
978 		options.put(
979 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION,
980 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
981 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
982 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
983 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
984 		runTest(codeFormatter, "test077", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
985 	}
986 
987 	// bug 17349
test078()988 	public void test078() {
989 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
990 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
991 		preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
992 		preferences.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE;
993 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
994 		runTest(codeFormatter, "test078", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
995 	}
996 
997 	// bug 19811
test079()998 	public void test079() {
999 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1000 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1001 		preferences.number_of_empty_lines_to_preserve = 0;
1002 		setPageWidth80(preferences);
1003 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1004 		runTest(codeFormatter, "test079", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1005 	}
1006 
1007 	// bug 19811
test080()1008 	public void test080() {
1009 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
1010 		options.put(
1011 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
1012 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
1013 		options.put(
1014 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION,
1015 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
1016 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
1017 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1018 		preferences.continuation_indentation = 2;
1019 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1020 		runTest(codeFormatter, "test080", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
1021 	}
1022 
1023 	// bug 19811
test081()1024 	public void test081() {
1025 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
1026 		options.put(
1027 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
1028 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
1029 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
1030 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1031 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1032 		runTest(codeFormatter, "test081", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
1033 	}
1034 
1035 	// bug 19999
test082()1036 	public void test082() {
1037 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1038 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1039 		preferences.number_of_empty_lines_to_preserve = 2;
1040 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1041 		runTest(codeFormatter, "test082", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
1042 	}
1043 
1044 	// bug 20721
test083()1045 	public void test083() {
1046 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1047 		preferences.number_of_empty_lines_to_preserve = 0;
1048 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1049 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1050 		runTest(codeFormatter, "test083", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
1051 	}
1052 
1053 	// bug 21943
test084()1054 	public void test084() {
1055 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1056 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1057 		preferences.number_of_empty_lines_to_preserve = 0;
1058 		preferences.insert_space_before_opening_paren_in_if = false;
1059 		preferences.insert_space_before_opening_paren_in_for = false;
1060 		preferences.insert_space_before_opening_paren_in_while = false;
1061 		preferences.keep_simple_if_on_one_line = true;
1062 		preferences.keep_then_statement_on_same_line = true;
1063 		preferences.keep_guardian_clause_on_one_line = true;
1064 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1065 		runTest(codeFormatter, "test084", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
1066 	}
1067 
1068 	// bug 21943
test085()1069 	public void test085() {
1070 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1071 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1072 		preferences.number_of_empty_lines_to_preserve = 0;
1073 		preferences.insert_space_before_opening_paren_in_if = true;
1074 		preferences.insert_space_before_opening_paren_in_for = true;
1075 		preferences.insert_space_before_opening_paren_in_while = true;
1076 		preferences.keep_simple_if_on_one_line = true;
1077 		preferences.keep_then_statement_on_same_line = true;
1078 		preferences.keep_guardian_clause_on_one_line = true;
1079 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1080 		runTest(codeFormatter, "test085", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
1081 	}
1082 
1083 	// bug 22313
test086()1084 	public void test086() {
1085 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1086 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1087 		preferences.insert_new_line_before_catch_in_try_statement = true;
1088 		preferences.insert_new_line_before_else_in_if_statement = true;
1089 		preferences.insert_new_line_before_finally_in_try_statement = true;
1090 		preferences.insert_new_line_before_while_in_do_statement = true;
1091 		preferences.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE;
1092 		preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
1093 		preferences.brace_position_for_method_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
1094 		preferences.insert_space_before_relational_operator = false;
1095 		preferences.insert_space_after_relational_operator = false;
1096 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1097 		runTest(codeFormatter, "test086", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
1098 	}
1099 
1100 	// bug 23144
test087()1101 	public void test087() {
1102 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1103 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1104 		preferences.keep_simple_if_on_one_line = true;
1105 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1106 		runTest(codeFormatter, "test087", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1107 	}
1108 
1109 	// bug 23144
test088()1110 	public void test088() {
1111 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1112 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1113 		preferences.keep_simple_if_on_one_line = false;
1114 		preferences.keep_guardian_clause_on_one_line = false;
1115 		preferences.keep_then_statement_on_same_line = false;
1116 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1117 		runTest(codeFormatter, "test088", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1118 	}
1119 
1120 	// bug 24200
test089()1121 	public void test089() {
1122 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1123 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1124 		preferences.insert_space_after_opening_paren_in_parenthesized_expression = true;
1125 		preferences.insert_space_before_closing_paren_in_parenthesized_expression = true;
1126 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1127 		runTest(codeFormatter, "test089", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1128 	}
1129 
1130 	// bug 24200
test090()1131 	public void test090() {
1132 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1133 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1134 		preferences.insert_space_after_opening_bracket_in_array_reference = true;
1135 		preferences.insert_space_before_closing_bracket_in_array_reference = true;
1136 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1137 		runTest(codeFormatter, "test090", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1138 	}
1139 
1140 	// bug 25559
test091()1141 	public void test091() {
1142 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1143 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1144 		preferences.insert_space_after_assignment_operator = false;
1145 		preferences.insert_space_before_assignment_operator = false;
1146 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1147 		runTest(codeFormatter, "test091", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1148 	}
1149 
1150 	// bug 25559
test092()1151 	public void test092() {
1152 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1153 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1154 		preferences.insert_space_after_relational_operator = false;
1155 		preferences.insert_space_before_relational_operator = false;
1156 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1157 		runTest(codeFormatter, "test092", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1158 	}
1159 
1160 	// bug 25559
test093()1161 	public void test093() {
1162 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1163 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1164 		preferences.insert_space_after_closing_paren_in_cast = false;
1165 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1166 		runTest(codeFormatter, "test093", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1167 	}
1168 
1169 	// bug 25559
test094()1170 	public void test094() {
1171 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1172 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1173 		preferences.insert_space_after_assignment_operator = false;
1174 		preferences.insert_space_before_assignment_operator = false;
1175 		preferences.insert_space_after_comma_in_method_invocation_arguments = false;
1176 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1177 		runTest(codeFormatter, "test094", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1178 	}
1179 
1180 	// bug 27196
test095()1181 	public void test095() {
1182 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1183 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1184 		preferences.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
1185 		preferences.indent_statements_compare_to_block = false;
1186 		preferences.indent_statements_compare_to_body = false;
1187 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1188 		runTest(codeFormatter, "test095", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1189 	}
1190 
1191 	// bug 28098
test096()1192 	public void test096() {
1193 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1194 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1195 		preferences.join_lines_in_comments = false;
1196 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1197 		runTest(codeFormatter, "test096", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS + CodeFormatter.F_INCLUDE_COMMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1198 	}
1199 
1200 	// bug 34897
test097()1201 	public void test097() {
1202 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1203 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1204 		preferences.insert_space_after_opening_paren_in_method_invocation = true;
1205 		preferences.insert_space_before_closing_paren_in_method_invocation = true;
1206 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1207 		runTest(codeFormatter, "test097", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1208 	}
1209 
1210 	// bug 35173
test098()1211 	public void test098() {
1212 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1213 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1214 		preferences.brace_position_for_anonymous_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
1215 		preferences.brace_position_for_method_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
1216 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1217 		runTest(codeFormatter, "test098", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1218 	}
1219 
1220 	// bug 35433
test099()1221 	public void test099() {
1222 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1223 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1224 		preferences.insert_space_before_opening_paren_in_method_declaration = true;
1225 		preferences.insert_space_before_opening_paren_in_for = true;
1226 		preferences.insert_space_after_semicolon_in_for = false;
1227 		preferences.put_empty_statement_on_new_line = false;
1228 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1229 		runTest(codeFormatter, "test099", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
1230 	}
1231 
test100()1232 	public void test100() {
1233 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1234 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1235 		preferences.insert_space_before_opening_brace_in_array_initializer = true;
1236 		preferences.insert_space_after_opening_brace_in_array_initializer = true;
1237 		preferences.insert_space_before_closing_brace_in_array_initializer = true;
1238 		preferences.number_of_empty_lines_to_preserve = 1;
1239 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1240 		runTest(codeFormatter, "test100", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
1241 	}
1242 
1243 	// bug 36832
test101()1244 	public void test101() {
1245 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1246 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1247 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1248 		runTest(codeFormatter, "test101", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
1249 	}
1250 
1251 	// bug 37057
test102()1252 	public void test102() {
1253 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1254 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1255 		preferences.number_of_empty_lines_to_preserve = 1;
1256 		preferences.line_separator = "\n";//$NON-NLS-1$
1257 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1258 		runTest(codeFormatter, "test102", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
1259 	}
1260 
1261 	// bug 37106
test103()1262 	public void test103() {
1263 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1264 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1265 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1266 		runTest(codeFormatter, "test103", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1267 	}
1268 
1269 	// bug 37657
test104()1270 	public void test104() {
1271 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1272 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1273 		preferences.insert_space_after_opening_paren_in_if = true;
1274 		preferences.insert_space_before_closing_paren_in_if = true;
1275 		preferences.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
1276 		preferences.insert_new_line_before_catch_in_try_statement = true;
1277 		preferences.insert_new_line_before_else_in_if_statement = true;
1278 		preferences.insert_new_line_before_finally_in_try_statement = true;
1279 		preferences.insert_new_line_before_while_in_do_statement = true;
1280 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1281 		runTest(codeFormatter, "test104", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1282 	}
1283 
1284 	// bug 38151
test105()1285 	public void test105() {
1286 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1287 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1288 		preferences.brace_position_for_method_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
1289 		preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
1290 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1291 		runTest(codeFormatter, "test105", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1292 	}
1293 
1294 	// bug 39603
test106()1295 	public void test106() {
1296 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1297 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1298 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1299 		runTest(codeFormatter, "test106", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1300 	}
1301 
1302 	// bug 39607
test107()1303 	public void test107() {
1304 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1305 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1306 		preferences.keep_then_statement_on_same_line = false;
1307 		preferences.keep_simple_if_on_one_line = false;
1308 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1309 		runTest(codeFormatter, "test107", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1310 	}
1311 
1312 	// bug 40777
test108()1313 	public void test108() {
1314 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1315 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1316 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1317 		runTest(codeFormatter, "test108", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
1318 	}
1319 
test109()1320 	public void test109() {
1321 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1322 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1323 		preferences.blank_lines_before_package = 2;
1324 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1325 		runTest(codeFormatter, "test109", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
1326 	}
1327 
test110()1328 	public void test110() {
1329 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1330 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1331 		preferences.blank_lines_before_package = 1;
1332 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1333 		runTest(codeFormatter, "test110", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
1334 	}
1335 
test111()1336 	public void test111() {
1337 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1338 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1339 		preferences.blank_lines_after_package = 1;
1340 		preferences.blank_lines_before_first_class_body_declaration = 1;
1341 		preferences.blank_lines_before_new_chunk = 1;
1342 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1343 		runTest(codeFormatter, "test111", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
1344 	}
1345 
test112()1346 	public void test112() {
1347 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1348 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1349 		preferences.blank_lines_after_package = 1;
1350 		preferences.blank_lines_before_first_class_body_declaration = 1;
1351 		preferences.blank_lines_before_new_chunk = 1;
1352 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1353 		runTest(codeFormatter, "test112", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
1354 	}
1355 
test113()1356 	public void test113() {
1357 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
1358 		options.put(
1359 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
1360 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
1361 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
1362 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1363 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1364 		runTest(codeFormatter, "test113", "A.java");//$NON-NLS-1$ //$NON-NLS-2
1365 	}
1366 
1367 	// bug 14659
test114()1368 	public void test114() {
1369 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
1370 		options.put(
1371 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
1372 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
1373 		options.put(
1374 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION,
1375 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
1376 		assertEquals(false, DefaultCodeFormatterConstants.getForceWrapping((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION)));
1377 		assertEquals(DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.getWrappingStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION)));
1378 		assertEquals(DefaultCodeFormatterConstants.INDENT_ON_COLUMN, DefaultCodeFormatterConstants.getIndentStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION)));
1379 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
1380 		preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
1381 		preferences.page_width = 57;
1382 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1383 		runTest(codeFormatter, "test114", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
1384 	}
1385 
1386 	// bug 14659
test115()1387 	public void test115() {
1388 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
1389 		options.put(
1390 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
1391 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
1392 		options.put(
1393 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION,
1394 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
1395 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
1396 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1397 		preferences.page_width = 57;
1398 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1399 		runTest(codeFormatter, "test115", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
1400 	}
1401 
1402 	// bug 14659
test116()1403 	public void test116() {
1404 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
1405 		options.put(
1406 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
1407 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
1408 		options.put(
1409 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION,
1410 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
1411 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
1412 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1413 		preferences.page_width = 57;
1414 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1415 		runTest(codeFormatter, "test116", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
1416 	}
1417 
1418 	// JDT/UI tests
test117()1419 	public void test117() {
1420 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1421 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1422 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1423 		runTest(codeFormatter, "test117", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
1424 	}
1425 
1426 	// JDT/UI tests
test118()1427 	public void test118() {
1428 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1429 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1430 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1431 		runTest(codeFormatter, "test118", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
1432 	}
1433 
1434 	// JDT/UI tests
test119()1435 	public void test119() {
1436 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1437 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1438 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1439 		runTest(codeFormatter, "test119", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1440 	}
1441 
1442 	// JDT/UI tests
test120()1443 	public void test120() {
1444 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1445 		preferences.number_of_empty_lines_to_preserve = 0;
1446 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1447 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1448 		runTest(codeFormatter, "test120", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
1449 	}
1450 
1451 	// JDT/UI tests
test121()1452 	public void test121() {
1453 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1454 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1455 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1456 		runTest(codeFormatter, "test121", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1457 	}
1458 
1459 	// probing statements
test122()1460 	public void test122() {
1461 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1462 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1463 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1464 		runTest(codeFormatter, "test122", "A.java", CodeFormatter.K_UNKNOWN);//$NON-NLS-1$ //$NON-NLS-2$
1465 	}
1466 
1467 	// probing compilation unit
test123()1468 	public void test123() {
1469 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1470 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1471 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1472 		runTest(codeFormatter, "test123", "A.java", CodeFormatter.K_UNKNOWN);//$NON-NLS-1$ //$NON-NLS-2$
1473 	}
1474 
1475 	// probing class body declarations
test124()1476 	public void test124() {
1477 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
1478 		options.put(
1479 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
1480 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
1481 		options.put(
1482 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION,
1483 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
1484 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
1485 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1486 		preferences.page_width = 57;
1487 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1488 		runTest(codeFormatter, "test124", "A.java", CodeFormatter.K_UNKNOWN);//$NON-NLS-1$ //$NON-NLS-2$
1489 	}
1490 
1491 	// probing expression
test125()1492 	public void test125() {
1493 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1494 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1495 		preferences.insert_space_after_additive_operator = false;
1496 		preferences.insert_space_before_unary_operator = false;
1497 		preferences.insert_space_after_unary_operator = false;
1498 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1499 		runTest(codeFormatter, "test125", "A.java", CodeFormatter.K_UNKNOWN);//$NON-NLS-1$ //$NON-NLS-2$
1500 	}
1501 
1502 	// probing unrecognized source
test126()1503 	public void test126() {
1504 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1505 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1506 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1507 		runTest(codeFormatter, "test126", "A.java", CodeFormatter.K_UNKNOWN, true);//$NON-NLS-1$ //$NON-NLS-2$
1508 	}
1509 
1510 	// probing unrecognized source
test127()1511 	public void test127() {
1512 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1513 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1514 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1515 		runTest(codeFormatter, "test127", "A.java", CodeFormatter.K_UNKNOWN);//$NON-NLS-1$ //$NON-NLS-2$
1516 	}
1517 
1518 	// probing unrecognized source
test128()1519 	public void test128() {
1520 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1521 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1522 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1523 		runTest(codeFormatter, "test128", "A.java", CodeFormatter.K_UNKNOWN, true);//$NON-NLS-1$ //$NON-NLS-2$
1524 	}
1525 
test129()1526 	public void test129() {
1527 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1528 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1529 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1530 		runTest(codeFormatter, "test129", "A.java", CodeFormatter.K_STATEMENTS, true);//$NON-NLS-1$ //$NON-NLS-2$
1531 	}
1532 
test130()1533 	public void test130() {
1534 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1535 		preferences.number_of_empty_lines_to_preserve = 0;
1536 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1537 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1538 		runTest(codeFormatter, "test130", "A.java", CodeFormatter.K_COMPILATION_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
1539 	}
1540 
test131()1541 	public void test131() {
1542 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1543 		preferences.number_of_empty_lines_to_preserve = 0;
1544 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1545 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1546 		runTest(codeFormatter, "test131", "A.java", CodeFormatter.K_COMPILATION_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
1547 	}
1548 
test132()1549 	public void test132() {
1550 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1551 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1552 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1553 		runTest(codeFormatter, "test132", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS, true);//$NON-NLS-1$ //$NON-NLS-2$
1554 	}
1555 
test133()1556 	public void test133() {
1557 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1558 		preferences.number_of_empty_lines_to_preserve = 0;
1559 		preferences.blank_lines_between_import_groups = 0;
1560 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1561 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1562 		runTest(codeFormatter, "test133", "A.java", CodeFormatter.K_COMPILATION_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
1563 	}
1564 
test134()1565 	public void test134() {
1566 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1567 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1568 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1569 		runTest(codeFormatter, "test134", "A.java", CodeFormatter.K_COMPILATION_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
1570 	}
1571 
test135()1572 	public void test135() {
1573 		Hashtable options = new Hashtable();
1574 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
1575 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
1576 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
1577 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
1578 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
1579 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
1580 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
1581 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
1582 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
1583 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
1584 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1585 		runTest(codeFormatter, "test135", "A.java", CodeFormatter.K_STATEMENTS, true);//$NON-NLS-1$ //$NON-NLS-2$
1586 	}
1587 
test136()1588 	public void test136() {
1589 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1590 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1591 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1592 		runTest(codeFormatter, "test136", "A.java", CodeFormatter.K_COMPILATION_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
1593 	}
1594 
test137()1595 	public void test137() {
1596 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1597 		preferences.number_of_empty_lines_to_preserve = 0;
1598 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1599 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1600 		runTest(codeFormatter, "test137", "A.java", CodeFormatter.K_COMPILATION_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
1601 	}
1602 
test138()1603 	public void test138() {
1604 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1605 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1606 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1607 		runTest(codeFormatter, "test138", "A.java", CodeFormatter.K_STATEMENTS, 2, true, 8, 37);//$NON-NLS-1$ //$NON-NLS-2$
1608 	}
1609 
test139()1610 	public void test139() {
1611 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1612 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1613 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1614 		runTest(codeFormatter, "test139", "A.java", CodeFormatter.K_STATEMENTS, 0, true, 0, 5);//$NON-NLS-1$ //$NON-NLS-2$
1615 	}
1616 
test140()1617 	public void test140() {
1618 		setComplianceLevel(CompilerOptions.VERSION_14);
1619 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1620 		preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
1621 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1622 		runTest(codeFormatter, "test140", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
1623 	}
1624 
test141()1625 	public void test141() {
1626 		setComplianceLevel(CompilerOptions.VERSION_14);
1627 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1628 		preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
1629 		preferences.indent_switchstatements_compare_to_cases = false;
1630 		preferences.indent_switchstatements_compare_to_switch = false;
1631 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1632 		runTest(codeFormatter, "test141", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
1633 	}
1634 
test142()1635 	public void test142() {
1636 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1637 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1638 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1639 		runTest(codeFormatter, "test142", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS, 1);//$NON-NLS-1$ //$NON-NLS-2$
1640 	}
1641 
test143()1642 	public void test143() {
1643 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1644 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1645 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1646 		runTest(codeFormatter, "test143", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS, 1);//$NON-NLS-1$ //$NON-NLS-2$
1647 	}
1648 
test144()1649 	public void test144() {
1650 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1651 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1652 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1653 		runTest(codeFormatter, "test144", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
1654 	}
1655 
test145()1656 	public void test145() {
1657 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1658 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1659 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1660 		runTest(codeFormatter, "test145", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
1661 	}
1662 
test146()1663 	public void test146() {
1664 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1665 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1666 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1667 		runTest(codeFormatter, "test146", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
1668 	}
1669 
test147()1670 	public void test147() {
1671 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1672 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1673 		preferences.insert_space_before_assignment_operator = false;
1674 		preferences.number_of_empty_lines_to_preserve = 1;
1675 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1676 		runTest(codeFormatter, "test147", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
1677 	}
1678 
test148()1679 	public void test148() {
1680 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1681 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1682 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1683 		runTest(codeFormatter, "test148", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1684 	}
1685 
test149()1686 	public void test149() {
1687 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1688 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1689 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1690 		runTest(codeFormatter, "test149", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1691 	}
1692 
test150()1693 	public void test150() {
1694 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1695 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1696 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1697 		runTest(codeFormatter, "test150", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1698 	}
1699 
test151()1700 	public void test151() {
1701 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1702 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1703 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1704 		runTest(codeFormatter, "test151", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
1705 	}
1706 
test152()1707 	public void test152() {
1708 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1709 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1710 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1711 		runTest(codeFormatter, "test152", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1712 	}
1713 
test153()1714 	public void test153() {
1715 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1716 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1717 		preferences.align_type_members_on_columns = true;
1718 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1719 		runTest(codeFormatter, "test153", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
1720 	}
1721 
test154()1722 	public void test154() {
1723 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1724 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1725 		runTest(codeFormatter, "test154", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
1726 	}
1727 
test155()1728 	public void test155() {
1729 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getJavaConventionsSettings());
1730         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
1731         preferences.tab_size = 4;
1732 		setPageWidth80(preferences);
1733 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1734 		runTest(codeFormatter, "test155", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1735 	}
1736 
1737 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=44036
test156()1738 	public void test156() {
1739 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getJavaConventionsSettings());
1740         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
1741         preferences.tab_size = 4;
1742 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1743 		runTest(codeFormatter, "test156", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
1744 	}
1745 
test157()1746 	public void test157() {
1747 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1748 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1749 		runTest(codeFormatter, "test157", "A.java", CodeFormatter.K_STATEMENTS, 0, true, 11, 7);//$NON-NLS-1$ //$NON-NLS-2$
1750 	}
1751 
test158()1752 	public void test158() {
1753 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1754 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1755 		runTest(codeFormatter, "test158", "A.java", CodeFormatter.K_STATEMENTS, 0, true, 11, 8);//$NON-NLS-1$ //$NON-NLS-2$
1756 	}
1757 
test159()1758 	public void test159() {
1759 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1760 		preferences.number_of_empty_lines_to_preserve = 1;
1761 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1762 		runTest(codeFormatter, "test159", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
1763 	}
1764 
1765 	/*
1766 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44481
1767 	 */
test160()1768 	public void test160() {
1769 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1770 		preferences.insert_new_line_before_catch_in_try_statement = false;
1771 		preferences.insert_new_line_before_else_in_if_statement = false;
1772 		preferences.insert_new_line_before_finally_in_try_statement = false;
1773 		preferences.insert_new_line_before_while_in_do_statement = false;
1774 		preferences.compact_else_if = true;
1775 		preferences.number_of_empty_lines_to_preserve = 0;
1776 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1777 		runTest(codeFormatter, "test160", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
1778 	}
1779 
1780 	/*
1781 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44481
1782 	 */
test161()1783 	public void test161() {
1784 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1785 		preferences.number_of_empty_lines_to_preserve = 0;
1786 		preferences.insert_new_line_before_catch_in_try_statement = false;
1787 		preferences.insert_new_line_before_else_in_if_statement = false;
1788 		preferences.insert_new_line_before_finally_in_try_statement = false;
1789 		preferences.insert_new_line_before_while_in_do_statement = false;
1790 		preferences.compact_else_if = false;
1791 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1792 		runTest(codeFormatter, "test161", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
1793 	}
1794 
1795 	/*
1796 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44481
1797 	 */
test162()1798 	public void test162() {
1799 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1800 		preferences.number_of_empty_lines_to_preserve = 0;
1801 		preferences.insert_new_line_before_catch_in_try_statement = true;
1802 		preferences.insert_new_line_before_else_in_if_statement = true;
1803 		preferences.insert_new_line_before_finally_in_try_statement = true;
1804 		preferences.insert_new_line_before_while_in_do_statement = true;
1805 		preferences.compact_else_if = false;
1806 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1807 		runTest(codeFormatter, "test162", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
1808 	}
1809 
1810 	/*
1811 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44481
1812 	 */
test163()1813 	public void test163() {
1814 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1815 		preferences.number_of_empty_lines_to_preserve = 0;
1816 		preferences.insert_new_line_before_catch_in_try_statement = true;
1817 		preferences.insert_new_line_before_else_in_if_statement = true;
1818 		preferences.insert_new_line_before_finally_in_try_statement = true;
1819 		preferences.insert_new_line_before_while_in_do_statement = true;
1820 		preferences.compact_else_if = true;
1821 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1822 		runTest(codeFormatter, "test163", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
1823 	}
1824 
1825 	/**
1826 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44493
1827 	 */
test164()1828 	public void test164() {
1829 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1830 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1831 		runTest(codeFormatter, "test164", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
1832 	}
1833 
test165()1834 	public void test165() {
1835 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1836 		preferences.number_of_empty_lines_to_preserve = 0;
1837 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1838 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1839 		runTest(codeFormatter, "test165", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
1840 	}
1841 
1842 	/**
1843 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44546
1844 	 */
test166()1845 	public void test166() {
1846 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1847 		preferences.number_of_empty_lines_to_preserve = 0;
1848 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1849 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1850 		runTest(codeFormatter, "test166", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
1851 	}
1852 
1853 	/**
1854 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44503
1855 	 */
test167()1856 	public void test167() {
1857 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1858 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1859 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1860 		runTest(codeFormatter, "test167", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
1861 	}
test167b()1862 	public void test167b() {
1863 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1864 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1865 		preferences.wrap_outer_expressions_when_nested = false;
1866 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1867 		runTest(codeFormatter, "test167b", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
1868 	}
1869 
1870 	/**
1871 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44503
1872 	 */
test169()1873 	public void test169() {
1874 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1875 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1876 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1877 		runTest(codeFormatter, "test169", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
1878 	}
test169b()1879 	public void test169b() {
1880 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1881 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1882 		preferences.wrap_outer_expressions_when_nested = false;
1883 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1884 		runTest(codeFormatter, "test169b", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
1885 	}
1886 
1887 	/**
1888 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44503
1889 	 */
test170()1890 	public void test170() {
1891 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1892 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1893 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1894 		runTest(codeFormatter, "test170", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
1895 	}
test170b()1896 	public void test170b() {
1897 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1898 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1899 		preferences.wrap_outer_expressions_when_nested = false;
1900 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1901 		runTest(codeFormatter, "test170b", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
1902 	}
1903 
1904 	/**
1905 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44576
1906 	 */
test171()1907 	public void test171() {
1908 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1909 		preferences.number_of_empty_lines_to_preserve = 0;
1910 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1911 		preferences.brace_position_for_anonymous_type_declaration = DefaultCodeFormatterConstants.END_OF_LINE;
1912 		preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.END_OF_LINE;
1913 		preferences.brace_position_for_method_declaration = DefaultCodeFormatterConstants.END_OF_LINE;
1914 		preferences.brace_position_for_block = DefaultCodeFormatterConstants.END_OF_LINE;
1915 		preferences.brace_position_for_switch = DefaultCodeFormatterConstants.END_OF_LINE;
1916 		preferences.compact_else_if = false;
1917 		preferences.insert_new_line_before_catch_in_try_statement = true;
1918 		preferences.insert_new_line_before_else_in_if_statement = true;
1919 		preferences.insert_new_line_before_finally_in_try_statement = true;
1920 		preferences.insert_new_line_before_while_in_do_statement = true;
1921 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1922 		runTest(codeFormatter, "test171", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
1923 	}
1924 
1925 	/**
1926 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44576
1927 	 */
test172()1928 	public void test172() {
1929 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1930 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1931 		preferences.number_of_empty_lines_to_preserve = 0;
1932 		preferences.brace_position_for_anonymous_type_declaration = DefaultCodeFormatterConstants.END_OF_LINE;
1933 		preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.END_OF_LINE;
1934 		preferences.brace_position_for_method_declaration = DefaultCodeFormatterConstants.END_OF_LINE;
1935 		preferences.brace_position_for_block = DefaultCodeFormatterConstants.END_OF_LINE;
1936 		preferences.brace_position_for_switch = DefaultCodeFormatterConstants.END_OF_LINE;
1937 		preferences.compact_else_if = false;
1938 		preferences.insert_new_line_before_catch_in_try_statement = true;
1939 		preferences.insert_new_line_before_else_in_if_statement = true;
1940 		preferences.insert_new_line_before_finally_in_try_statement = true;
1941 		preferences.insert_new_line_before_while_in_do_statement = true;
1942 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1943 		runTest(codeFormatter, "test172", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
1944 	}
1945 
1946 	/**
1947 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44570
1948 	 */
test173()1949 	public void test173() {
1950 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1951 		preferences.number_of_empty_lines_to_preserve = 0;
1952 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1953 		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
1954 		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
1955 		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
1956 		preferences.keep_code_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
1957 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1958 		runTest(codeFormatter, "test173", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
1959 	}
1960 
1961 	/**
1962 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44570
1963 	 */
test174()1964 	public void test174() {
1965 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1966 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1967 		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
1968 		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
1969 		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
1970 		preferences.keep_code_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
1971 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1972 		runTest(codeFormatter, "test174", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
1973 	}
1974 
1975 	/**
1976 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44570
1977 	 */
test175()1978 	public void test175() {
1979 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1980 		preferences.number_of_empty_lines_to_preserve = 0;
1981 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1982 		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
1983 		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
1984 		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
1985 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1986 		runTest(codeFormatter, "test175", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
1987 	}
1988 
1989 	/**
1990 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44570
1991 	 */
test176()1992 	public void test176() {
1993 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
1994 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
1995 		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
1996 		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
1997 		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
1998 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
1999 		runTest(codeFormatter, "test176", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
2000 	}
2001 
2002 	/**
2003 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44570
2004 	 */
test177()2005 	public void test177() {
2006 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
2007 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
2008 		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
2009 		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
2010 		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
2011 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2012 		runTest(codeFormatter, "test177", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
2013 	}
2014 
2015 	/**
2016 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44570
2017 	 */
test178()2018 	public void test178() {
2019 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
2020 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
2021 		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
2022 		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
2023 		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
2024 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2025 		runTest(codeFormatter, "test178", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
2026 	}
2027 
2028 	/**
2029 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44570
2030 	 */
test179()2031 	public void test179() {
2032 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
2033 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
2034 		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
2035 		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
2036 		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
2037 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2038 		runTest(codeFormatter, "test179", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
2039 	}
2040 
2041 	/**
2042 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44570
2043 	 */
test180()2044 	public void test180() {
2045 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
2046 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
2047 		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
2048 		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
2049 		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
2050 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2051 		runTest(codeFormatter, "test180", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
2052 	}
2053 
2054 	/**
2055 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44651
2056 	 */
test181()2057 	public void test181() {
2058 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
2059 		preferences.number_of_empty_lines_to_preserve = 0;
2060 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
2061 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2062 		runTest(codeFormatter, "test181", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
2063 	}
2064 
2065 	/**
2066 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44651
2067 	 */
test182()2068 	public void test182() {
2069 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
2070 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
2071 		preferences.number_of_empty_lines_to_preserve = 1;
2072 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2073 		runTest(codeFormatter, "test182", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
2074 	}
2075 
2076 	/**
2077 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44653
2078 	 */
test183()2079 	public void test183() {
2080 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
2081 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
2082 		preferences.number_of_empty_lines_to_preserve = 1;
2083 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2084 		runTest(codeFormatter, "test183", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
2085 	}
2086 
2087 	/**
2088 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44653
2089 	 */
test184()2090 	public void test184() {
2091 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
2092 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
2093 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2094 		runTest(codeFormatter, "test184", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
2095 	}
2096 
2097 	/**
2098 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44653
2099 	 */
test185()2100 	public void test185() {
2101 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
2102 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
2103 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2104 		runTest(codeFormatter, "test185", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
2105 	}
2106 
2107 	/**
2108 	 */
_test186()2109 	public void _test186() {
2110 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
2111 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
2112 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2113 		runTest(codeFormatter, "test186", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
2114 	}
2115 
2116 	/**
2117 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44839
2118 	 */
test187()2119 	public void test187() {
2120 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
2121 		preferences.number_of_empty_lines_to_preserve = 0;
2122 		preferences.blank_lines_between_import_groups = 0;
2123 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
2124 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2125 		runTest(codeFormatter, "test187", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
2126 	}
2127 
2128 	/**
2129 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44839
2130 	 */
test188()2131 	public void test188() {
2132 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
2133 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
2134 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2135 		runTest(codeFormatter, "test188", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
2136 	}
2137 
2138 	/**
2139 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44839
2140 	 */
test189()2141 	public void test189() {
2142 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
2143 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
2144 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2145 		runTest(codeFormatter, "test189", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
2146 	}
2147 
2148 	/**
2149 	 */
test190()2150 	public void test190() {
2151 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
2152 		options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");
2153 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2154 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2155 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2156 		runTest(codeFormatter, "test190", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
2157 	}
2158 
2159 	/**
2160 	 */
test191()2161 	public void test191() {
2162 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
2163 		preferences.number_of_empty_lines_to_preserve = 0;
2164 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2165 		runTest(codeFormatter, "test191", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
2166 	}
2167 
test192()2168 	public void test192() {
2169 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
2170 		options.put(
2171 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
2172 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
2173 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2174 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
2175 		preferences.number_of_empty_lines_to_preserve = 0;
2176 		preferences.align_type_members_on_columns = true;
2177 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2178 		runTest(codeFormatter, "test192", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
2179 	}
2180 
test193()2181 	public void test193() {
2182 		Hashtable options = new Hashtable();
2183 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2184 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
2185 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2186 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
2187 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2188 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2189 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2190 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
2191 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
2192 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2193 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2194 		runTest(codeFormatter, "test193", "A.java", CodeFormatter.K_STATEMENTS, true);//$NON-NLS-1$ //$NON-NLS-2$
2195 	}
2196 
test194()2197 	public void test194() {
2198 		Hashtable options = new Hashtable();
2199 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2200 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2201 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2202 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2203 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2204 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2205 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2206 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2207 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
2208 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2209 		setPageWidth80(preferences);
2210 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2211 		runTest(codeFormatter, "test194", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS, true);//$NON-NLS-1$ //$NON-NLS-2$
2212 	}
2213 
test195()2214 	public void test195() {
2215 		Hashtable options = new Hashtable();
2216 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2217 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
2218 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2219 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
2220 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2221 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2222 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2223 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
2224 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
2225 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2226 		setPageWidth80(preferences);
2227 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2228 		runTest(codeFormatter, "test195", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS, true);//$NON-NLS-1$ //$NON-NLS-2$
2229 	}
2230 
test196()2231 	public void test196() {
2232 		Hashtable options = new Hashtable();
2233 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2234 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2235 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2236 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2237 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2238 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2239 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2240 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2241 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
2242 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2243 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2244 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2245 		runTest(codeFormatter, "test196", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS, true);//$NON-NLS-1$ //$NON-NLS-2$
2246 	}
2247 
test197()2248 	public void test197() {
2249 		Hashtable options = new Hashtable();
2250 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2251 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
2252 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2253 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
2254 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2255 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2256 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2257 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
2258 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
2259 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2260 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2261 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2262 		runTest(codeFormatter, "test197", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS, true);//$NON-NLS-1$ //$NON-NLS-2$
2263 	}
2264 
test198()2265 	public void test198() {
2266 		Hashtable options = new Hashtable();
2267 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2268 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
2269 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2270 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
2271 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2272 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2273 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2274 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
2275 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
2276 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2277 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2278 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2279 		runTest(codeFormatter, "test198", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS, true);//$NON-NLS-1$ //$NON-NLS-2$
2280 	}
2281 
test199()2282 	public void test199() {
2283 		Hashtable options = new Hashtable();
2284 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2285 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2286 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2287 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2288 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2289 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2290 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2291 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2292 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
2293 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2294 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2295 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2296 		runTest(codeFormatter, "test199", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS, true);//$NON-NLS-1$ //$NON-NLS-2$
2297 	}
2298 
test201()2299 	public void test201() {
2300 		Hashtable options = new Hashtable();
2301 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2302 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
2303 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2304 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
2305 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2306 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2307 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2308 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
2309 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
2310 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2311 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2312 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2313 		runTest(codeFormatter, "test201", "A.java", CodeFormatter.K_STATEMENTS, true);//$NON-NLS-1$ //$NON-NLS-2$
2314 	}
2315 
test202()2316 	public void test202() {
2317 		Hashtable options = new Hashtable();
2318 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2319 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
2320 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2321 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
2322 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2323 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2324 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2325 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
2326 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
2327 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2328 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2329 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2330 		runTest(codeFormatter, "test202", "A.java", CodeFormatter.K_STATEMENTS, true);//$NON-NLS-1$ //$NON-NLS-2$
2331 	}
2332 
test203()2333 	public void test203() {
2334 		Hashtable options = new Hashtable();
2335 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2336 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2337 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2338 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2339 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2340 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2341 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2342 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2343 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
2344 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2345 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2346 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2347 		runTest(codeFormatter, "test203", "A.java", CodeFormatter.K_STATEMENTS, true);//$NON-NLS-1$ //$NON-NLS-2$
2348 	}
2349 
test204()2350 	public void test204() {
2351 		Hashtable options = new Hashtable();
2352 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2353 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2354 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2355 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2356 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2357 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2358 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2359 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2360 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
2361 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2362 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2363 		setPageWidth80(preferences);
2364 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2365 		runTest(codeFormatter, "test204", "A.java", CodeFormatter.K_STATEMENTS, true);//$NON-NLS-1$ //$NON-NLS-2$
2366 	}
2367 
test205()2368 	public void test205() {
2369 		Hashtable options = new Hashtable();
2370 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2371 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2372 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2373 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2374 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2375 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2376 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2377 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2378 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
2379 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2380 		options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");//$NON-NLS-1$
2381 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2382 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2383 		runTest(codeFormatter, "test205", "A.java", CodeFormatter.K_STATEMENTS, true);//$NON-NLS-1$ //$NON-NLS-2$
2384 	}
2385 
test206()2386 	public void test206() {
2387 		Hashtable options = new Hashtable();
2388 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2389 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2390 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2391 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2392 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2393 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2394 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2395 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2396 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
2397 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2398 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2399 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2400 		runTest(codeFormatter, "test206", "A.java", CodeFormatter.K_STATEMENTS, true);//$NON-NLS-1$ //$NON-NLS-2$
2401 	}
2402 
test207()2403 	public void test207() {
2404 		Hashtable options = new Hashtable();
2405 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2406 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
2407 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2408 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
2409 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2410 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2411 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2412 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
2413 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
2414 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2415 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2416 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2417 		runTest(codeFormatter, "test207", "A.java", CodeFormatter.K_STATEMENTS, true);//$NON-NLS-1$ //$NON-NLS-2$
2418 	}
2419 
test208()2420 	public void test208() {
2421 		Hashtable options = new Hashtable();
2422 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2423 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2424 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2425 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2426 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2427 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2428 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2429 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2430 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
2431 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2432 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2433 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2434 		runTest(codeFormatter, "test208", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS, true);//$NON-NLS-1$ //$NON-NLS-2$
2435 	}
2436 
test209()2437 	public void test209() {
2438 		Hashtable options = new Hashtable();
2439 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2440 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
2441 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2442 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
2443 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2444 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2445 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2446 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
2447 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
2448 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2449 		options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");//$NON-NLS-1$
2450 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2451 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2452 		runTest(codeFormatter, "test209", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS, true);//$NON-NLS-1$ //$NON-NLS-2$
2453 	}
2454 
test210()2455 	public void test210() {
2456 		Hashtable options = new Hashtable();
2457 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2458 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2459 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2460 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2461 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2462 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2463 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2464 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2465 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
2466 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2467 		options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");//$NON-NLS-1$
2468 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2469 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2470 		runTest(codeFormatter, "test210", "A.java", CodeFormatter.K_COMPILATION_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
2471 	}
2472 
test211()2473 	public void test211() {
2474 		Hashtable options = new Hashtable();
2475 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2476 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2477 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2478 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2479 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2480 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2481 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2482 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2483 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
2484 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2485 		options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");//$NON-NLS-1$
2486 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2487 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2488 		runTest(codeFormatter, "test211", "A.java", CodeFormatter.K_COMPILATION_UNIT, 1);//$NON-NLS-1$ //$NON-NLS-2$
2489 	}
2490 
test212()2491 	public void test212() {
2492 		Hashtable options = new Hashtable();
2493 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2494 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2495 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2496 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2497 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2498 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2499 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2500 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2501 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
2502 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2503 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2504 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2505 		runTest(codeFormatter, "test212", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
2506 	}
2507 
test213()2508 	public void test213() {
2509 		Hashtable options = new Hashtable();
2510 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2511 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
2512 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2513 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
2514 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2515 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2516 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2517 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
2518 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
2519 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2520 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2521 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2522 		runTest(codeFormatter, "test213", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
2523 	}
2524 
test214()2525 	public void test214() {
2526 		Hashtable options = new Hashtable();
2527 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2528 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
2529 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2530 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
2531 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2532 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2533 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2534 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
2535 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
2536 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2537 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2538 		setPageWidth80(preferences);
2539 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2540 		runTest(codeFormatter, "test214", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
2541 	}
2542 
test215()2543 	public void test215() {
2544 		Hashtable options = new Hashtable();
2545 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2546 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
2547 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2548 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
2549 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2550 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2551 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2552 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
2553 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
2554 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2555 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2556 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2557 		runTest(codeFormatter, "test215", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
2558 	}
2559 
test216()2560 	public void test216() {
2561 		Hashtable options = new Hashtable();
2562 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2563 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2564 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2565 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2566 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2567 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2568 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2569 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2570 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
2571 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2572 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2573 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2574 		runTest(codeFormatter, "test216", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
2575 	}
2576 
test217()2577 	public void test217() {
2578 		Hashtable options = new Hashtable();
2579 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2580 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2581 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2582 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2583 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2584 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2585 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2586 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2587 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
2588 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2589 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2590 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2591 		runTest(codeFormatter, "test217", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
2592 	}
2593 
test218()2594 	public void test218() {
2595 		Hashtable options = new Hashtable();
2596 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2597 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
2598 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2599 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
2600 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2601 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2602 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2603 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
2604 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
2605 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2606 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2607 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2608 		runTest(codeFormatter, "test218", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS, 1);//$NON-NLS-1$ //$NON-NLS-2$
2609 	}
2610 
test219()2611 	public void test219() {
2612 		Hashtable options = new Hashtable();
2613 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2614 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
2615 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2616 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
2617 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2618 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2619 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2620 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
2621 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
2622 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2623 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2624 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2625 		runTest(codeFormatter, "test219", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS, 1);//$NON-NLS-1$ //$NON-NLS-2$
2626 	}
2627 
test220()2628 	public void test220() {
2629 		Hashtable options = new Hashtable();
2630 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2631 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2632 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2633 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2634 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2635 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2636 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2637 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2638 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
2639 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2640 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2641 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2642 		runTest(codeFormatter, "test220", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS, 1);//$NON-NLS-1$ //$NON-NLS-2$
2643 	}
2644 
test221()2645 	public void test221() {
2646 		Hashtable options = new Hashtable();
2647 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2648 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2649 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2650 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2651 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2652 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2653 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2654 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2655 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
2656 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2657 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2658 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2659 		runTest(codeFormatter, "test221", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
2660 	}
2661 
test222()2662 	public void test222() {
2663 		Hashtable options = new Hashtable();
2664 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2665 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
2666 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2667 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
2668 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2669 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2670 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2671 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
2672 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
2673 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2674 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2675 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2676 		runTest(codeFormatter, "test222", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
2677 	}
test223()2678 	public void test223() {
2679 		Hashtable options = new Hashtable();
2680 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2681 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
2682 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2683 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
2684 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2685 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2686 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2687 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
2688 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
2689 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2690 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2691 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2692 		runTest(codeFormatter, "test223", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
2693 	}
2694 
test224()2695 	public void test224() {
2696 		Hashtable options = new Hashtable();
2697 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2698 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2699 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2700 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2701 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2702 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2703 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2704 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2705 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
2706 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2707 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2708 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2709 		runTest(codeFormatter, "test224", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
2710 	}
2711 
test225()2712 	public void test225() {
2713 		Hashtable options = new Hashtable();
2714 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2715 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
2716 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2717 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
2718 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2719 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2720 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2721 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
2722 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
2723 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2724 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2725 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2726 		runTest(codeFormatter, "test225", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
2727 	}
2728 
test226()2729 	public void test226() {
2730 		Hashtable options = new Hashtable();
2731 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2732 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2733 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2734 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2735 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2736 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2737 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2738 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2739 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
2740 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2741 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2742 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2743 		runTest(codeFormatter, "test226", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
2744 	}
2745 
test227()2746 	public void test227() {
2747 		Hashtable options = new Hashtable();
2748 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2749 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
2750 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2751 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
2752 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2753 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2754 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2755 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
2756 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
2757 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2758 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2759 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2760 		runTest(codeFormatter, "test227", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
2761 	}
2762 
test228()2763 	public void test228() {
2764 		Hashtable options = new Hashtable();
2765 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2766 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2767 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2768 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2769 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2770 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2771 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2772 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2773 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
2774 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2775 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2776 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2777 		runTest(codeFormatter, "test228", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
2778 	}
2779 
test229()2780 	public void test229() {
2781 		Hashtable options = new Hashtable();
2782 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2783 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
2784 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2785 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
2786 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2787 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2788 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2789 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
2790 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
2791 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2792 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2793 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2794 		runTest(codeFormatter, "test229", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
2795 	}
2796 
test230()2797 	public void test230() {
2798 		Hashtable options = new Hashtable();
2799 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2800 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2801 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2802 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2803 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2804 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2805 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2806 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2807 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
2808 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2809 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2810 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2811 		runTest(codeFormatter, "test230", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
2812 	}
2813 
test231()2814 	public void test231() {
2815 		Hashtable options = new Hashtable();
2816 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2817 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2818 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2819 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2820 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2821 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2822 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2823 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2824 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
2825 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2826 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2827 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2828 		runTest(codeFormatter, "test231", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
2829 	}
2830 
test232()2831 	public void test232() {
2832 		Hashtable options = new Hashtable();
2833 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2834 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
2835 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2836 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
2837 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2838 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2839 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2840 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
2841 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
2842 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2843 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2844 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2845 		runTest(codeFormatter, "test232", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
2846 	}
2847 
test233()2848 	public void test233() {
2849 		Hashtable options = new Hashtable();
2850 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2851 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
2852 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2853 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
2854 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2855 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2856 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2857 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
2858 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
2859 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2860 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2861 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2862 		runTest(codeFormatter, "test233", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS, 1);//$NON-NLS-1$ //$NON-NLS-2$
2863 	}
2864 
test234()2865 	public void test234() {
2866 		Hashtable options = new Hashtable();
2867 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2868 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
2869 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2870 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
2871 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2872 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2873 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2874 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
2875 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
2876 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2877 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2878 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2879 		runTest(codeFormatter, "test234", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
2880 	}
2881 
test235()2882 	public void test235() {
2883 		Hashtable options = new Hashtable();
2884 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2885 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2886 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2887 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2888 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2889 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2890 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2891 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2892 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
2893 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2894 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2895 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2896 		runTest(codeFormatter, "test235", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
2897 	}
2898 
test236()2899 	public void test236() {
2900 		Hashtable options = new Hashtable();
2901 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2902 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
2903 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2904 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
2905 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2906 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2907 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2908 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
2909 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
2910 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2911 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2912 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2913 		runTest(codeFormatter, "test236", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
2914 	}
2915 
test237()2916 	public void test237() {
2917 		Hashtable options = new Hashtable();
2918 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2919 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2920 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2921 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2922 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2923 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2924 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2925 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2926 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2927 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
2928 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2929 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2930 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2931 		runTest(codeFormatter, "test237", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
2932 	}
2933 
test238()2934 	public void test238() {
2935 		Hashtable options = new Hashtable();
2936 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2937 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
2938 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
2939 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
2940 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2941 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2942 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2943 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
2944 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
2945 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
2946 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2947 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2948 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2949 		runTest(codeFormatter, "test238", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
2950 	}
2951 
test239()2952 	public void test239() {
2953 		Hashtable options = new Hashtable();
2954 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2955 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2956 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2957 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2958 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2959 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2960 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2961 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2962 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2963 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
2964 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2965 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2966 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2967 		runTest(codeFormatter, "test239", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
2968 	}
2969 
test240()2970 	public void test240() {
2971 		Hashtable options = new Hashtable();
2972 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2973 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2974 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2975 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2976 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2977 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2978 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2979 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2980 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2981 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
2982 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
2983 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
2984 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
2985 		runTest(codeFormatter, "test240", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
2986 	}
2987 
test242()2988 	public void test242() {
2989 		Hashtable options = new Hashtable();
2990 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
2991 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
2992 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
2993 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
2994 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2995 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2996 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2997 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
2998 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
2999 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3000 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3001 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3002 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3003 		runTest(codeFormatter, "test242", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3004 	}
3005 
test244()3006 	public void test244() {
3007 		Hashtable options = new Hashtable();
3008 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3009 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3010 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3011 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3012 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3013 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3014 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3015 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3016 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3017 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3018 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3019 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3020 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3021 		runTest(codeFormatter, "test244", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3022 	}
3023 
test245()3024 	public void test245() {
3025 		Hashtable options = new Hashtable();
3026 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3027 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3028 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3029 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3030 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3031 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3032 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3033 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3034 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3035 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3036 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3037 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3038 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3039 		runTest(codeFormatter, "test245", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3040 	}
3041 
test246()3042 	public void test246() {
3043 		Hashtable options = new Hashtable();
3044 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3045 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3046 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3047 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3048 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3049 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3050 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3051 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3052 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3053 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3054 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3055 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3056 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3057 		runTest(codeFormatter, "test246", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3058 	}
3059 
test247()3060 	public void test247() {
3061 		Hashtable options = new Hashtable();
3062 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3063 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3064 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3065 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3066 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3067 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3068 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3069 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3070 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3071 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3072 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3073 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3074 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3075 		runTest(codeFormatter, "test247", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3076 	}
3077 
test248()3078 	public void test248() {
3079 		Hashtable options = new Hashtable();
3080 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3081 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3082 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3083 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3084 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3085 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3086 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3087 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3088 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3089 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3090 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3091 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3092 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3093 		runTest(codeFormatter, "test248", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3094 	}
3095 
test249()3096 	public void test249() {
3097 		Hashtable options = new Hashtable();
3098 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3099 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3100 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3101 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3102 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3103 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3104 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3105 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3106 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3107 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3108 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3109 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3110 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3111 		runTest(codeFormatter, "test249", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3112 	}
3113 
test250()3114 	public void test250() {
3115 		Hashtable options = new Hashtable();
3116 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3117 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3118 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3119 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3120 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3121 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3122 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3123 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3124 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3125 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3126 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3127 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3128 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3129 		runTest(codeFormatter, "test250", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3130 	}
3131 
test251()3132 	public void test251() {
3133 		Hashtable options = new Hashtable();
3134 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3135 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3136 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3137 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3138 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3139 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3140 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3141 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3142 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3143 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3144 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3145 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3146 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3147 		runTest(codeFormatter, "test251", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3148 	}
3149 
test252()3150 	public void test252() {
3151 		Hashtable options = new Hashtable();
3152 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3153 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
3154 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3155 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
3156 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3157 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3158 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3159 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3160 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
3161 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
3162 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3163 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3164 		setPageWidth80(preferences);
3165 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3166 		runTest(codeFormatter, "test252", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3167 	}
3168 
test253()3169 	public void test253() {
3170 		Hashtable options = new Hashtable();
3171 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3172 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3173 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3174 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3175 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3176 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3177 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3178 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3179 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3180 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3181 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3182 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3183 		setPageWidth80(preferences);
3184 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3185 		runTest(codeFormatter, "test253", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3186 	}
3187 
test254()3188 	public void test254() {
3189 		Hashtable options = new Hashtable();
3190 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3191 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
3192 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3193 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
3194 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3195 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3196 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3197 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3198 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
3199 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
3200 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3201 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3202 		setPageWidth80(preferences);
3203 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3204 		runTest(codeFormatter, "test254", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3205 	}
3206 
test255()3207 	public void test255() {
3208 		Hashtable options = new Hashtable();
3209 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3210 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3211 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3212 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3213 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3214 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3215 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3216 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3217 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3218 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3219 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3220 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3221 		setPageWidth80(preferences);
3222 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3223 		runTest(codeFormatter, "test255", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3224 	}
3225 
test256()3226 	public void test256() {
3227 		Hashtable options = new Hashtable();
3228 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3229 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
3230 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3231 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
3232 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3233 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3234 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3235 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3236 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
3237 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
3238 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3239 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3240 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3241 		runTest(codeFormatter, "test256", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
3242 	}
3243 
test257()3244 	public void test257() {
3245 		Hashtable options = new Hashtable();
3246 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3247 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3248 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3249 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3250 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3251 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3252 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3253 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3254 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3255 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3256 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3257 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3258 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3259 		runTest(codeFormatter, "test257", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
3260 	}
3261 
test258()3262 	public void test258() {
3263 		Hashtable options = new Hashtable();
3264 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3265 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
3266 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3267 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
3268 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3269 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3270 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3271 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3272 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
3273 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
3274 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3275 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3276 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3277 		runTest(codeFormatter, "test258", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
3278 	}
3279 
test259()3280 	public void test259() {
3281 		Hashtable options = new Hashtable();
3282 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3283 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3284 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3285 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3286 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3287 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3288 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3289 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3290 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3291 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3292 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3293 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3294 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3295 		runTest(codeFormatter, "test259", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
3296 	}
3297 
test260()3298 	public void test260() {
3299 		Hashtable options = new Hashtable();
3300 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3301 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
3302 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3303 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
3304 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3305 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3306 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3307 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3308 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
3309 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
3310 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3311 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3312 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3313 		runTest(codeFormatter, "test260", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
3314 	}
3315 
test261()3316 	public void test261() {
3317 		Hashtable options = new Hashtable();
3318 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3319 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3320 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3321 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3322 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3323 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3324 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3325 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3326 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3327 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3328 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3329 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3330 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3331 		runTest(codeFormatter, "test261", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
3332 	}
3333 
test262()3334 	public void test262() {
3335 		Hashtable options = new Hashtable();
3336 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3337 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
3338 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3339 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
3340 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3341 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3342 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3343 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3344 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
3345 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
3346 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3347 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3348 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3349 		runTest(codeFormatter, "test262", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
3350 	}
3351 
test263()3352 	public void test263() {
3353 		Hashtable options = new Hashtable();
3354 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3355 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3356 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3357 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3358 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3359 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3360 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3361 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3362 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3363 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3364 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3365 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3366 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3367 		runTest(codeFormatter, "test263", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
3368 	}
3369 
test264()3370 	public void test264() {
3371 		Hashtable options = new Hashtable();
3372 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3373 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
3374 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3375 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
3376 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3377 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3378 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3379 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3380 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
3381 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
3382 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3383 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3384 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3385 		runTest(codeFormatter, "test264", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
3386 	}
3387 
test265()3388 	public void test265() {
3389 		Hashtable options = new Hashtable();
3390 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3391 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3392 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3393 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3394 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3395 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3396 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3397 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3398 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3399 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3400 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3401 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3402 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3403 		runTest(codeFormatter, "test265", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
3404 	}
3405 
test266()3406 	public void test266() {
3407 		Hashtable options = new Hashtable();
3408 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3409 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
3410 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3411 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
3412 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3413 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3414 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3415 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3416 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
3417 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
3418 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3419 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3420 		setPageWidth80(preferences);
3421 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3422 		runTest(codeFormatter, "test266", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
3423 	}
3424 
test267()3425 	public void test267() {
3426 		Hashtable options = new Hashtable();
3427 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3428 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3429 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3430 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3431 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3432 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3433 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3434 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3435 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3436 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3437 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3438 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3439 		setPageWidth80(preferences);
3440 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3441 		runTest(codeFormatter, "test267", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
3442 	}
3443 
test268()3444 	public void test268() {
3445 		Hashtable options = new Hashtable();
3446 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3447 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
3448 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3449 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
3450 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3451 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3452 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3453 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3454 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
3455 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
3456 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3457 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3458 		setPageWidth80(preferences);
3459 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3460 		runTest(codeFormatter, "test268", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3461 	}
3462 
test269()3463 	public void test269() {
3464 		Hashtable options = new Hashtable();
3465 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3466 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3467 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3468 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3469 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3470 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3471 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3472 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3473 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3474 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3475 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3476 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3477 		setPageWidth80(preferences);
3478 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3479 		runTest(codeFormatter, "test269", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3480 	}
3481 
test270()3482 	public void test270() {
3483 		Hashtable options = new Hashtable();
3484 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3485 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
3486 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3487 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
3488 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3489 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3490 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3491 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3492 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
3493 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
3494 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3495 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3496 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3497 		runTest(codeFormatter, "test270", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
3498 	}
3499 
test271()3500 	public void test271() {
3501 		Hashtable options = new Hashtable();
3502 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3503 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3504 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3505 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3506 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3507 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3508 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3509 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3510 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3511 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3512 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3513 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3514 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3515 		runTest(codeFormatter, "test271", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
3516 	}
3517 
test272()3518 	public void test272() {
3519 		Hashtable options = new Hashtable();
3520 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3521 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
3522 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3523 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
3524 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3525 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3526 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3527 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3528 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
3529 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE, DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED);
3530 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
3531 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3532 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3533 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3534 		runTest(codeFormatter, "test272", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
3535 	}
3536 
test273()3537 	public void test273() {
3538 		Hashtable options = new Hashtable();
3539 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3540 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3541 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3542 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3543 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3544 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3545 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3546 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3547 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3548 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE, DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED);
3549 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3550 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3551 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3552 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3553 		runTest(codeFormatter, "test273", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
3554 	}
3555 
test274()3556 	public void test274() {
3557 		Hashtable options = new Hashtable();
3558 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3559 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
3560 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3561 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
3562 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3563 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3564 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3565 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3566 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
3567 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
3568 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3569 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3570 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3571 		runTest(codeFormatter, "test274", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3572 	}
3573 
test275()3574 	public void test275() {
3575 		Hashtable options = new Hashtable();
3576 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3577 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3578 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3579 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3580 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3581 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3582 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3583 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3584 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3585 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3586 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3587 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3588 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3589 		runTest(codeFormatter, "test275", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3590 	}
3591 
test276()3592 	public void test276() {
3593 		Hashtable options = new Hashtable();
3594 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3595 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3596 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3597 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3598 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3599 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3600 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3601 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3602 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3603 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3604 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3605 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3606 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3607 		runTest(codeFormatter, "test276", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
3608 	}
3609 
test277()3610 	public void test277() {
3611 		Hashtable options = new Hashtable();
3612 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3613 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
3614 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3615 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
3616 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3617 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3618 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3619 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3620 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
3621 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
3622 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3623 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3624 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3625 		runTest(codeFormatter, "test277", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
3626 	}
3627 
test278()3628 	public void test278() {
3629 		Hashtable options = new Hashtable();
3630 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3631 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
3632 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3633 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
3634 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3635 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3636 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3637 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3638 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
3639 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
3640 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3641 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3642 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3643 		runTest(codeFormatter, "test278", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3644 	}
3645 
test279()3646 	public void test279() {
3647 		Hashtable options = new Hashtable();
3648 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3649 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3650 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3651 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3652 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3653 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3654 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3655 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3656 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3657 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3658 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3659 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3660 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3661 		runTest(codeFormatter, "test279", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
3662 	}
3663 
test280()3664 	public void test280() {
3665 		Hashtable options = new Hashtable();
3666 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3667 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3668 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3669 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3670 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3671 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3672 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3673 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3674 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3675 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3676 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3677 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3678 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3679 		runTest(codeFormatter, "test280", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
3680 	}
3681 
test281()3682 	public void test281() {
3683 		Hashtable options = new Hashtable();
3684 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3685 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
3686 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3687 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
3688 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3689 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3690 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3691 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3692 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
3693 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
3694 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3695 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3696 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3697 		runTest(codeFormatter, "test281", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
3698 	}
3699 
test282()3700 	public void test282() {
3701 		Hashtable options = new Hashtable();
3702 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3703 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
3704 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3705 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
3706 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3707 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3708 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3709 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3710 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
3711 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
3712 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3713 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3714 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3715 		runTest(codeFormatter, "test282", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
3716 	}
3717 
test283()3718 	public void test283() {
3719 		Hashtable options = new Hashtable();
3720 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3721 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
3722 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3723 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
3724 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3725 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3726 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3727 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3728 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
3729 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
3730 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3731 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3732 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3733 		runTest(codeFormatter, "test283", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
3734 	}
3735 
test284()3736 	public void test284() {
3737 		Hashtable options = new Hashtable();
3738 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3739 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3740 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3741 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3742 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3743 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3744 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3745 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3746 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3747 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3748 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3749 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3750 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3751 		runTest(codeFormatter, "test284", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
3752 	}
3753 
test285()3754 	public void test285() {
3755 		Hashtable options = new Hashtable();
3756 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3757 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3758 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3759 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3760 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3761 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3762 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3763 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3764 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3765 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3766 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3767 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3768 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3769 		runTest(codeFormatter, "test285", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
3770 	}
3771 
test286()3772 	public void test286() {
3773 		Hashtable options = new Hashtable();
3774 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3775 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3776 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3777 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3778 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3779 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3780 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3781 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3782 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3783 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3784 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3785 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3786 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3787 		runTest(codeFormatter, "test286", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
3788 	}
3789 
test287()3790 	public void test287() {
3791 		Hashtable options = new Hashtable();
3792 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3793 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
3794 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3795 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
3796 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3797 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3798 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3799 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3800 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
3801 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
3802 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3803 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3804 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3805 		runTest(codeFormatter, "test287", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
3806 	}
3807 
test288()3808 	public void test288() {
3809 		Hashtable options = new Hashtable();
3810 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3811 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
3812 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3813 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
3814 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3815 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3816 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3817 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3818 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
3819 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
3820 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3821 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3822 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3823 		runTest(codeFormatter, "test288", "A.java", CodeFormatter.K_STATEMENTS, 1);//$NON-NLS-1$ //$NON-NLS-2$
3824 	}
3825 
test289()3826 	public void test289() {
3827 		Hashtable options = new Hashtable();
3828 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3829 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
3830 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3831 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
3832 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3833 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3834 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3835 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3836 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
3837 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
3838 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3839 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3840 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3841 		runTest(codeFormatter, "test289", "A.java", CodeFormatter.K_STATEMENTS, 1);//$NON-NLS-1$ //$NON-NLS-2$
3842 	}
3843 
test290()3844 	public void test290() {
3845 		Hashtable options = new Hashtable();
3846 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3847 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3848 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3849 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3850 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3851 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3852 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3853 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3854 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3855 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3856 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3857 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3858 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3859 		runTest(codeFormatter, "test290", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3860 	}
3861 
test291()3862 	public void test291() {
3863 		Hashtable options = new Hashtable();
3864 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3865 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
3866 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3867 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
3868 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3869 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3870 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3871 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3872 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
3873 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
3874 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3875 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3876 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3877 		runTest(codeFormatter, "test291", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3878 	}
3879 
test292()3880 	public void test292() {
3881 		Hashtable options = new Hashtable();
3882 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3883 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
3884 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3885 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
3886 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3887 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3888 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3889 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3890 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
3891 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
3892 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3893 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3894 		setPageWidth80(preferences);
3895 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3896 		runTest(codeFormatter, "test292", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3897 	}
3898 
test293()3899 	public void test293() {
3900 		Hashtable options = new Hashtable();
3901 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3902 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3903 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3904 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3905 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3906 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3907 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3908 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3909 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3910 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3911 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3912 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3913 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3914 		runTest(codeFormatter, "test293", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3915 	}
3916 
test294()3917 	public void test294() {
3918 		Hashtable options = new Hashtable();
3919 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3920 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3921 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3922 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3923 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3924 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3925 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3926 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3927 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3928 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3929 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3930 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3931 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3932 		runTest(codeFormatter, "test294", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3933 	}
3934 
test295()3935 	public void test295() {
3936 		Hashtable options = new Hashtable();
3937 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3938 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
3939 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3940 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
3941 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3942 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3943 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3944 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3945 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
3946 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
3947 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3948 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3949 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3950 		runTest(codeFormatter, "test295", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3951 	}
3952 
test296()3953 	public void test296() {
3954 		Hashtable options = new Hashtable();
3955 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3956 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3957 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3958 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3959 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3960 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3961 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3962 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3963 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3964 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3965 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
3966 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3967 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3968 		runTest(codeFormatter, "test296", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3969 	}
3970 
test297()3971 	public void test297() {
3972 		Hashtable options = new Hashtable();
3973 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
3974 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
3975 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
3976 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
3977 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3978 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3979 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3980 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
3981 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
3982 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
3983 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.SPACE);
3984 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
3985 		options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "100");
3986 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
3987 		preferences.number_of_empty_lines_to_preserve = 0;
3988 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
3989 		runTest(codeFormatter, "test297", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
3990 	}
3991 
test298()3992 	public void test298() {
3993 		Hashtable options = new Hashtable();
3994 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3995 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
3996 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
3997 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
3998 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
3999 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
4000 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
4001 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
4002 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
4003 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
4004 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
4005 		options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "80");
4006 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
4007 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4008 		runTest(codeFormatter, "test298", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4009 	}
4010 
test299()4011 	public void test299() {
4012 		Hashtable options = new Hashtable();
4013 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
4014 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
4015 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
4016 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
4017 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
4018 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
4019 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
4020 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
4021 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
4022 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
4023 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
4024 		options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "80");
4025 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
4026 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4027 		runTest(codeFormatter, "test299", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4028 	}
4029 
test300()4030 	public void test300() {
4031 		Hashtable options = new Hashtable();
4032 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
4033 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
4034 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
4035 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
4036 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
4037 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
4038 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
4039 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
4040 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
4041 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
4042 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
4043 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
4044 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4045 		runTest(codeFormatter, "test300", "A.java", CodeFormatter.K_EXPRESSION, 2);//$NON-NLS-1$ //$NON-NLS-2$
4046 	}
4047 
test301()4048 	public void test301() {
4049 		Hashtable options = new Hashtable();
4050 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
4051 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
4052 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
4053 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
4054 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
4055 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
4056 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
4057 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
4058 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
4059 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
4060 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
4061 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST, JavaCore.DO_NOT_INSERT);
4062 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
4063 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4064 		runTest(codeFormatter, "test301", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
4065 	}
4066 
test302()4067 	public void test302() {
4068 		Hashtable options = new Hashtable();
4069 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
4070 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
4071 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
4072 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
4073 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
4074 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
4075 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
4076 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
4077 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
4078 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
4079 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
4080 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
4081 		preferences.number_of_empty_lines_to_preserve = 0;
4082 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4083 		runTest(codeFormatter, "test302", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
4084 	}
4085 
test303()4086 	public void test303() {
4087 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4088 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4089 		preferences.number_of_empty_lines_to_preserve = 0;
4090 		preferences.indent_switchstatements_compare_to_cases = true;
4091 		preferences.indent_switchstatements_compare_to_switch = true;
4092 		preferences.indent_breaks_compare_to_cases = true;
4093 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4094 		runTest(codeFormatter, "test303", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
4095 	}
4096 
test304()4097 	public void test304() {
4098 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4099 		preferences.number_of_empty_lines_to_preserve = 0;
4100 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4101 		preferences.indent_switchstatements_compare_to_cases = true;
4102 		preferences.indent_switchstatements_compare_to_switch = true;
4103 		preferences.indent_breaks_compare_to_cases = false;
4104 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4105 		runTest(codeFormatter, "test304", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
4106 	}
4107 
test305()4108 	public void test305() {
4109 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4110 		preferences.number_of_empty_lines_to_preserve = 0;
4111 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4112 		preferences.indent_switchstatements_compare_to_cases = false;
4113 		preferences.indent_switchstatements_compare_to_switch = true;
4114 		preferences.indent_breaks_compare_to_cases = true;
4115 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4116 		runTest(codeFormatter, "test305", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
4117 	}
4118 
test306()4119 	public void test306() {
4120 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4121 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4122 		preferences.indent_switchstatements_compare_to_cases = true;
4123 		preferences.indent_switchstatements_compare_to_switch = true;
4124 		preferences.indent_breaks_compare_to_cases = true;
4125 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4126 		runTest(codeFormatter, "test306", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
4127 	}
4128 
test307()4129 	public void test307() {
4130 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4131 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4132 		preferences.indent_switchstatements_compare_to_cases = true;
4133 		preferences.indent_switchstatements_compare_to_switch = true;
4134 		preferences.indent_breaks_compare_to_cases = true;
4135 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4136 		runTest(codeFormatter, "test307", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
4137 	}
4138 
test308()4139 	public void test308() {
4140 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4141 		preferences.number_of_empty_lines_to_preserve = 0;
4142 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4143 		preferences.indent_switchstatements_compare_to_cases = false;
4144 		preferences.indent_switchstatements_compare_to_switch = false;
4145 		preferences.indent_breaks_compare_to_cases = false;
4146 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4147 		runTest(codeFormatter, "test308", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
4148 	}
4149 
test309()4150 	public void test309() {
4151 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4152 		preferences.number_of_empty_lines_to_preserve = 0;
4153 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4154 		preferences.indent_switchstatements_compare_to_cases = false;
4155 		preferences.indent_switchstatements_compare_to_switch = false;
4156 		preferences.indent_breaks_compare_to_cases = true;
4157 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4158 		runTest(codeFormatter, "test309", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
4159 	}
4160 
test310()4161 	public void test310() {
4162 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4163 		preferences.number_of_empty_lines_to_preserve = 0;
4164 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4165 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4166 		runTest(codeFormatter, "test310", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
4167 	}
4168 
test311()4169 	public void test311() {
4170 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4171 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4172 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4173 		runTest(codeFormatter, "test311", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
4174 	}
4175 
test312()4176 	public void test312() {
4177 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4178 		preferences.number_of_empty_lines_to_preserve = 0;
4179 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4180 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4181 		runTest(codeFormatter, "test312", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
4182 	}
4183 
test313()4184 	public void test313() {
4185 		Hashtable options = new Hashtable();
4186 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
4187 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
4188 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
4189 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
4190 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
4191 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
4192 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
4193 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
4194 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
4195 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
4196 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
4197 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
4198 		setPageWidth80(preferences);
4199 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4200 		runTest(codeFormatter, "test313", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4201 	}
4202 
test314()4203 	public void test314() {
4204 		Hashtable options = new Hashtable();
4205 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
4206 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.DO_NOT_INSERT);
4207 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.DO_NOT_INSERT);
4208 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.DO_NOT_INSERT);
4209 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
4210 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
4211 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
4212 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
4213 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
4214 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
4215 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
4216 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
4217 		setPageWidth80(preferences);
4218 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4219 		runTest(codeFormatter, "test314", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
4220 	}
4221 
test315()4222 	public void test315() {
4223 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4224 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4225 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4226 		String source = "public final void addDefinitelyAssignedVariables(Scope scope, int initStateIndex) {\n" +
4227 				"/*\n" +
4228 				"	\n" +
4229 				"*/\n" +
4230 				"}";
4231 		String expectedResult = "public final void addDefinitelyAssignedVariables(Scope scope,\r\n" +
4232 				"		int initStateIndex) {\r\n" +
4233 				"	/*\r\n" +
4234 				"		\r\n" +
4235 				"	*/\r\n" +
4236 				"}";
4237 		runTest(source, expectedResult, codeFormatter, CodeFormatter.K_CLASS_BODY_DECLARATIONS, 0, false, 0, -1);
4238 	}
4239 
test316()4240 	public void test316() {
4241 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4242 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4243 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4244 		String source = "public final void addDefinitelyAssignedVariables(Scope scope, int initStateIndex) {\r" +
4245 				"/*\r" +
4246 				"	\r" +
4247 				"*/\r" +
4248 				"}";
4249 		String expectedResult = "public final void addDefinitelyAssignedVariables(Scope scope,\r\n" +
4250 				"		int initStateIndex) {\r\n" +
4251 				"	/*\r\n" +
4252 				"		\r\n" +
4253 				"	*/\r\n" +
4254 				"}";
4255 		runTest(source, expectedResult, codeFormatter, CodeFormatter.K_CLASS_BODY_DECLARATIONS, 0, false, 0, -1);
4256 	}
4257 
test317()4258 	public void test317() {
4259 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4260 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4261 		preferences.line_separator = "\n";
4262 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4263 		String source = "public final void addDefinitelyAssignedVariables(Scope scope, int initStateIndex) {\r\n" +
4264 				"/*\r\n" +
4265 				"	\r\n" +
4266 				"*/\r\n" +
4267 				"}";
4268 		String expectedResult = "public final void addDefinitelyAssignedVariables(Scope scope,\n" +
4269 				"		int initStateIndex) {\n" +
4270 				"	/*\n" +
4271 				"		\n" +
4272 				"	*/\n" +
4273 				"}";
4274 		runTest(source, expectedResult, codeFormatter, CodeFormatter.K_CLASS_BODY_DECLARATIONS, 0, false, 0, -1);
4275 	}
4276 
test318()4277 	public void test318() {
4278 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4279 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4280 		preferences.line_separator = "\r";
4281 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4282 		String source = "public final void addDefinitelyAssignedVariables(Scope scope, int initStateIndex) {\r" +
4283 				"/*\r" +
4284 				"	\r" +
4285 				"*/\r" +
4286 				"}";
4287 		String expectedResult = "public final void addDefinitelyAssignedVariables(Scope scope,\r" +
4288 				"		int initStateIndex) {\r" +
4289 				"	/*\r" +
4290 				"		\r" +
4291 				"	*/\r" +
4292 				"}";
4293 		runTest(source, expectedResult, codeFormatter, CodeFormatter.K_CLASS_BODY_DECLARATIONS, 0, false, 0, -1);
4294 	}
4295 
test319()4296 	public void test319() {
4297 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4298 		preferences.number_of_empty_lines_to_preserve = 0;
4299 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4300 		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
4301 		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
4302 		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
4303 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4304 		runTest(codeFormatter, "test319", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4305 	}
4306 
test320()4307 	public void test320() {
4308 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4309 		preferences.number_of_empty_lines_to_preserve = 0;
4310 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4311 		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
4312 		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
4313 		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
4314 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4315 		runTest(codeFormatter, "test320", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4316 	}
4317 
test321()4318 	public void test321() {
4319 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4320 		preferences.number_of_empty_lines_to_preserve = 0;
4321 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4322 		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
4323 		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
4324 		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
4325 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4326 		runTest(codeFormatter, "test321", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4327 	}
4328 
test322()4329 	public void test322() {
4330 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4331 		preferences.number_of_empty_lines_to_preserve = 0;
4332 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4333 		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
4334 		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
4335 		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
4336 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4337 		runTest(codeFormatter, "test322", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4338 	}
4339 
test323()4340 	public void test323() {
4341 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4342 		preferences.number_of_empty_lines_to_preserve = 0;
4343 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4344 		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
4345 		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
4346 		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
4347 		preferences.keep_code_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
4348 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4349 		runTest(codeFormatter, "test323", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4350 	}
4351 
4352 	/**
4353 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=45141
4354 	 */
test324()4355 	public void test324() {
4356 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4357 		preferences.number_of_empty_lines_to_preserve = 0;
4358 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4359 		runTest(codeFormatter, "test324", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4360 	}
4361 
4362 	/**
4363 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=45220
4364 	 */
test325()4365 	public void test325() {
4366 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4367 		preferences.number_of_empty_lines_to_preserve = 0;
4368 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4369 		runTest(codeFormatter, "test325", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4370 	}
4371 
4372 	/**
4373 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=45465
4374 	 */
test326()4375 	public void test326() {
4376 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4377 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4378 		runTest(codeFormatter, "test326", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4379 	}
4380 
4381 	/**
4382 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=45508
4383 	 */
test327()4384 	public void test327() {
4385 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4386 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4387 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4388 		runTest(codeFormatter, "test327", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4389 	}
4390 
4391 	/**
4392 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22073
4393 	 */
test328()4394 	public void test328() {
4395 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4396 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4397 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4398 		runTest(codeFormatter, "test328", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4399 	}
4400 
4401 	/**
4402 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=29473
4403 	 */
test329()4404 	public void test329() {
4405 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4406 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4407 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4408 		runTest(codeFormatter, "test329", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4409 	}
4410 
4411 	/**
4412 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=27249
4413 	 */
test330()4414 	public void test330() {
4415 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4416 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4417 		preferences.keep_empty_array_initializer_on_one_line = true;
4418 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4419 		runTest(codeFormatter, "test330", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4420 	}
4421 
4422 	/**
4423 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=23709
4424 	 */
test331()4425 	public void test331() {
4426 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4427 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4428 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4429 		runTest(codeFormatter, "test331", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
4430 	}
4431 
4432 	/**
4433 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=23709
4434 	 */
test332()4435 	public void test332() {
4436 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4437 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4438 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4439 		runTest(codeFormatter, "test332", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
4440 	}
4441 
4442 	/**
4443 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=45968
4444 	 */
test333()4445 	public void test333() {
4446 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4447 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4448 		preferences.number_of_empty_lines_to_preserve = 5;
4449 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4450 		runTest(codeFormatter, "test333", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
4451 	}
4452 
4453 	/**
4454 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46058
4455 	 */
test334()4456 	public void test334() {
4457 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4458 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4459 		preferences.put_empty_statement_on_new_line = true;
4460 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4461 		runTest(codeFormatter, "test334", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4462 	}
4463 
4464 	/**
4465 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46033
4466 	 */
test335()4467 	public void test335() {
4468 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4469 		preferences.number_of_empty_lines_to_preserve = 0;
4470 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4471 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4472 		runTest(codeFormatter, "test335", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4473 	}
4474 
4475 	/**
4476 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46023
4477 	 */
test336()4478 	public void test336() {
4479 		Hashtable options = new Hashtable();
4480 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
4481 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
4482 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
4483 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
4484 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
4485 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
4486 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
4487 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
4488 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
4489 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
4490 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
4491 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
4492 		preferences.number_of_empty_lines_to_preserve = 0;
4493 		setPageWidth80(preferences);
4494 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4495 		runTest(codeFormatter, "test336", "A.java", CodeFormatter.K_STATEMENTS, 8);//$NON-NLS-1$ //$NON-NLS-2$
4496 	}
4497 
4498 	/**
4499 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46150
4500 	 */
test337()4501 	public void test337() {
4502 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4503 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4504 		preferences.number_of_empty_lines_to_preserve = 0;
4505 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4506 		runTest(codeFormatter, "test337", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4507 	}
test337b()4508 	public void test337b() {
4509 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4510 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4511 		preferences.number_of_empty_lines_to_preserve = 0;
4512 		preferences.wrap_outer_expressions_when_nested = false;
4513 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4514 		runTest(codeFormatter, "test337b", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4515 	}
4516 
4517 	/**
4518 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46686
4519 	 */
test338()4520 	public void test338() {
4521 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4522 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4523 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4524 		runTest(codeFormatter, "test338", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4525 	}
4526 
4527 	/**
4528 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46686
4529 	 */
test339()4530 	public void test339() {
4531 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4532 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4533 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4534 		runTest(codeFormatter, "test339", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4535 	}
4536 
4537 	/**
4538 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46686
4539 	 */
test340()4540 	public void test340() {
4541 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4542 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4543 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4544 		runTest(codeFormatter, "test340", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4545 	}
4546 
4547 	/**
4548 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46689
4549 	 */
test341()4550 	public void test341() {
4551 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4552 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4553 		preferences.insert_space_before_unary_operator = false;
4554 		preferences.insert_space_after_assignment_operator = false;
4555 		preferences.insert_space_after_additive_operator = false;
4556 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4557 		runTest(codeFormatter, "test341", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4558 	}
4559 
4560 	/**
4561 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46690
4562 	 */
test342()4563 	public void test342() {
4564 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4565 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4566 		preferences.insert_space_after_comma_in_multiple_local_declarations = false;
4567 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4568 		runTest(codeFormatter, "test342", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4569 	}
4570 
4571 	/**
4572 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46690
4573 	 */
test343()4574 	public void test343() {
4575 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4576 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4577 		preferences.insert_space_after_comma_in_multiple_field_declarations = false;
4578 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4579 		runTest(codeFormatter, "test343", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4580 	}
4581 
4582 	/**
4583 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46690
4584 	 */
test344()4585 	public void test344() {
4586 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4587 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4588 		preferences.insert_space_after_comma_in_multiple_field_declarations = true;
4589 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4590 		runTest(codeFormatter, "test344", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4591 	}
4592 
4593 	/**
4594 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46690
4595 	 */
test345()4596 	public void test345() {
4597 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4598 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4599 		preferences.insert_space_after_comma_in_multiple_local_declarations = true;
4600 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4601 		runTest(codeFormatter, "test345", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4602 	}
4603 
4604 	/**
4605 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44493
4606 	 */
test347()4607 	public void test347() {
4608 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
4609 		options.put(
4610 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION,
4611 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
4612 		assertEquals(DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.getWrappingStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION)));
4613 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
4614 		preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
4615 		preferences.blank_lines_before_method = 1;
4616 		preferences.blank_lines_before_first_class_body_declaration = 1;
4617 		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
4618 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4619 		runTest(codeFormatter, "test347", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4620 	}
4621 
4622 	/**
4623 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44493
4624 	 */
test348()4625 	public void test348() {
4626 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
4627 		options.put(
4628 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION,
4629 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
4630 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4631 		preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
4632 		preferences.blank_lines_before_method = 1;
4633 		preferences.blank_lines_before_first_class_body_declaration = 1;
4634 		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
4635 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4636 		runTest(codeFormatter, "test348", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4637 	}
4638 
4639 	/**
4640 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44493
4641 	 */
test349()4642 	public void test349() {
4643 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getJavaConventionsSettings());
4644         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
4645         preferences.tab_size = 4;
4646         preferences.blank_lines_before_first_class_body_declaration = 1;
4647 		setPageWidth80(preferences);
4648 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4649 		runTest(codeFormatter, "test349", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4650 	}
4651 
4652 	/**
4653 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44653
4654 	 */
test350()4655 	public void test350() {
4656 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4657 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4658 		runTest(codeFormatter, "test350", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
4659 	}
4660 
4661 	/**
4662 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44765
4663 	 */
test351()4664 	public void test351() {
4665 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4666 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4667 		runTest(codeFormatter, "test351", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
4668 	}
4669 
4670 	/**
4671 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44653
4672 	 */
test352()4673 	public void test352() {
4674 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getJavaConventionsSettings());
4675         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
4676         preferences.tab_size = 4;
4677 		setPageWidth80(preferences);
4678 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4679 		runTest(codeFormatter, "test352", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
4680 	}
4681 
4682 	/**
4683 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44642
4684 	 */
test353()4685 	public void test353() {
4686 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4687 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4688 		runTest(codeFormatter, "test353", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
4689 	}
4690 
4691 	/**
4692 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47799
4693 	 */
test354()4694 	public void test354() {
4695 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
4696 		options.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, DefaultCodeFormatterConstants.FALSE);
4697 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
4698 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4699 		runTest(codeFormatter, "test354", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4700 	}
4701 
4702 	/**
4703 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47799
4704 	 */
test355()4705 	public void test355() {
4706 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
4707 		options.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, DefaultCodeFormatterConstants.TRUE);
4708 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
4709 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4710 		runTest(codeFormatter, "test355", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4711 	}
4712 
4713 	/**
4714 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47800
4715 	 */
test356()4716 	public void test356() {
4717 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
4718 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
4719 		options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_MULTIPLICATIVE_OPERATOR, DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
4720 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
4721 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4722 		runTest(codeFormatter, "test356", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4723 	}
4724 
4725 	/**
4726 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47801
4727 	 */
test357()4728 	public void test357() {
4729 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
4730 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
4731 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_PREFIX_OPERATOR, JavaCore.INSERT);
4732 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
4733 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4734 		runTest(codeFormatter, "test357", "A.java", CodeFormatter.K_EXPRESSION);//$NON-NLS-1$ //$NON-NLS-2$
4735 	}
4736 
4737 	/**
4738 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47801
4739 	 */
test358()4740 	public void test358() {
4741 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
4742 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
4743 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_PREFIX_OPERATOR, JavaCore.DO_NOT_INSERT);
4744 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
4745 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4746 		runTest(codeFormatter, "test358", "A.java", CodeFormatter.K_EXPRESSION);//$NON-NLS-1$ //$NON-NLS-2$
4747 	}
4748 
4749 	/**
4750 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47811
4751 	 */
test359()4752 	public void test359() {
4753 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
4754 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
4755 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
4756 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4757 		runTest(codeFormatter, "test359", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4758 	}
4759 
4760 	/**
4761 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47811
4762 	 */
test360()4763 	public void test360() {
4764 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
4765 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
4766 		options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "2");
4767 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
4768 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4769 		runTest(codeFormatter, "test360", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4770 	}
4771 
4772 	/**
4773 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47811
4774 	 */
test361()4775 	public void test361() {
4776 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
4777 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
4778 		options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");
4779 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
4780 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4781 		runTest(codeFormatter, "test361", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
4782 	}
4783 
4784 	/**
4785 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47802
4786 	 */
test362()4787 	public void test362() {
4788 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
4789 		options.put(
4790 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
4791 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
4792 		options.put(
4793 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION,
4794 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
4795 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
4796 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4797 		preferences.page_width = 57;
4798 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4799 		runTest(codeFormatter, "test362", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4800 	}
4801 
4802 	/**
4803 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47800
4804 	 */
test363()4805 	public void test363() {
4806 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4807 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4808 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4809 		runTest(codeFormatter, "test363", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4810 	}
4811 
4812 	/**
4813 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47986
4814 	 */
test364()4815 	public void test364() {
4816 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4817 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4818 		preferences.insert_space_after_comma_in_for_inits = false;
4819 		preferences.insert_space_after_comma_in_for_increments = true;
4820 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4821 		runTest(codeFormatter, "test364", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4822 	}
4823 
4824 	/**
4825 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47986
4826 	 */
test365()4827 	public void test365() {
4828 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4829 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4830 		preferences.insert_space_after_comma_in_for_inits = false;
4831 		preferences.insert_space_after_comma_in_for_increments = true;
4832 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4833 		runTest(codeFormatter, "test365", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4834 	}
4835 
4836 	/**
4837 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47986
4838 	 */
test366()4839 	public void test366() {
4840 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4841 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4842 		preferences.insert_space_after_comma_in_for_inits = true;
4843 		preferences.insert_space_before_comma_in_for_inits = true;
4844 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4845 		runTest(codeFormatter, "test366", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4846 	}
4847 
4848 	/**
4849 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47986
4850 	 */
test367()4851 	public void test367() {
4852 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
4853 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
4854 		preferences.insert_space_after_comma_in_for_inits = true;
4855 		preferences.insert_space_before_comma_in_for_inits = true;
4856 		preferences.insert_space_after_comma_in_multiple_local_declarations = false;
4857 		preferences.insert_space_before_comma_in_multiple_local_declarations = false;
4858 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
4859 		runTest(codeFormatter, "test367", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4860 	}
4861 
4862 	/**
4863 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47918
4864 	 */
test368()4865 	public void test368() {
4866 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
4867 		options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");
4868 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_METHOD, "0");
4869 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
4870 		runTest(codeFormatter, "test368", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4871 	}
4872 
4873 	/**
4874 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47918
4875 	 */
test369()4876 	public void test369() {
4877 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
4878 		options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "0");
4879 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_METHOD, "1");
4880 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION, "1");
4881 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
4882 		runTest(codeFormatter, "test369", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4883 	}
4884 
4885 	/**
4886 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47918
4887 	 */
test370()4888 	public void test370() {
4889 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
4890 		options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");
4891 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_METHOD, "1");
4892 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION, "1");
4893 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
4894 		runTest(codeFormatter, "test370", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4895 	}
4896 
4897 	/**
4898 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47918
4899 	 */
test371()4900 	public void test371() {
4901 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
4902 		options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");
4903 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_METHOD, "0");
4904 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
4905 		runTest(codeFormatter, "test371", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4906 	}
4907 
4908 	/**
4909 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47918
4910 	 */
test372()4911 	public void test372() {
4912 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
4913 		options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");
4914 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_METHOD, "0");
4915 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
4916 		runTest(codeFormatter, "test372", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4917 	}
4918 
4919 	/**
4920 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47918
4921 	 */
test373()4922 	public void test373() {
4923 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
4924 		options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "0");
4925 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_METHOD, "1");
4926 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION, "1");
4927 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
4928 		runTest(codeFormatter, "test373", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4929 	}
4930 
4931 	/**
4932 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44813
4933 	 */
test374()4934 	public void test374() {
4935 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
4936 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
4937 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER, DefaultCodeFormatterConstants.NEXT_LINE);
4938 		options.put(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER, "1");
4939 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
4940 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
4941 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
4942 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
4943 		runTest(codeFormatter, "test374", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4944 	}
4945 
4946 	/**
4947 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44813
4948 	 */
test375()4949 	public void test375() {
4950 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
4951 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
4952 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER, DefaultCodeFormatterConstants.END_OF_LINE);
4953 		options.put(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER, "1");
4954 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
4955 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
4956 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
4957 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
4958 		runTest(codeFormatter, "test375", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4959 	}
4960 
4961 	/**
4962 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44813
4963 	 */
test376()4964 	public void test376() {
4965 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
4966 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
4967 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER, DefaultCodeFormatterConstants.END_OF_LINE);
4968 		options.put(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER, "1");
4969 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
4970 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.DO_NOT_INSERT);
4971 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.DO_NOT_INSERT);
4972 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
4973 		runTest(codeFormatter, "test376", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4974 	}
4975 
4976 	/**
4977 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44813
4978 	 */
test377()4979 	public void test377() {
4980 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
4981 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
4982 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER, DefaultCodeFormatterConstants.END_OF_LINE);
4983 		options.put(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER, "1");
4984 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
4985 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
4986 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.DO_NOT_INSERT);
4987 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
4988 		runTest(codeFormatter, "test377", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
4989 	}
4990 
4991 	/**
4992 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44813
4993 	 */
test378()4994 	public void test378() {
4995 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
4996 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
4997 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER, DefaultCodeFormatterConstants.END_OF_LINE);
4998 		options.put(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER, "1");
4999 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
5000 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
5001 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
5002 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
5003 		runTest(codeFormatter, "test378", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
5004 	}
5005 
5006 	/**
5007 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47997
5008 	 */
test379()5009 	public void test379() {
5010 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5011 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
5012 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER, DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED);
5013 		options.put(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER, "1");
5014 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
5015 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
5016 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
5017 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
5018 		runTest(codeFormatter, "test379", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
5019 	}
5020 
5021 	/**
5022 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47997
5023 	 */
test380()5024 	public void test380() {
5025 		Hashtable options = new Hashtable();
5026 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
5027 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
5028 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
5029 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
5030 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
5031 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
5032 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
5033 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
5034 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
5035 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
5036 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION, "1");
5037 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.SPACE);
5038 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
5039 		options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "100");
5040 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5041 		preferences.number_of_empty_lines_to_preserve = 0;
5042 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5043 		runTest(codeFormatter, "test380", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
5044 	}
5045 
5046 	/**
5047 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47997
5048 	 */
test381()5049 	public void test381() {
5050 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5051 		options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "0");
5052 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_METHOD, "1");
5053 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION, "0");
5054 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
5055 		runTest(codeFormatter, "test381", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
5056 	}
5057 
5058 	/**
5059 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48131
5060 	 */
test382()5061 	public void test382() {
5062 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5063 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
5064 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(new DefaultCodeFormatterOptions(options));
5065 		runTest(codeFormatter, "test382", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5066 	}
5067 
5068 	/**
5069 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48141
5070 	 */
test383()5071 	public void test383() {
5072 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
5073 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5074         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
5075         preferences.tab_size = 4;
5076 		preferences.blank_lines_before_first_class_body_declaration = 0;
5077 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5078 		runTest(codeFormatter, "test383", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5079 	}
5080 
5081 	/**
5082 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48143
5083 	 */
_test384()5084 	public void _test384() {
5085 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
5086 		options.put(
5087 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION,
5088 				DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
5089 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5090         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
5091         preferences.tab_size = 4;
5092 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5093 		runTest(codeFormatter, "test384", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5094 	}
5095 
5096 	/**
5097 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48143
5098 	 */
test385()5099 	public void test385() {
5100 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
5101 		options.put(
5102 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION,
5103 				DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_NEXT_SHIFTED, DefaultCodeFormatterConstants.INDENT_DEFAULT));
5104 		assertEquals(DefaultCodeFormatterConstants.WRAP_NEXT_SHIFTED, DefaultCodeFormatterConstants.getWrappingStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION)));
5105 		assertTrue(DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE != DefaultCodeFormatterConstants.getWrappingStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION)));
5106 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5107 		preferences.blank_lines_before_first_class_body_declaration = 0;
5108         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
5109         preferences.tab_size = 4;
5110 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5111 		runTest(codeFormatter, "test385", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5112 	}
5113 
5114 	/**
5115 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48143
5116 	 */
test386()5117 	public void test386() {
5118 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
5119 		options.put(
5120 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION,
5121 				DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
5122 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5123 		preferences.blank_lines_before_first_class_body_declaration = 0;
5124         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
5125         preferences.tab_size = 4;
5126 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5127 		runTest(codeFormatter, "test386", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5128 	}
5129 
5130 	/**
5131 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48143
5132 	 */
_test387()5133 	public void _test387() {
5134 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
5135 		options.put(
5136 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION,
5137 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
5138 //		options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "40");
5139 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5140 		preferences.page_width = 40;
5141         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
5142         preferences.tab_size = 4;
5143 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5144 		runTest(codeFormatter, "test387", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5145 	}
5146 
5147 	/**
5148 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48167
5149 	 */
test388()5150 	public void test388() {
5151 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
5152 		options.put(
5153 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
5154 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
5155 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5156 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
5157         preferences.tab_size = 4;
5158 		preferences.brace_position_for_array_initializer = DefaultCodeFormatterConstants.NEXT_LINE;
5159 		preferences.page_width = 40;
5160 		preferences.insert_new_line_after_opening_brace_in_array_initializer = true;
5161 		preferences.insert_new_line_before_closing_brace_in_array_initializer = true;
5162 		preferences.blank_lines_before_first_class_body_declaration = 0;
5163 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5164 		runTest(codeFormatter, "test388", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5165 	}
5166 
5167 	/**
5168 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48167
5169 	 */
test389()5170 	public void test389() {
5171 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
5172 		options.put(
5173 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
5174 				DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
5175 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5176 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
5177 		preferences.continuation_indentation_for_array_initializer = 1;
5178 		preferences.brace_position_for_array_initializer = DefaultCodeFormatterConstants.NEXT_LINE;
5179 		preferences.page_width = 40;
5180 		preferences.insert_new_line_after_opening_brace_in_array_initializer = true;
5181 		preferences.insert_new_line_before_closing_brace_in_array_initializer = true;
5182 		preferences.blank_lines_before_first_class_body_declaration = 0;
5183         preferences.tab_size = 4;
5184 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5185 		runTest(codeFormatter, "test389", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5186 	}
5187 
5188 	/**
5189 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48167
5190 	 */
test390()5191 	public void test390() {
5192 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
5193 		options.put(
5194 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
5195 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT_FIRST_BREAK, DefaultCodeFormatterConstants.INDENT_DEFAULT));
5196 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5197 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
5198 		preferences.continuation_indentation_for_array_initializer = 1;
5199 		preferences.brace_position_for_array_initializer = DefaultCodeFormatterConstants.NEXT_LINE;
5200 		preferences.page_width = 40;
5201 		preferences.insert_new_line_after_opening_brace_in_array_initializer = true;
5202 		preferences.insert_new_line_before_closing_brace_in_array_initializer = true;
5203 		preferences.blank_lines_before_first_class_body_declaration = 0;
5204         preferences.tab_size = 4;
5205 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5206 		runTest(codeFormatter, "test390", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5207 	}
5208 
5209 	/**
5210 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48167
5211 	 */
test391()5212 	public void test391() {
5213 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
5214 		options.put(
5215 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
5216 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_BY_ONE));
5217 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5218 		preferences.blank_lines_before_first_class_body_declaration = 0;
5219 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
5220 		preferences.continuation_indentation_for_array_initializer = 3;
5221 		preferences.brace_position_for_array_initializer = DefaultCodeFormatterConstants.NEXT_LINE;
5222 		preferences.page_width = 40;
5223 		preferences.insert_new_line_after_opening_brace_in_array_initializer = true;
5224 		preferences.insert_new_line_before_closing_brace_in_array_initializer = true;
5225         preferences.tab_size = 4;
5226 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5227 		runTest(codeFormatter, "test391", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5228 	}
5229 
5230 	/**
5231 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48167
5232 	 */
test392()5233 	public void test392() {
5234 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
5235 		options.put(
5236 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
5237 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_BY_ONE));
5238 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5239 		preferences.blank_lines_before_first_class_body_declaration = 0;
5240 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
5241 		preferences.continuation_indentation_for_array_initializer = 3;
5242 		preferences.brace_position_for_array_initializer = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
5243 		preferences.page_width = 40;
5244 		preferences.insert_new_line_after_opening_brace_in_array_initializer = true;
5245 		preferences.insert_new_line_before_closing_brace_in_array_initializer = true;
5246         preferences.tab_size = 4;
5247 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5248 		runTest(codeFormatter, "test392", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5249 	}
5250 
5251 	/**
5252 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48167
5253 	 */
test393()5254 	public void test393() {
5255 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
5256 		options.put(
5257 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
5258 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
5259 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5260         preferences.tab_size = 4;
5261 		preferences.blank_lines_before_first_class_body_declaration = 0;
5262 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
5263 		preferences.continuation_indentation_for_array_initializer = 1;
5264 		preferences.brace_position_for_array_initializer = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
5265 		preferences.page_width = 40;
5266 		preferences.insert_new_line_after_opening_brace_in_array_initializer = true;
5267 		preferences.insert_new_line_before_closing_brace_in_array_initializer = true;
5268 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5269 		runTest(codeFormatter, "test393", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5270 	}
5271 
5272 	/**
5273 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=48404
5274 	 */
test394()5275 	public void test394() {
5276 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5277 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5278 		preferences.number_of_empty_lines_to_preserve = 0;
5279 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5280 		runTest(codeFormatter, "test394", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5281 	}
5282 
5283 	/**
5284 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49318
5285 	 */
test395()5286 	public void test395() {
5287 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5288 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5289 		preferences.insert_space_before_opening_paren_in_method_declaration = true;
5290 		preferences.number_of_empty_lines_to_preserve = 0;
5291 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5292 		runTest(codeFormatter, "test395", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5293 	}
5294 
5295 	/**
5296 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49243
5297 	 */
test396()5298 	public void test396() {
5299 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5300 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5301 		preferences.insert_space_before_semicolon_in_for = true;
5302 		preferences.number_of_empty_lines_to_preserve = 0;
5303 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5304 		runTest(codeFormatter, "test396", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5305 	}
5306 
5307 	/**
5308 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49187
5309 	 */
test397()5310 	public void test397() {
5311 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5312 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5313 		preferences.blank_lines_before_package = 2;
5314 		preferences.blank_lines_after_package = 0;
5315 		preferences.number_of_empty_lines_to_preserve = 0;
5316 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5317 		runTest(codeFormatter, "test397", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5318 	}
5319 
5320 	/**
5321 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49187
5322 	 */
test398()5323 	public void test398() {
5324 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5325 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5326 		preferences.number_of_empty_lines_to_preserve = 0;
5327 		preferences.blank_lines_before_package = 0;
5328 		preferences.blank_lines_after_package = 0;
5329 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5330 		runTest(codeFormatter, "test398", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5331 	}
5332 
5333 	/**
5334 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49187
5335 	 */
test399()5336 	public void test399() {
5337 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5338 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5339 		preferences.blank_lines_before_package = 1;
5340 		preferences.blank_lines_after_package = 1;
5341 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5342 		runTest(codeFormatter, "test399", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5343 	}
5344 
5345 	/**
5346 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49187
5347 	 */
test400()5348 	public void test400() {
5349 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5350 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_PACKAGE, "2");
5351 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_PACKAGE, "2");
5352 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5353 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5354 		runTest(codeFormatter, "test400", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5355 	}
5356 
5357 	/**
5358 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49361
5359 	 */
test401()5360 	public void test401() {
5361 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5362 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
5363 		options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, DefaultCodeFormatterConstants.TRUE);
5364 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5365 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5366 		runTest(codeFormatter, "test401", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5367 	}
5368 
5369 	/**
5370 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49361
5371 	 */
test402()5372 	public void test402() {
5373 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5374 		options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, DefaultCodeFormatterConstants.TRUE);
5375 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER, JavaCore.DO_NOT_INSERT);
5376 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5377 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5378 		runTest(codeFormatter, "test402", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5379 	}
5380 
5381 	/**
5382 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49298
5383 	 */
test403()5384 	public void test403() {
5385 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5386 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION, JavaCore.INSERT);
5387 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION, JavaCore.INSERT);
5388 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5389 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5390 		runTest(codeFormatter, "test403", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5391 	}
5392 
5393 	/**
5394 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49298
5395 	 */
test404()5396 	public void test404() {
5397 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5398 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION, JavaCore.INSERT);
5399 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION, JavaCore.INSERT);
5400  		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION, JavaCore.INSERT);
5401 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION, JavaCore.DO_NOT_INSERT);
5402 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5403 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5404 		runTest(codeFormatter, "test404", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5405 	}
5406 
5407 	/**
5408 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49187
5409 	 */
test405()5410 	public void test405() {
5411 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
5412 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_PACKAGE, "10");
5413 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5414         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
5415         preferences.tab_size = 4;
5416 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5417 		runTest(codeFormatter, "test405", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5418 	}
5419 
5420 	/**
5421 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49298
5422 	 */
test406()5423 	public void test406() {
5424 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5425 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION, JavaCore.INSERT);
5426 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION, JavaCore.INSERT);
5427 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION, JavaCore.DO_NOT_INSERT);
5428 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION, JavaCore.INSERT);
5429 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5430 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5431 		runTest(codeFormatter, "test406", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5432 	}
5433 
5434 	/**
5435 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49481
5436 	 */
test407()5437 	public void test407() {
5438 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
5439 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5440         preferences.tab_size = 4;
5441         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
5442 		preferences.blank_lines_before_first_class_body_declaration = 0;
5443 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5444 		runTest(codeFormatter, "test407", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
5445 	}
5446 
5447 	/**
5448 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49481
5449 	 */
test408()5450 	public void test408() {
5451 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
5452 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5453         preferences.tab_size = 4;
5454         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
5455 		preferences.blank_lines_before_first_class_body_declaration = 0;
5456 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5457 		runTest(codeFormatter, "test408", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
5458 	}
5459 
5460 	/**
5461 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49378
5462 	 */
test409()5463 	public void test409() {
5464 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5465 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE, DefaultCodeFormatterConstants.NEXT_LINE);
5466 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5467 		preferences.indent_switchstatements_compare_to_cases = false;
5468 		preferences.indent_switchstatements_compare_to_switch = true;
5469 		preferences.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE;
5470 		preferences.brace_position_for_switch = DefaultCodeFormatterConstants.NEXT_LINE;
5471 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5472 		runTest(codeFormatter, "test409", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
5473 	}
5474 
5475 	/**
5476 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49577
5477 	 */
test410()5478 	public void test410() {
5479 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5480 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5481 		preferences.blank_lines_between_type_declarations = 1;
5482 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5483 		runTest(codeFormatter, "test410", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5484 	}
5485 
5486 	/**
5487 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49577
5488 	 */
test411()5489 	public void test411() {
5490 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5491 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5492 		preferences.blank_lines_between_type_declarations = 2;
5493 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5494 		runTest(codeFormatter, "test411", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5495 	}
5496 
5497 	/**
5498 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49551
5499 	 */
test412()5500 	public void test412() {
5501 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5502 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5503 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5504 		runTest(codeFormatter, "test412", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5505 	}
5506 
5507 	/**
5508 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49551
5509 	 */
test413()5510 	public void test413() {
5511 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5512 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5513 		preferences.blank_lines_between_type_declarations = 1;
5514 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5515 		runTest(codeFormatter, "test413", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5516 	}
5517 
5518 	/**
5519 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49551
5520 	 */
test414()5521 	public void test414() {
5522 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5523 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5524 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5525 		runTest(codeFormatter, "test414", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5526 	}
5527 
5528 	/**
5529 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49551
5530 	 */
test415()5531 	public void test415() {
5532 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5533 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5534 		preferences.blank_lines_between_type_declarations = 1;
5535 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5536 		runTest(codeFormatter, "test415", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5537 	}
5538 
5539 	/**
5540 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49551
5541 	 */
test416()5542 	public void test416() {
5543 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5544 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5545 		preferences.blank_lines_between_type_declarations = 1;
5546 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5547 		runTest(codeFormatter, "test416", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5548 	}
5549 
5550 	/**
5551 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49571
5552 	 */
test417()5553 	public void test417() {
5554 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
5555 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
5556 		preferences.insert_space_before_opening_paren_in_constructor_declaration = true;
5557 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5558 		runTest(codeFormatter, "test417", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
5559 	}
5560 
5561 	/**
5562 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49571
5563 	 */
test418()5564 	public void test418() {
5565 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
5566 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
5567 		preferences.insert_space_before_opening_paren_in_constructor_declaration = true;
5568 		preferences.insert_space_before_opening_paren_in_method_declaration = true;
5569 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5570 		runTest(codeFormatter, "test418", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
5571 	}
5572 
5573 	/**
5574 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49298
5575 	 */
test421()5576 	public void test421() {
5577 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5578 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION, JavaCore.INSERT);
5579 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION, JavaCore.INSERT);
5580 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION, JavaCore.DO_NOT_INSERT);
5581 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION, JavaCore.DO_NOT_INSERT);
5582 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5583 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5584 		runTest(codeFormatter, "test421", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5585 	}
5586 
5587 	/**
5588 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49298
5589 	 */
test422()5590 	public void test422() {
5591 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
5592 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION, JavaCore.INSERT);
5593 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION, JavaCore.INSERT);
5594 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION, JavaCore.DO_NOT_INSERT);
5595 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION, JavaCore.DO_NOT_INSERT);
5596 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5597         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
5598 		preferences.blank_lines_before_first_class_body_declaration = 1;
5599         preferences.tab_size = 4;
5600 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5601 		runTest(codeFormatter, "test422", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5602 	}
5603 
5604 	/**
5605 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49351
5606 	 */
test423()5607 	public void test423() {
5608 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5609 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
5610 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5611 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5612 		runTest(codeFormatter, "test423", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5613 	}
5614 
5615 	/**
5616 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49351
5617 	 */
test424()5618 	public void test424() {
5619 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5620 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP);
5621 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5622 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5623 		runTest(codeFormatter, "test424", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5624 	}
5625 
5626 	/**
5627 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49351
5628 	 */
test425()5629 	public void test425() {
5630 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5631 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP);
5632 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5633 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5634 		runTest(codeFormatter, "test425", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5635 	}
5636 
5637 	/**
5638 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49351
5639 	 */
test426()5640 	public void test426() {
5641 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5642 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP);
5643 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP);
5644 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5645 		preferences.number_of_empty_lines_to_preserve = 0;
5646 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5647 		runTest(codeFormatter, "test426", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5648 	}
5649 
5650 	/**
5651 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49351
5652 	 */
test427()5653 	public void test427() {
5654 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5655 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP);
5656 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP);
5657 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5658 		preferences.number_of_empty_lines_to_preserve = 0;
5659 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5660 		runTest(codeFormatter, "test427", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5661 	}
5662 
5663 	/**
5664 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49351
5665 	 */
test428()5666 	public void test428() {
5667 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5668 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP);
5669 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP);
5670 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5671 		preferences.number_of_empty_lines_to_preserve = 0;
5672 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5673 		runTest(codeFormatter, "test428", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5674 	}
5675 
5676 	/**
5677 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49351
5678 	 */
test429()5679 	public void test429() {
5680 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5681 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP);
5682 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5683 		preferences.number_of_empty_lines_to_preserve = 0;
5684 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5685 		runTest(codeFormatter, "test429", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5686 	}
5687 
5688 	/**
5689 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49351
5690 	 */
test430()5691 	public void test430() {
5692 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5693 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP);
5694 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5695 		preferences.number_of_empty_lines_to_preserve = 0;
5696 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5697 		runTest(codeFormatter, "test430", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5698 	}
5699 
5700 	/**
5701 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49351
5702 	 */
test431()5703 	public void test431() {
5704 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5705 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_SEMICOLON_IN_FOR, JavaCore.INSERT);
5706 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5707 		preferences.number_of_empty_lines_to_preserve = 0;
5708 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5709 		runTest(codeFormatter, "test431", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5710 	}
5711 
5712 	/**
5713 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49370
5714 	 */
test432()5715 	public void test432() {
5716 		String resourcePath = getResource("test432", "formatter.xml");
5717 		Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "AIS");
5718 		assertNotNull("No preferences", options);
5719 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5720 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5721 		runTest(codeFormatter, "test432", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5722 	}
5723 
5724 	/**
5725 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49370
5726 	 */
test433()5727 	public void test433() {
5728 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5729 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5730 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5731 		runTest(codeFormatter, "test433", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5732 	}
5733 
5734 	/**
5735 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49660
5736 	 */
test434()5737 	public void test434() {
5738 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5739 		options.put(
5740 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
5741 				DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
5742 		assertEquals(true, DefaultCodeFormatterConstants.getForceWrapping((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION)));
5743 		assertEquals(DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.getWrappingStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION)));
5744 		assertEquals(DefaultCodeFormatterConstants.INDENT_ON_COLUMN, DefaultCodeFormatterConstants.getIndentStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION)));
5745 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5746 		preferences.indentation_size = 3;
5747 		preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
5748 		preferences.insert_space_after_opening_paren_in_method_invocation = true;
5749 		preferences.insert_space_before_closing_paren_in_method_invocation = true;
5750 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5751 		runTest(codeFormatter, "test434", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5752 	}
5753 
5754 	/**
5755 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49772
5756 	 */
test435()5757 	public void test435() {
5758 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
5759 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5760 		preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
5761 		preferences.brace_position_for_method_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
5762 		preferences.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE;
5763 		preferences.blank_lines_before_first_class_body_declaration = 1;
5764         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
5765         preferences.tab_size = 4;
5766 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5767 		runTest(codeFormatter, "test435", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5768 	}
5769 
5770 	/**
5771 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49772
5772 	 */
test436()5773 	public void test436() {
5774 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
5775 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5776 		preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
5777 		preferences.brace_position_for_method_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
5778 		preferences.brace_position_for_constructor_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
5779 		preferences.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE;
5780 		preferences.blank_lines_before_first_class_body_declaration = 1;
5781         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
5782         preferences.tab_size = 4;
5783 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5784 		runTest(codeFormatter, "test436", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5785 	}
5786 
5787 	/**
5788 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49660
5789 	 */
test437()5790 	public void test437() {
5791 		String resourcePath = getResource("test437", "formatter.xml");
5792 		Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "Felix");
5793 		assertNotNull("No preferences", options);
5794 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5795 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5796 		runTest(codeFormatter, "test437", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5797 	}
5798 
5799 	/**
5800 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49660
5801 	 */
test438()5802 	public void test438() {
5803 		String resourcePath = getResource("test438", "formatter.xml");
5804 		Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "Felix");
5805 		assertNotNull("No preferences", options);
5806 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5807 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5808 		runTest(codeFormatter, "test438", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5809 	}
5810 
5811 	/**
5812 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49660
5813 	 */
test439()5814 	public void test439() {
5815 		String resourcePath = getResource("test439", "formatter.xml");
5816 		Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "Felix");
5817 		assertNotNull("No preferences", options);
5818 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5819 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5820 		runTest(codeFormatter, "test439", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5821 	}
5822 
5823 
5824 	/**
5825 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49763
5826 	 */
test440()5827 	public void test440() {
5828 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5829 		options.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, DefaultCodeFormatterConstants.FALSE);
5830 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5831 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5832 		runTest(codeFormatter, "test440", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5833 	}
5834 
5835 	/**
5836 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49763
5837 	 */
test441()5838 	public void test441() {
5839 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5840 		options.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, DefaultCodeFormatterConstants.FALSE);
5841 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5842 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5843 		runTest(codeFormatter, "test441", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5844 	}
5845 
5846 	/**
5847 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49763
5848 	 */
test442()5849 	public void test442() {
5850 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5851 		options.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, DefaultCodeFormatterConstants.FALSE);
5852 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5853 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5854 		runTest(codeFormatter, "test442", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5855 	}
5856 
5857 	/**
5858 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49763
5859 	 */
test443()5860 	public void test443() {
5861 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5862 		options.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, DefaultCodeFormatterConstants.FALSE);
5863 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaCore.INSERT);
5864 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaCore.INSERT);
5865 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaCore.INSERT);
5866 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaCore.INSERT);
5867 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5868 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5869 		runTest(codeFormatter, "test443", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5870 	}
5871 
5872 	/**
5873 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49763
5874 	 */
test444()5875 	public void test444() {
5876 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5877 		options.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, DefaultCodeFormatterConstants.FALSE);
5878 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5879 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5880 		runTest(codeFormatter, "test444", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5881 	}
5882 
5883 	/**
5884 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49763
5885 	 */
test445()5886 	public void test445() {
5887 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5888 		options.put(DefaultCodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, DefaultCodeFormatterConstants.FALSE);
5889 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5890 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5891 		runTest(codeFormatter, "test445", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5892 	}
5893 
5894 	/**
5895 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49327
5896 	 */
test446()5897 	public void test446() {
5898 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5899 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5900 		preferences.number_of_empty_lines_to_preserve = 0;
5901 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5902 		runTest(codeFormatter, "test446", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5903 	}
5904 
5905 	/**
5906 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49187
5907 	 */
test447()5908 	public void test447() {
5909 		String resourcePath = getResource("test447", "test447.zip");
5910 		Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "settings.xml", "Toms");
5911 		assertNotNull("No preferences", options);
5912 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5913 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5914 		String input = getZipEntryContents(resourcePath, getIn("Format.java"));
5915 		assertNotNull("No input", input);
5916 		String output = getZipEntryContents(resourcePath, getOut("Format.java"));
5917 		assertNotNull("No output", output);
5918 		int start = input.indexOf("private");
5919 		int end = input.indexOf(";");
5920 		runTest(input, output, codeFormatter, CodeFormatter.K_COMPILATION_UNIT, 0, false, start, end - start + 1, "\r\n");//$NON-NLS-1$ //$NON-NLS-2$
5921 	}
5922 
5923 	/**
5924 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49953
5925 	 */
test448()5926 	public void test448() {
5927 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5928 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5929 		preferences.number_of_empty_lines_to_preserve = 0;
5930 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
5931 		preferences.insert_space_before_opening_bracket_in_array_allocation_expression = true;
5932 		preferences.insert_space_after_opening_bracket_in_array_allocation_expression = true;
5933 		preferences.insert_space_before_closing_bracket_in_array_allocation_expression = true;
5934 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5935 		runTest(codeFormatter, "test448", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5936 	}
5937 
5938 	/**
5939 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49953
5940 	 */
test449()5941 	public void test449() {
5942 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5943 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5944 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
5945 		preferences.number_of_empty_lines_to_preserve = 0;
5946 		preferences.insert_space_before_opening_bracket_in_array_allocation_expression = false;
5947 		preferences.insert_space_after_opening_bracket_in_array_allocation_expression = true;
5948 		preferences.insert_space_before_closing_bracket_in_array_allocation_expression = true;
5949 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5950 		runTest(codeFormatter, "test449", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5951 	}
5952 
5953 	/**
5954 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=50225
5955 	 */
test450()5956 	public void test450() {
5957 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5958 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5959 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5960 		runTest(codeFormatter, "test450", "A.java", CodeFormatter.K_UNKNOWN, 0, false, 0, 0);//$NON-NLS-1$ //$NON-NLS-2$
5961 	}
5962 
5963 	/**
5964 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49187
5965 	 */
test451()5966 	public void test451() {
5967 		String resourcePath = getResource("test451", "test451.zip");
5968 		Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "settings.xml", "Toms");
5969 		assertNotNull("No preferences", options);
5970 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5971 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5972 		String input = getZipEntryContents(resourcePath, getIn("Format.java"));
5973 		assertNotNull("No input", input);
5974 		String output = getZipEntryContents(resourcePath, getOut("Format.java"));
5975 		assertNotNull("No output", output);
5976 		int start = input.indexOf("private");
5977 		int end = input.indexOf(";");
5978 		runTest(input, output, codeFormatter, CodeFormatter.K_COMPILATION_UNIT, 0, false, start, end - start + 1, "\r\n");//$NON-NLS-1$ //$NON-NLS-2$
5979 	}
5980 
5981 	/**
5982 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49187
5983 	 */
test452()5984 	public void test452() {
5985 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
5986 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_PACKAGE, "2");
5987 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_PACKAGE, "2");
5988 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5989 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
5990 		runTest(codeFormatter, "test452", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
5991 	}
5992 
5993 	/**
5994 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=50719
5995 	 */
test453()5996 	public void test453() {
5997 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
5998 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
5999 		preferences.blank_lines_before_first_class_body_declaration = 1;
6000         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
6001         preferences.tab_size = 4;
6002 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6003 		runTest(codeFormatter, "test453", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6004 	}
6005 
6006 	/**
6007 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=50736
6008 	 */
test454()6009 	public void test454() {
6010 		String resourcePath = getResource("test454", "test454.zip");
6011 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6012 		options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");//$NON-NLS-1$
6013 		assertNotNull("No preferences", options);
6014 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6015 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6016 		String input = getZipEntryContents(resourcePath, getIn("A.java"));
6017 		assertNotNull("No input", input);
6018 		String output = getZipEntryContents(resourcePath, getOut("A.java"));
6019 		assertNotNull("No output", output);
6020 		int start = input.indexOf("launch.setAttribute");
6021 		int end = input.indexOf(";", start + 1);
6022 		runTest(input, output, codeFormatter, CodeFormatter.K_COMPILATION_UNIT, 0, false, start, end - start + 1, "\r\n");//$NON-NLS-1$ //$NON-NLS-2$
6023 	}
6024 
6025 	/**
6026 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=50736
6027 	 */
test455()6028 	public void test455() {
6029 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6030 		options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");//$NON-NLS-1$
6031 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6032 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6033 		runTest(codeFormatter, "test455", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6034 	}
test455b()6035 	public void test455b() {
6036 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6037 		options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");//$NON-NLS-1$
6038 		options.put(DefaultCodeFormatterConstants.FORMATTER_WRAP_OUTER_EXPRESSIONS_WHEN_NESTED, DefaultCodeFormatterConstants.FALSE);
6039 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6040 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6041 		runTest(codeFormatter, "test455b", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6042 	}
6043 
6044 	/**
6045 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=50736
6046 	 */
test456()6047 	public void test456() {
6048 		String resourcePath = getResource("test456", "test456.zip");
6049 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6050 		assertNotNull("No preferences", options);
6051 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6052 		preferences.number_of_empty_lines_to_preserve = 0;
6053 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6054 		String input = getZipEntryContents(resourcePath, getIn("A.java"));
6055 		assertNotNull("No input", input);
6056 		String output = getZipEntryContents(resourcePath, getOut("A.java"));
6057 		assertNotNull("No output", output);
6058 		int start = input.indexOf("launch.setAttribute");
6059 		int end = input.indexOf(";", start + 1);
6060 		runTest(input, output, codeFormatter, CodeFormatter.K_COMPILATION_UNIT, 0, false, start, end - start + 1, "\r\n");//$NON-NLS-1$ //$NON-NLS-2$
6061 	}
6062 
6063 	/**
6064 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=50989
6065 	 */
test457()6066 	public void test457() {
6067 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6068 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6069 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6070 		runTest(codeFormatter, "test457", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6071 	}
6072 
6073 	/**
6074 	 * Check null options
6075 	 */
test458()6076 	public void test458() {
6077 		CodeFormatter codeFormatter = ToolFactory.createCodeFormatter(null);
6078 		runTest(codeFormatter, "test458", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6079 	}
6080 
6081 	/**
6082 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51158
6083 	 */
test459()6084 	public void test459() {
6085 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6086 		options.put(
6087 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
6088 				DefaultCodeFormatterConstants.createAlignmentValue(
6089 						true,
6090 						DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
6091 						DefaultCodeFormatterConstants.INDENT_BY_ONE
6092 				));
6093 		options.put(
6094 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_STRING_CONCATENATION,
6095 				DefaultCodeFormatterConstants.createAlignmentValue(
6096 						false,
6097 						DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
6098 						DefaultCodeFormatterConstants.INDENT_BY_ONE
6099 				));
6100 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6101 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6102 		runTest(codeFormatter, "test459", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
6103 	}
6104 
6105 	/**
6106 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51158
6107 	 */
test460()6108 	public void test460() {
6109 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6110 		options.put(
6111 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ADDITIVE_OPERATOR,
6112 				DefaultCodeFormatterConstants.createAlignmentValue(
6113 						false,
6114 						DefaultCodeFormatterConstants.WRAP_COMPACT,
6115 						DefaultCodeFormatterConstants.INDENT_BY_ONE
6116 				));
6117 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6118 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6119 		runTest(codeFormatter, "test460", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
6120 	}
6121 
6122 	/**
6123 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51190
6124 	 */
test461()6125 	public void test461() {
6126 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6127 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6128 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6129 		runTest(codeFormatter, "test461", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6130 	}
6131 
6132 	/**
6133 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51158
6134 	 */
test462()6135 	public void test462() {
6136 		String resourcePath = getResource("test462", "formatter.xml");
6137 		Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "neils");
6138 		assertNotNull("No preferences", options);
6139 
6140 		options.put(
6141 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
6142 			DefaultCodeFormatterConstants.createAlignmentValue(
6143 				true,
6144 				DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
6145 				DefaultCodeFormatterConstants.INDENT_DEFAULT));
6146 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6147 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6148 		runTest(codeFormatter, "test462", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
6149 	}
6150 
6151 	/**
6152 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=50276
6153 	 */
test463()6154 	public void test463() {
6155 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6156 		options.put(
6157 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION,
6158 				DefaultCodeFormatterConstants.createAlignmentValue(
6159 					false,
6160 					DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
6161 					DefaultCodeFormatterConstants.INDENT_DEFAULT));
6162 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6163 		preferences.number_of_empty_lines_to_preserve = 0;
6164 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6165 		runTest(codeFormatter, "test463", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
6166 	}
6167 
6168 	/**
6169 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51128
6170 	 */
test464()6171 	public void test464() {
6172 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6173 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_FOR, JavaCore.INSERT);
6174 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_FOR, JavaCore.INSERT);
6175 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_FOR, JavaCore.INSERT);
6176 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_DECLARATION, JavaCore.INSERT);
6177 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_DECLARATION, JavaCore.INSERT);
6178 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
6179 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED);
6180 		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK, DefaultCodeFormatterConstants.FALSE);
6181 		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY, DefaultCodeFormatterConstants.TRUE);
6182 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION, JavaCore.INSERT);
6183 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION, JavaCore.INSERT);
6184 
6185 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6186 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6187 		runTest(codeFormatter, "test464", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
6188 	}
6189 
6190 	/**
6191 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44642
6192 	 * @deprecated
6193 	 */
test465()6194 	public void test465() {
6195 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6196 		options.put(
6197 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION,
6198 			DefaultCodeFormatterConstants.createAlignmentValue(
6199 				false,
6200 				DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
6201 				DefaultCodeFormatterConstants.INDENT_BY_ONE));
6202 		options.put(
6203 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
6204 			DefaultCodeFormatterConstants.createAlignmentValue(
6205 				false,
6206 				DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
6207 				DefaultCodeFormatterConstants.INDENT_BY_ONE));
6208 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6209 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6210 		runTest(codeFormatter, "test465", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
6211 	}
6212 
6213 	/**
6214 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44642
6215 	 * @deprecated
6216 	 */
test466()6217 	public void test466() {
6218 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6219 		options.put(
6220 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION,
6221 			DefaultCodeFormatterConstants.createAlignmentValue(
6222 				false,
6223 				DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
6224 				DefaultCodeFormatterConstants.INDENT_BY_ONE));
6225 		options.put(
6226 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
6227 			DefaultCodeFormatterConstants.createAlignmentValue(
6228 				true,
6229 				DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
6230 				DefaultCodeFormatterConstants.INDENT_BY_ONE));
6231 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6232 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6233 		runTest(codeFormatter, "test466", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
6234 	}
6235 
6236 	/**
6237 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44642
6238 	 * @deprecated
6239 	 */
test467()6240 	public void test467() {
6241 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6242 		options.put(
6243 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION,
6244 			DefaultCodeFormatterConstants.createAlignmentValue(
6245 				false,
6246 				DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
6247 				DefaultCodeFormatterConstants.INDENT_BY_ONE));
6248 		options.put(
6249 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
6250 			DefaultCodeFormatterConstants.createAlignmentValue(
6251 				false,
6252 				DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
6253 				DefaultCodeFormatterConstants.INDENT_BY_ONE));
6254 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6255 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6256 		runTest(codeFormatter, "test467", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
6257 	}
6258 
6259 	/**
6260 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51128
6261 	 */
test468()6262 	public void test468() {
6263 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6264 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
6265 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
6266 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
6267 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
6268 		options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");//$NON-NLS-1$
6269 
6270 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6271 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6272 		runTest(codeFormatter, "test468", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6273 	}
6274 
6275 	/**
6276 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51201
6277 	 */
test469()6278 	public void test469() {
6279 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6280 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION, JavaCore.INSERT);
6281 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION, JavaCore.INSERT);
6282 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACKETS_IN_ARRAY_ALLOCATION_EXPRESSION, JavaCore.DO_NOT_INSERT);
6283 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
6284 		options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, DefaultCodeFormatterConstants.TRUE);
6285 
6286 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6287 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6288 		runTest(codeFormatter, "test469", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6289 	}
6290 
6291 	/**
6292 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51035
6293 	 */
test470()6294 	public void test470() {
6295 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
6296 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6297 		preferences.keep_simple_if_on_one_line = true;
6298 		preferences.keep_guardian_clause_on_one_line = true;
6299         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
6300         preferences.tab_size = 4;
6301 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6302 		runTest(codeFormatter, "test470", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6303 	}
6304 
6305 	/**
6306 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51659
6307 	 */
test471()6308 	public void test471() {
6309 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6310 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
6311 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.DO_NOT_INSERT);
6312 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
6313 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER, JavaCore.DO_NOT_INSERT);
6314 		options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, DefaultCodeFormatterConstants.TRUE);
6315 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6316 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6317 		runTest(codeFormatter, "test471", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6318 	}
6319 
6320 	/**
6321 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51659
6322 	 */
test472()6323 	public void test472() {
6324 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6325 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
6326 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
6327 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
6328 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER, JavaCore.DO_NOT_INSERT);
6329 		options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, DefaultCodeFormatterConstants.TRUE);
6330 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6331 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6332 		runTest(codeFormatter, "test472", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6333 	}
6334 
6335 	/**
6336 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51659
6337 	 */
test473()6338 	public void test473() {
6339 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6340 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
6341 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.DO_NOT_INSERT);
6342 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.DO_NOT_INSERT);
6343 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER, JavaCore.DO_NOT_INSERT);
6344 		options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, DefaultCodeFormatterConstants.TRUE);
6345 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6346 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6347 		runTest(codeFormatter, "test473", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6348 	}
6349 
6350 	/**
6351 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51659
6352 	 */
test474()6353 	public void test474() {
6354 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6355 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
6356 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
6357 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.DO_NOT_INSERT);
6358 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER, JavaCore.DO_NOT_INSERT);
6359 		options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, DefaultCodeFormatterConstants.TRUE);
6360 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6361 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6362 		runTest(codeFormatter, "test474", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6363 	}
6364 
6365 	/**
6366 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51659
6367 	 */
test475()6368 	public void test475() {
6369 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6370 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
6371 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.DO_NOT_INSERT);
6372 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
6373 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
6374 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER, JavaCore.DO_NOT_INSERT);
6375 		options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, DefaultCodeFormatterConstants.TRUE);
6376 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6377 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6378 		runTest(codeFormatter, "test475", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6379 	}
6380 
6381 	/**
6382 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51768
6383 	 */
test476()6384 	public void test476() {
6385 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6386 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
6387 		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_TYPE_HEADER, DefaultCodeFormatterConstants.FALSE);
6388 		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK, DefaultCodeFormatterConstants.FALSE);
6389 		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY, DefaultCodeFormatterConstants.FALSE);
6390 		options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");
6391 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED);
6392 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED);
6393 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED);
6394 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_IMPORTS, "1");
6395 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION, JavaCore.INSERT);
6396 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION, JavaCore.INSERT);
6397 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_IF, JavaCore.INSERT);
6398 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_IF, JavaCore.INSERT);
6399 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_IF, JavaCore.INSERT);
6400 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_FOR, JavaCore.INSERT);
6401 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_FOR, JavaCore.INSERT);
6402 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_FOR, JavaCore.INSERT);
6403 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR, JavaCore.INSERT);
6404 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR, JavaCore.INSERT);
6405 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_MULTIPLICATIVE_OPERATOR, JavaCore.INSERT);
6406 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_MULTIPLICATIVE_OPERATOR, JavaCore.INSERT);
6407 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_RELATIONAL_OPERATOR, JavaCore.INSERT);
6408 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_RELATIONAL_OPERATOR, JavaCore.INSERT);
6409 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6410 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6411 		runTest(codeFormatter, "test476", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6412 	}
6413 
6414 	/**
6415 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51603
6416 	 */
test477()6417 	public void test477() {
6418 		String option =
6419 			DefaultCodeFormatterConstants.createAlignmentValue(
6420 				true,
6421 				DefaultCodeFormatterConstants.WRAP_NO_SPLIT,
6422 				DefaultCodeFormatterConstants.INDENT_BY_ONE);
6423 		assertTrue("Wrong force setting", DefaultCodeFormatterConstants.getForceWrapping(option));
6424 		assertEquals("Wrong wrapping style", DefaultCodeFormatterConstants.WRAP_NO_SPLIT, DefaultCodeFormatterConstants.getWrappingStyle(option));
6425 		assertEquals("Wrong indent style", DefaultCodeFormatterConstants.INDENT_BY_ONE, DefaultCodeFormatterConstants.getIndentStyle(option));
6426 
6427 		option = DefaultCodeFormatterConstants.setForceWrapping(option, false);
6428 		assertFalse("Wrong force setting", DefaultCodeFormatterConstants.getForceWrapping(option));
6429 		assertEquals("Wrong wrapping style", DefaultCodeFormatterConstants.WRAP_NO_SPLIT, DefaultCodeFormatterConstants.getWrappingStyle(option));
6430 		assertEquals("Wrong indent style", DefaultCodeFormatterConstants.INDENT_BY_ONE, DefaultCodeFormatterConstants.getIndentStyle(option));
6431 
6432 		option = DefaultCodeFormatterConstants.setIndentStyle(option, DefaultCodeFormatterConstants.INDENT_ON_COLUMN);
6433 		assertFalse("Wrong force setting", DefaultCodeFormatterConstants.getForceWrapping(option));
6434 		assertEquals("Wrong wrapping style", DefaultCodeFormatterConstants.WRAP_NO_SPLIT, DefaultCodeFormatterConstants.getWrappingStyle(option));
6435 		assertEquals("Wrong indent style", DefaultCodeFormatterConstants.INDENT_ON_COLUMN, DefaultCodeFormatterConstants.getIndentStyle(option));
6436 
6437 
6438 		option = DefaultCodeFormatterConstants.setIndentStyle(option, DefaultCodeFormatterConstants.INDENT_DEFAULT);
6439 		assertFalse("Wrong force setting", DefaultCodeFormatterConstants.getForceWrapping(option));
6440 		assertEquals("Wrong wrapping style", DefaultCodeFormatterConstants.WRAP_NO_SPLIT, DefaultCodeFormatterConstants.getWrappingStyle(option));
6441 		assertEquals("Wrong indent style", DefaultCodeFormatterConstants.INDENT_DEFAULT, DefaultCodeFormatterConstants.getIndentStyle(option));
6442 
6443 
6444 		option = DefaultCodeFormatterConstants.setForceWrapping(option, true);
6445 		assertTrue("Wrong force setting", DefaultCodeFormatterConstants.getForceWrapping(option));
6446 		assertEquals("Wrong wrapping style", DefaultCodeFormatterConstants.WRAP_NO_SPLIT, DefaultCodeFormatterConstants.getWrappingStyle(option));
6447 		assertEquals("Wrong indent style", DefaultCodeFormatterConstants.INDENT_DEFAULT, DefaultCodeFormatterConstants.getIndentStyle(option));
6448 
6449 
6450 		option = DefaultCodeFormatterConstants.setWrappingStyle(option, DefaultCodeFormatterConstants.WRAP_COMPACT);
6451 		assertTrue("Wrong force setting", DefaultCodeFormatterConstants.getForceWrapping(option));
6452 		assertEquals("Wrong wrapping style", DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.getWrappingStyle(option));
6453 		assertEquals("Wrong indent style", DefaultCodeFormatterConstants.INDENT_DEFAULT, DefaultCodeFormatterConstants.getIndentStyle(option));
6454 
6455 
6456 		option = DefaultCodeFormatterConstants.setWrappingStyle(option, DefaultCodeFormatterConstants.WRAP_COMPACT_FIRST_BREAK);
6457 		assertTrue("Wrong force setting", DefaultCodeFormatterConstants.getForceWrapping(option));
6458 		assertEquals("Wrong wrapping style", DefaultCodeFormatterConstants.WRAP_COMPACT_FIRST_BREAK, DefaultCodeFormatterConstants.getWrappingStyle(option));
6459 		assertEquals("Wrong indent style", DefaultCodeFormatterConstants.INDENT_DEFAULT, DefaultCodeFormatterConstants.getIndentStyle(option));
6460 
6461 		option = DefaultCodeFormatterConstants.setWrappingStyle(option, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE);
6462 		assertTrue("Wrong force setting", DefaultCodeFormatterConstants.getForceWrapping(option));
6463 		assertEquals("Wrong wrapping style", DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.getWrappingStyle(option));
6464 		assertEquals("Wrong indent style", DefaultCodeFormatterConstants.INDENT_DEFAULT, DefaultCodeFormatterConstants.getIndentStyle(option));
6465 
6466 		option = DefaultCodeFormatterConstants.setWrappingStyle(option, DefaultCodeFormatterConstants.WRAP_NEXT_SHIFTED);
6467 		assertTrue("Wrong force setting", DefaultCodeFormatterConstants.getForceWrapping(option));
6468 		assertEquals("Wrong wrapping style", DefaultCodeFormatterConstants.WRAP_NEXT_SHIFTED, DefaultCodeFormatterConstants.getWrappingStyle(option));
6469 		assertEquals("Wrong indent style", DefaultCodeFormatterConstants.INDENT_DEFAULT, DefaultCodeFormatterConstants.getIndentStyle(option));
6470 
6471 		option = DefaultCodeFormatterConstants.setWrappingStyle(option, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE);
6472 		assertTrue("Wrong force setting", DefaultCodeFormatterConstants.getForceWrapping(option));
6473 		assertEquals("Wrong wrapping style", DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.getWrappingStyle(option));
6474 		assertEquals("Wrong indent style", DefaultCodeFormatterConstants.INDENT_DEFAULT, DefaultCodeFormatterConstants.getIndentStyle(option));
6475 	}
6476 
6477 	/**
6478 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=52246
6479 	 */
test478()6480 	public void test478() {
6481 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6482 		options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_4);
6483 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6484 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, options);
6485 		runTest(codeFormatter, "test478", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6486 	}
6487 
6488 	/**
6489 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=52479
6490 	 */
test479()6491 	public void test479() {
6492 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6493 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6494 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6495 		runTest(codeFormatter, "test479", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6496 	}
6497 
6498 	/**
6499 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=52479
6500 	 */
test480()6501 	public void test480() {
6502 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6503 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6504 		preferences.number_of_empty_lines_to_preserve = 0;
6505 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6506 		runTest(codeFormatter, "test480", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6507 	}
6508 
6509 	/**
6510 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=52283
6511 	 */
test481()6512 	public void test481() {
6513 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6514 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6515 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6516 		runTest(codeFormatter, "test481", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6517 	}
6518 
6519 	/**
6520 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=52283
6521 	 */
test482()6522 	public void test482() {
6523 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6524 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_BRACE_IN_BLOCK, JavaCore.DO_NOT_INSERT);
6525 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6526 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6527 		runTest(codeFormatter, "test482", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6528 	}
6529 
6530 	/**
6531 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=52851
6532 	 */
test483()6533 	public void test483() {
6534 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6535 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_BRACE_IN_BLOCK, JavaCore.DO_NOT_INSERT);
6536 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6537 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6538 		runTest(codeFormatter, "test483", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6539 	}
6540 
6541 	/**
6542 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=50989
6543 	 */
test484()6544 	public void test484() {
6545 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6546 		options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");//$NON-NLS-1$
6547 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6548 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6549 		runTest(codeFormatter, "test484", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6550 	}
6551 
6552 	/**
6553 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=50989
6554 	 */
test485()6555 	public void test485() {
6556 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6557 		options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");//$NON-NLS-1$
6558 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6559 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6560 		runTest(codeFormatter, "test485", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6561 	}
6562 
6563 	/**
6564 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=50989
6565 	 */
test486()6566 	public void test486() {
6567 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6568 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);//$NON-NLS-1$
6569 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);//$NON-NLS-1$
6570 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);//$NON-NLS-1$
6571 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);//$NON-NLS-1$
6572 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);//$NON-NLS-1$
6573 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);//$NON-NLS-1$
6574 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6575 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6576 		runTest(codeFormatter, "test486", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6577 	}
6578 
test487()6579 	public void test487() {
6580 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
6581 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
6582 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6583 		runTest(codeFormatter, "test487", "A.java", CodeFormatter.K_COMPILATION_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
6584 	}
6585 
test488()6586 	public void test488() {
6587 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6588 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CASE, JavaCore.DO_NOT_INSERT);
6589 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6590 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
6591 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6592 		runTest(codeFormatter, "test488", "A.java", CodeFormatter.K_COMPILATION_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
6593 	}
6594 
test489()6595 	public void test489() {
6596 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6597 		options.put(
6598 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
6599 				DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
6600 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6601 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
6602 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6603 		runTest(codeFormatter, "test489", "A.java", CodeFormatter.K_COMPILATION_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
6604 	}
6605 
6606 	/**
6607 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=52747
6608 	 */
test490()6609 	public void test490() {
6610 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6611 		options.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER, DefaultCodeFormatterConstants.NEXT_LINE);
6612 		options.put(DefaultCodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, DefaultCodeFormatterConstants.TRUE);
6613 		options.put(
6614 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER,
6615 				DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
6616 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6617 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
6618 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6619 		runTest(codeFormatter, "test490", "A.java", CodeFormatter.K_COMPILATION_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
6620 	}
6621 
6622 	/**
6623 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=59451
6624 	 */
_test491()6625 	public void _test491() {
6626 		String resourcePath = getResource("test491", "formatter.xml");
6627 		Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "DOI");
6628 		assertNotNull("No preferences", options);
6629 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6630 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6631 		runTest(codeFormatter, "test491", "BundleChain.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6632 	}
6633 
6634 	/**
6635 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=59575
6636 	 */
test492()6637 	public void test492() {
6638 		String resourcePath = getResource("test492", "core_formatting.xml");
6639 		Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "core");
6640 		assertNotNull("No preferences", options);
6641 		options.put(JavaCore.COMPILER_PB_NON_NLS_STRING_LITERAL, JavaCore.ERROR);
6642 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6643 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, options);
6644 		runTest(codeFormatter, "test492", "Main.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6645 	}
6646 
6647 	/**
6648 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=59716
6649 	 */
test493()6650 	public void test493() {
6651 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6652 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_PACKAGE, "1");
6653 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_PACKAGE, "1");
6654 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_IMPORTS, "1");
6655 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_IMPORTS, "1");
6656 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6657 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6658 		runTest(codeFormatter, "test493", "MyClass.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6659 	}
6660 
6661 	/**
6662 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=60035
6663 	 */
test494()6664 	public void test494() {
6665 		String resourcePath = getResource("test494", "format.xml");
6666 		Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "AGPS default");
6667 		assertNotNull("No preferences", options);
6668 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6669 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, options);
6670 		runTest(codeFormatter, "test494", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6671 	}
6672 
6673 	/**
6674 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=58565
6675 	 */
test495()6676 	public void test495() {
6677 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
6678 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6679 		preferences.blank_lines_before_first_class_body_declaration = 1;
6680         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
6681         preferences.tab_size = 4;
6682 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6683 		runTest(codeFormatter, "test495", "A.java", CodeFormatter.K_COMPILATION_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
6684 	}
6685 
6686 	/**
6687 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=58565
6688 	 */
test496()6689 	public void test496() {
6690 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
6691 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6692         preferences.tab_size = 4;
6693         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
6694 		preferences.keep_simple_if_on_one_line = true;
6695 		preferences.keep_guardian_clause_on_one_line = true;
6696 		preferences.blank_lines_before_first_class_body_declaration = 1;
6697 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6698 		runTest(codeFormatter, "test496", "A.java", CodeFormatter.K_COMPILATION_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
6699 	}
6700 
test497()6701 	public void test497() {
6702 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
6703 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6704         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
6705 		preferences.blank_lines_before_first_class_body_declaration = 1;
6706         preferences.tab_size = 4;
6707 		setPageWidth80(preferences);
6708 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6709 		runTest(codeFormatter, "test497", "A.java", CodeFormatter.K_COMPILATION_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
6710 	}
6711 
test498()6712 	public void test498() {
6713 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
6714 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6715         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
6716 		preferences.keep_simple_if_on_one_line = true;
6717 		preferences.keep_guardian_clause_on_one_line = true;
6718         preferences.tab_size = 4;
6719 		setPageWidth80(preferences);
6720 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6721 		runTest(codeFormatter, "test498", "A.java", CodeFormatter.K_COMPILATION_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
6722 	}
6723 
test499()6724 	public void test499() {
6725 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
6726 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6727 		preferences.blank_lines_before_first_class_body_declaration = 1;
6728         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
6729         preferences.tab_size = 4;
6730 		setPageWidth80(preferences);
6731 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6732 		runTest(codeFormatter, "test499", "A.java", CodeFormatter.K_COMPILATION_UNIT, true);//$NON-NLS-1$ //$NON-NLS-2$
6733 	}
6734 
test500()6735 	public void test500() {
6736 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
6737 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6738 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6739 		runTest(codeFormatter, "test500", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
6740 	}
6741 
6742 	/**
6743 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=68506
6744 	 */
test501()6745 	public void test501() {
6746 		String resourcePath = getResource("test501", "formatter.xml");
6747 		Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "GMTI");
6748 		assertNotNull("No preferences", options);
6749 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6750 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6751 		runTest(codeFormatter, "test501", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6752 	}
6753 
6754 	/**
6755 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=69806
6756 	 */
test502()6757 	public void test502() {
6758 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
6759 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6760         preferences.tab_size = 4;
6761         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
6762 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6763 		runTest(codeFormatter, "test502", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
6764 	}
6765 
6766 	/**
6767 	 * Formatting foreach
6768 	 */
test503()6769 	public void test503() {
6770 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
6771 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6772         preferences.tab_size = 4;
6773 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
6774 		Map compilerOptions = new HashMap();
6775 		compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
6776 		compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
6777 		compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
6778 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
6779 		runTest(codeFormatter, "test503", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
6780 	}
6781 
6782 	/**
6783 	 * Formatting parameterized type
6784 	 */
test504()6785 	public void test504() {
6786 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
6787 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6788 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
6789         preferences.tab_size = 4;
6790 		Hashtable javaCoreOptions = JavaCore.getOptions();
6791 		try {
6792 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
6793 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
6794 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
6795 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
6796 			JavaCore.setOptions(newJavaCoreOptions);
6797 
6798 			Map compilerOptions = new HashMap();
6799 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
6800 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
6801 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
6802 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
6803 			runTest(codeFormatter, "test504", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
6804 		} finally {
6805 			JavaCore.setOptions(javaCoreOptions);
6806 		}
6807 	}
6808 
6809 	/**
6810 	 * Formatting parameterized type
6811 	 */
test505()6812 	public void test505() {
6813 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
6814 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6815         preferences.tab_size = 4;
6816 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
6817 		Hashtable javaCoreOptions = JavaCore.getOptions();
6818 		try {
6819 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
6820 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
6821 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
6822 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
6823 			JavaCore.setOptions(newJavaCoreOptions);
6824 
6825 			Map compilerOptions = new HashMap();
6826 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
6827 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
6828 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
6829 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
6830 			runTest(codeFormatter, "test505", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
6831 		} finally {
6832 			JavaCore.setOptions(javaCoreOptions);
6833 		}
6834 	}
6835 
6836 	/**
6837 	 * Formatting parameterized type
6838 	 */
test506()6839 	public void test506() {
6840 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
6841 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6842         preferences.tab_size = 4;
6843 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
6844 		setPageWidth80(preferences);
6845 		Hashtable javaCoreOptions = JavaCore.getOptions();
6846 		try {
6847 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
6848 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
6849 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
6850 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
6851 			JavaCore.setOptions(newJavaCoreOptions);
6852 
6853 			Map compilerOptions = new HashMap();
6854 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
6855 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
6856 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
6857 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
6858 			runTest(codeFormatter, "test506", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
6859 		} finally {
6860 			JavaCore.setOptions(javaCoreOptions);
6861 		}
6862 	}
6863 
6864 	/**
6865 	 * Formatting enum declaration
6866 	 */
test507()6867 	public void test507() {
6868 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
6869 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6870         preferences.tab_size = 4;
6871 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
6872 		Hashtable javaCoreOptions = JavaCore.getOptions();
6873 		try {
6874 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
6875 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
6876 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
6877 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
6878 			JavaCore.setOptions(newJavaCoreOptions);
6879 
6880 			Map compilerOptions = new HashMap();
6881 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
6882 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
6883 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
6884 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
6885 			runTest(codeFormatter, "test507", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
6886 		} finally {
6887 			JavaCore.setOptions(javaCoreOptions);
6888 		}
6889 	}
6890 
6891 	/**
6892 	 * Formatting annotation type declaration
6893 	 */
test508()6894 	public void test508() {
6895 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
6896 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6897 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
6898         preferences.tab_size = 4;
6899 		Hashtable javaCoreOptions = JavaCore.getOptions();
6900 		try {
6901 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
6902 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
6903 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
6904 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
6905 			JavaCore.setOptions(newJavaCoreOptions);
6906 
6907 			Map compilerOptions = new HashMap();
6908 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
6909 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
6910 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
6911 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
6912 			runTest(codeFormatter, "test508", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
6913 		} finally {
6914 			JavaCore.setOptions(javaCoreOptions);
6915 		}
6916 	}
6917 
6918 	/**
6919 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=68506
6920 	 */
test509()6921 	public void test509() {
6922 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
6923 		preferences.keep_simple_if_on_one_line = true;
6924 		preferences.keep_then_statement_on_same_line = true;
6925 		preferences.keep_guardian_clause_on_one_line = true;
6926 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
6927 		preferences.compact_else_if = true;
6928 		preferences.insert_new_line_at_end_of_file_if_missing = true;
6929 		preferences.number_of_empty_lines_to_preserve = 0;
6930 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6931 		runTest(codeFormatter,"test509", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
6932 	}
6933 
6934 	/**
6935 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=68506
6936 	 */
test510()6937 	public void test510() {
6938 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
6939 		preferences.keep_simple_if_on_one_line = true;
6940 		preferences.keep_then_statement_on_same_line = true;
6941 		preferences.keep_guardian_clause_on_one_line = true;
6942 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
6943 		preferences.compact_else_if = true;
6944 		preferences.insert_new_line_at_end_of_file_if_missing = false;
6945 		preferences.number_of_empty_lines_to_preserve = 1;
6946 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6947 		runTest(codeFormatter,"test510", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
6948 	}
6949 
6950 	/**
6951 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=68506
6952 	 */
test511()6953 	public void test511() {
6954 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
6955 		preferences.keep_simple_if_on_one_line = true;
6956 		preferences.keep_then_statement_on_same_line = true;
6957 		preferences.keep_guardian_clause_on_one_line = true;
6958 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
6959 		preferences.compact_else_if = true;
6960 		preferences.insert_new_line_at_end_of_file_if_missing = false;
6961 		preferences.number_of_empty_lines_to_preserve = 1;
6962 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6963 		runTest(codeFormatter,"test511", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
6964 	}
6965 
6966 	/**
6967 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=68506
6968 	 */
test512()6969 	public void test512() {
6970 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
6971 		preferences.keep_simple_if_on_one_line = true;
6972 		preferences.keep_then_statement_on_same_line = true;
6973 		preferences.keep_guardian_clause_on_one_line = true;
6974 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
6975 		preferences.compact_else_if = true;
6976 		preferences.insert_new_line_at_end_of_file_if_missing = true;
6977 		preferences.number_of_empty_lines_to_preserve = 1;
6978 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
6979 		runTest(codeFormatter,"test512", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
6980 	}
6981 
6982 	/**
6983 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=73371
6984 	 */
test513()6985 	public void test513() {
6986 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
6987 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6988 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
6989         preferences.tab_size = 4;
6990 		Hashtable javaCoreOptions = JavaCore.getOptions();
6991 		try {
6992 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
6993 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
6994 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
6995 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
6996 			JavaCore.setOptions(newJavaCoreOptions);
6997 
6998 			Map compilerOptions = new HashMap();
6999 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7000 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7001 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7002 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7003 			runTest(codeFormatter, "test513", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7004 		} finally {
7005 			JavaCore.setOptions(javaCoreOptions);
7006 		}
7007 	}
7008 
7009 	/**
7010 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=75488
7011 	 */
test514()7012 	public void test514() {
7013 		String resourcePath = getResource("test514", "formatter.xml");
7014 		Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "core");
7015 		assertNotNull("No preferences", options);
7016 		options.put(JavaCore.COMPILER_PB_NON_NLS_STRING_LITERAL, JavaCore.ERROR);
7017 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7018 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, options);
7019 		runTest(codeFormatter, "test514", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
7020 	}
7021 
7022 	/**
7023 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=75720
7024 	 */
test515()7025 	public void test515() {
7026 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7027 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7028         preferences.tab_size = 4;
7029 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7030 		Hashtable javaCoreOptions = JavaCore.getOptions();
7031 		try {
7032 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7033 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7034 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7035 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7036 			JavaCore.setOptions(newJavaCoreOptions);
7037 
7038 			Map compilerOptions = new HashMap();
7039 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7040 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7041 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7042 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7043 			runTest(codeFormatter, "test515", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7044 		} finally {
7045 			JavaCore.setOptions(javaCoreOptions);
7046 		}
7047 	}
7048 
7049 	/**
7050 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=75720
7051 	 */
test516()7052 	public void test516() {
7053 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7054 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS, JavaCore.DO_NOT_INSERT);
7055 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS, JavaCore.DO_NOT_INSERT);
7056 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7057 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7058         preferences.tab_size = 4;
7059 		Hashtable javaCoreOptions = JavaCore.getOptions();
7060 		try {
7061 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7062 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7063 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7064 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7065 			JavaCore.setOptions(newJavaCoreOptions);
7066 
7067 			Map compilerOptions = new HashMap();
7068 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7069 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7070 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7071 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7072 			runTest(codeFormatter, "test516", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7073 		} finally {
7074 			JavaCore.setOptions(javaCoreOptions);
7075 		}
7076 	}
7077 
7078 	/**
7079 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=75720
7080 	 */
test517()7081 	public void test517() {
7082 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7083 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS, JavaCore.INSERT);
7084 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS, JavaCore.INSERT);
7085 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7086 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7087         preferences.tab_size = 4;
7088 		Hashtable javaCoreOptions = JavaCore.getOptions();
7089 		try {
7090 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7091 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7092 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7093 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7094 			JavaCore.setOptions(newJavaCoreOptions);
7095 
7096 			Map compilerOptions = new HashMap();
7097 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7098 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7099 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7100 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7101 			runTest(codeFormatter, "test517", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7102 		} finally {
7103 			JavaCore.setOptions(javaCoreOptions);
7104 		}
7105 	}
7106 
7107 	/**
7108 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=75720
7109 	 */
test518()7110 	public void test518() {
7111 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7112 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS, JavaCore.DO_NOT_INSERT);
7113 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS, JavaCore.INSERT);
7114 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7115 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7116         preferences.tab_size = 4;
7117 		Hashtable javaCoreOptions = JavaCore.getOptions();
7118 		try {
7119 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7120 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7121 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7122 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7123 			JavaCore.setOptions(newJavaCoreOptions);
7124 
7125 			Map compilerOptions = new HashMap();
7126 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7127 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7128 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7129 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7130 			runTest(codeFormatter, "test518", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7131 		} finally {
7132 			JavaCore.setOptions(javaCoreOptions);
7133 		}
7134 	}
7135 
7136 	/**
7137 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=75720
7138 	 */
test519()7139 	public void test519() {
7140 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7141 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS, JavaCore.INSERT);
7142 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS, JavaCore.DO_NOT_INSERT);
7143 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7144 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7145         preferences.tab_size = 4;
7146 		Hashtable javaCoreOptions = JavaCore.getOptions();
7147 		try {
7148 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7149 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7150 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7151 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7152 			JavaCore.setOptions(newJavaCoreOptions);
7153 
7154 			Map compilerOptions = new HashMap();
7155 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7156 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7157 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7158 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7159 			runTest(codeFormatter, "test519", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7160 		} finally {
7161 			JavaCore.setOptions(javaCoreOptions);
7162 		}
7163 	}
7164 
7165 	/**
7166 	 * Formatting enum declaration
7167 	 */
test520()7168 	public void test520() {
7169 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7170 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7171 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7172         preferences.tab_size = 4;
7173 		Hashtable javaCoreOptions = JavaCore.getOptions();
7174 		try {
7175 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7176 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7177 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7178 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7179 			JavaCore.setOptions(newJavaCoreOptions);
7180 
7181 			Map compilerOptions = new HashMap();
7182 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7183 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7184 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7185 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7186 			runTest(codeFormatter, "test520", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7187 		} finally {
7188 			JavaCore.setOptions(javaCoreOptions);
7189 		}
7190 	}
7191 
7192 	/**
7193 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=76642
7194 	 */
test521()7195 	public void test521() {
7196 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7197 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7198 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7199         preferences.tab_size = 4;
7200 		Hashtable javaCoreOptions = JavaCore.getOptions();
7201 		try {
7202 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7203 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7204 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7205 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7206 			JavaCore.setOptions(newJavaCoreOptions);
7207 
7208 			Map compilerOptions = new HashMap();
7209 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7210 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7211 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7212 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7213 			runTest(codeFormatter, "test521", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7214 		} finally {
7215 			JavaCore.setOptions(javaCoreOptions);
7216 		}
7217 	}
7218 
7219 	/**
7220 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=76642
7221 	 */
test522()7222 	public void test522() {
7223 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7224 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7225 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7226         preferences.tab_size = 4;
7227 		Hashtable javaCoreOptions = JavaCore.getOptions();
7228 		try {
7229 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7230 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7231 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7232 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7233 			JavaCore.setOptions(newJavaCoreOptions);
7234 
7235 			Map compilerOptions = new HashMap();
7236 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7237 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7238 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7239 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7240 			runTest(codeFormatter, "test522", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7241 		} finally {
7242 			JavaCore.setOptions(javaCoreOptions);
7243 		}
7244 	}
7245 
7246 	/**
7247 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=76766
7248 	 */
test523()7249 	public void test523() {
7250 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7251 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7252 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7253 		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
7254 		preferences.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
7255 		preferences.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
7256         preferences.tab_size = 4;
7257 		Hashtable javaCoreOptions = JavaCore.getOptions();
7258 		try {
7259 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7260 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7261 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7262 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7263 			JavaCore.setOptions(newJavaCoreOptions);
7264 
7265 			Map compilerOptions = new HashMap();
7266 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7267 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7268 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7269 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7270 			runTest(codeFormatter, "test523", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7271 		} finally {
7272 			JavaCore.setOptions(javaCoreOptions);
7273 		}
7274 	}
7275 
7276 	/**
7277 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=76766
7278 	 */
test524()7279 	public void test524() {
7280 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7281 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7282 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7283 		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
7284 		preferences.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
7285 		preferences.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
7286         preferences.tab_size = 4;
7287 		Hashtable javaCoreOptions = JavaCore.getOptions();
7288 		try {
7289 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7290 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7291 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7292 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7293 			JavaCore.setOptions(newJavaCoreOptions);
7294 
7295 			Map compilerOptions = new HashMap();
7296 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7297 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7298 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7299 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7300 			runTest(codeFormatter, "test524", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7301 		} finally {
7302 			JavaCore.setOptions(javaCoreOptions);
7303 		}
7304 	}
7305 
7306 	/**
7307 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=76766
7308 	 */
test525()7309 	public void test525() {
7310 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7311 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7312 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7313 		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
7314 		preferences.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
7315 		preferences.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
7316         preferences.tab_size = 4;
7317 		Hashtable javaCoreOptions = JavaCore.getOptions();
7318 		try {
7319 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7320 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7321 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7322 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7323 			JavaCore.setOptions(newJavaCoreOptions);
7324 
7325 			Map compilerOptions = new HashMap();
7326 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7327 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7328 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7329 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7330 			runTest(codeFormatter, "test525", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7331 		} finally {
7332 			JavaCore.setOptions(javaCoreOptions);
7333 		}
7334 	}
7335 
7336 	/**
7337 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=76766
7338 	 */
test526()7339 	public void test526() {
7340 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7341 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7342 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7343 		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
7344 		preferences.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
7345 		preferences.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
7346         preferences.tab_size = 4;
7347 		Hashtable javaCoreOptions = JavaCore.getOptions();
7348 		try {
7349 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7350 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7351 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7352 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7353 			JavaCore.setOptions(newJavaCoreOptions);
7354 
7355 			Map compilerOptions = new HashMap();
7356 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7357 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7358 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7359 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7360 			runTest(codeFormatter, "test526", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7361 		} finally {
7362 			JavaCore.setOptions(javaCoreOptions);
7363 		}
7364 	}
7365 
7366 	/**
7367 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=77249
7368 	 */
test527()7369 	public void test527() {
7370 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7371 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7372 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7373         preferences.tab_size = 4;
7374 		setPageWidth80(preferences);
7375 		Hashtable javaCoreOptions = JavaCore.getOptions();
7376 		try {
7377 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7378 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7379 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7380 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7381 			JavaCore.setOptions(newJavaCoreOptions);
7382 
7383 			Map compilerOptions = new HashMap();
7384 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7385 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7386 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7387 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7388 			runTest(codeFormatter, "test527", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7389 		} finally {
7390 			JavaCore.setOptions(javaCoreOptions);
7391 		}
7392 	}
test527b()7393 	public void test527b() {
7394 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7395 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7396 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7397         preferences.tab_size = 4;
7398 		preferences.alignment_for_arguments_in_annotation = Alignment.M_COMPACT_SPLIT;
7399 		setPageWidth80(preferences);
7400 		Hashtable javaCoreOptions = JavaCore.getOptions();
7401 		try {
7402 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7403 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7404 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7405 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7406 			JavaCore.setOptions(newJavaCoreOptions);
7407 
7408 			Map compilerOptions = new HashMap();
7409 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7410 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7411 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7412 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7413 			runTest(codeFormatter, "test527b", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7414 		} finally {
7415 			JavaCore.setOptions(javaCoreOptions);
7416 		}
7417 	}
7418 
7419 	/**
7420 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=79779
7421 	 */
test528()7422 	public void test528() {
7423 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7424 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7425 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7426         preferences.tab_size = 4;
7427 		Hashtable javaCoreOptions = JavaCore.getOptions();
7428 		try {
7429 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7430 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7431 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7432 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7433 			JavaCore.setOptions(newJavaCoreOptions);
7434 
7435 			Map compilerOptions = new HashMap();
7436 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7437 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7438 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7439 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7440 			runTest(codeFormatter, "test528", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7441 		} finally {
7442 			JavaCore.setOptions(javaCoreOptions);
7443 		}
7444 	}
7445 
7446 	/**
7447 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=79779
7448 	 */
test529()7449 	public void test529() {
7450 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7451 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7452 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7453         preferences.tab_size = 4;
7454 		Hashtable javaCoreOptions = JavaCore.getOptions();
7455 		try {
7456 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7457 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7458 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7459 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7460 			JavaCore.setOptions(newJavaCoreOptions);
7461 
7462 			Map compilerOptions = new HashMap();
7463 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7464 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7465 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7466 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7467 			runTest(codeFormatter, "test529", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7468 		} finally {
7469 			JavaCore.setOptions(javaCoreOptions);
7470 		}
7471 	}
7472 
7473 	/**
7474 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=79795
7475 	 */
test530()7476 	public void test530() {
7477 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7478 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7479 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7480         preferences.tab_size = 4;
7481 		Hashtable javaCoreOptions = JavaCore.getOptions();
7482 		try {
7483 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7484 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7485 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7486 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7487 			JavaCore.setOptions(newJavaCoreOptions);
7488 
7489 			Map compilerOptions = new HashMap();
7490 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7491 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7492 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7493 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7494 			runTest(codeFormatter, "test530", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7495 		} finally {
7496 			JavaCore.setOptions(javaCoreOptions);
7497 		}
7498 	}
7499 
7500 	/**
7501 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=79795
7502 	 */
test531()7503 	public void test531() {
7504 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7505 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7506 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7507         preferences.tab_size = 4;
7508 		Hashtable javaCoreOptions = JavaCore.getOptions();
7509 		try {
7510 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7511 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7512 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7513 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7514 			JavaCore.setOptions(newJavaCoreOptions);
7515 
7516 			Map compilerOptions = new HashMap();
7517 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7518 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7519 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7520 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7521 			runTest(codeFormatter, "test531", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7522 		} finally {
7523 			JavaCore.setOptions(javaCoreOptions);
7524 		}
7525 	}
7526 
7527 	/**
7528 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=79795
7529 	 */
test532()7530 	public void test532() {
7531 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7532 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7533 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7534         preferences.tab_size = 4;
7535 		Hashtable javaCoreOptions = JavaCore.getOptions();
7536 		try {
7537 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7538 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7539 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7540 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7541 			JavaCore.setOptions(newJavaCoreOptions);
7542 
7543 			Map compilerOptions = new HashMap();
7544 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7545 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7546 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7547 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7548 			runTest(codeFormatter, "test532", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7549 		} finally {
7550 			JavaCore.setOptions(javaCoreOptions);
7551 		}
7552 	}
7553 
7554 	/**
7555 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=79795
7556 	 */
test533()7557 	public void test533() {
7558 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7559 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7560 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7561         preferences.tab_size = 4;
7562 		Hashtable javaCoreOptions = JavaCore.getOptions();
7563 		try {
7564 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7565 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7566 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7567 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7568 			JavaCore.setOptions(newJavaCoreOptions);
7569 
7570 			Map compilerOptions = new HashMap();
7571 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7572 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7573 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7574 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7575 			runTest(codeFormatter, "test533", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7576 		} finally {
7577 			JavaCore.setOptions(javaCoreOptions);
7578 		}
7579 	}
7580 
7581 	/**
7582 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=78698
7583 	 */
test534()7584 	public void test534() {
7585 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7586 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7587 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7588         preferences.tab_size = 4;
7589 		Hashtable javaCoreOptions = JavaCore.getOptions();
7590 		try {
7591 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7592 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7593 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7594 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7595 			JavaCore.setOptions(newJavaCoreOptions);
7596 
7597 			Map compilerOptions = new HashMap();
7598 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7599 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7600 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7601 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7602 			runTest(codeFormatter, "test534", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7603 		} finally {
7604 			JavaCore.setOptions(javaCoreOptions);
7605 		}
7606 	}
7607 
7608 	/**
7609 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=78698
7610 	 */
test535()7611 	public void test535() {
7612 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7613 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7614 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7615         preferences.tab_size = 4;
7616 		Hashtable javaCoreOptions = JavaCore.getOptions();
7617 		try {
7618 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7619 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7620 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7621 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7622 			JavaCore.setOptions(newJavaCoreOptions);
7623 
7624 			Map compilerOptions = new HashMap();
7625 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7626 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7627 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7628 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7629 			runTest(codeFormatter, "test535", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7630 		} finally {
7631 			JavaCore.setOptions(javaCoreOptions);
7632 		}
7633 	}
7634 
7635 	/**
7636 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=78698
7637 	 */
test536()7638 	public void test536() {
7639 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7640 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7641 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7642 		preferences.insert_space_after_question_in_wilcard = true;
7643 		preferences.insert_space_before_question_in_wilcard = true;
7644         preferences.tab_size = 4;
7645 		Hashtable javaCoreOptions = JavaCore.getOptions();
7646 		try {
7647 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7648 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7649 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7650 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7651 			JavaCore.setOptions(newJavaCoreOptions);
7652 
7653 			Map compilerOptions = new HashMap();
7654 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7655 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7656 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7657 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7658 			runTest(codeFormatter, "test536", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7659 		} finally {
7660 			JavaCore.setOptions(javaCoreOptions);
7661 		}
7662 	}
7663 
7664 	/**
7665 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=78698
7666 	 */
test537()7667 	public void test537() {
7668 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7669 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7670 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7671 		preferences.insert_space_after_question_in_wilcard = true;
7672 		preferences.insert_space_before_question_in_wilcard = true;
7673         preferences.tab_size = 4;
7674 		Hashtable javaCoreOptions = JavaCore.getOptions();
7675 		try {
7676 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7677 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7678 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7679 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7680 			JavaCore.setOptions(newJavaCoreOptions);
7681 
7682 			Map compilerOptions = new HashMap();
7683 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7684 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7685 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7686 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7687 			runTest(codeFormatter, "test537", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7688 		} finally {
7689 			JavaCore.setOptions(javaCoreOptions);
7690 		}
7691 	}
7692 
7693 	/**
7694 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=83078
7695 	 */
test538()7696 	public void test538() {
7697 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getJavaConventionsSettings());
7698         preferences.tab_size = 4;
7699 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
7700 		runTest(codeFormatter,"test538", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
7701 	}
7702 
7703 	/**
7704 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=83515
7705 	 */
test539()7706 	public void test539() {
7707 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7708 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7709         preferences.tab_size = 4;
7710 		Hashtable javaCoreOptions = JavaCore.getOptions();
7711 		try {
7712 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7713 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7714 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7715 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7716 			JavaCore.setOptions(newJavaCoreOptions);
7717 
7718 			Map compilerOptions = new HashMap();
7719 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7720 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7721 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7722 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7723 			runTest(codeFormatter, "test539", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7724 		} finally {
7725 			JavaCore.setOptions(javaCoreOptions);
7726 		}
7727 	}
7728 
7729 	/**
7730 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=83515
7731 	 */
test540()7732 	public void test540() {
7733 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7734 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7735         preferences.tab_size = 4;
7736 		Hashtable javaCoreOptions = JavaCore.getOptions();
7737 		try {
7738 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7739 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7740 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7741 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7742 			JavaCore.setOptions(newJavaCoreOptions);
7743 
7744 			Map compilerOptions = new HashMap();
7745 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7746 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7747 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7748 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7749 			runTest(codeFormatter, "test540", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7750 		} finally {
7751 			JavaCore.setOptions(javaCoreOptions);
7752 		}
7753 	}
7754 
7755 	/**
7756 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=83684
7757 	 */
test541()7758 	public void test541() {
7759 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7760 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7761         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
7762         preferences.tab_size = 4;
7763 		Hashtable javaCoreOptions = JavaCore.getOptions();
7764 		try {
7765 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7766 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7767 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7768 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7769 			JavaCore.setOptions(newJavaCoreOptions);
7770 
7771 			Map compilerOptions = new HashMap();
7772 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7773 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7774 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7775 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7776 			runTest(codeFormatter, "test541", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7777 		} finally {
7778 			JavaCore.setOptions(javaCoreOptions);
7779 		}
7780 	}
7781 
test542()7782 	public void test542() {
7783 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getJavaConventionsSettings());
7784 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7785         preferences.tab_size = 4;
7786 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
7787 		runTest(codeFormatter, "test542", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
7788 	}
7789 
test543()7790 	public void test543() {
7791 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getJavaConventionsSettings());
7792         preferences.tab_size = 4;
7793         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
7794 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
7795 		runTest(codeFormatter, "test543", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
7796 	}
7797 
7798 	/**
7799 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=86410
7800 	 */
test544()7801 	public void test544() {
7802 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7803 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7804         preferences.tab_size = 4;
7805         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
7806 		preferences.insert_space_after_closing_angle_bracket_in_type_parameters = true;
7807 		preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
7808 		Hashtable javaCoreOptions = JavaCore.getOptions();
7809 		try {
7810 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7811 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7812 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7813 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7814 			JavaCore.setOptions(newJavaCoreOptions);
7815 
7816 			Map compilerOptions = new HashMap();
7817 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7818 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7819 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7820 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7821 			runTest(codeFormatter, "test544", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7822 		} finally {
7823 			JavaCore.setOptions(javaCoreOptions);
7824 		}
7825 	}
7826 
7827 	/**
7828 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=86878
7829 	 */
test545()7830 	public void test545() {
7831 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7832 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7833         preferences.tab_size = 4;
7834         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
7835 		Hashtable javaCoreOptions = JavaCore.getOptions();
7836 		try {
7837 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7838 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7839 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7840 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7841 			JavaCore.setOptions(newJavaCoreOptions);
7842 
7843 			Map compilerOptions = new HashMap();
7844 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
7845 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
7846 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
7847 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
7848 			runTest(codeFormatter, "test545", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7849 		} finally {
7850 			JavaCore.setOptions(javaCoreOptions);
7851 		}
7852 	}
7853 
7854 	/**
7855 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=86908
7856 	 */
test546()7857 	public void test546() {
7858 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7859  		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7860         preferences.tab_size = 4;
7861         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
7862 		setPageWidth80(preferences);
7863 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
7864 		runTest(codeFormatter, "test546", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7865 	}
7866 
7867 	/**
7868 	 * Add support for comment formatting
7869 	 */
test547()7870 	public void test547() {
7871 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7872 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7873         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
7874         preferences.tab_size = 4;
7875 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
7876 		runTest(codeFormatter, "test547", "A.java", CodeFormatter.K_MULTI_LINE_COMMENT, false);//$NON-NLS-1$ //$NON-NLS-2$
7877 
7878 		runTest(codeFormatter, "test547", "A.java", CodeFormatter.K_UNKNOWN, false);//$NON-NLS-1$ //$NON-NLS-2$
7879 	}
7880 
7881 	/**
7882 	 * Add support for comment formatting
7883 	 */
test548()7884 	public void test548() {
7885 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7886 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7887         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
7888         preferences.tab_size = 4;
7889 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
7890 		runTest(codeFormatter, "test548", "A.java", CodeFormatter.K_JAVA_DOC, false);//$NON-NLS-1$ //$NON-NLS-2$
7891 
7892 		runTest(codeFormatter, "test548", "A.java", CodeFormatter.K_UNKNOWN, false);//$NON-NLS-1$ //$NON-NLS-2$
7893 	}
7894 
7895 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=73104
test549()7896 	public void test549() {
7897 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7898 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7899 		preferences.tab_char = DefaultCodeFormatterOptions.MIXED;
7900 		preferences.indentation_size = 4;
7901 		preferences.tab_size = 8;
7902 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
7903 		runTest(codeFormatter, "test549", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7904 	}
7905 
7906 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=73104
test550()7907 	public void test550() {
7908 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7909 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7910 		preferences.tab_char = DefaultCodeFormatterOptions.MIXED;
7911 		preferences.indentation_size = 4;
7912 		preferences.tab_size = 8;
7913 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
7914 		runTest(codeFormatter, "test550", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7915 	}
7916 
7917 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=73104
test551()7918 	public void test551() {
7919 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7920 		options.put(
7921 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
7922 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
7923 		options.put(
7924 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION,
7925 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
7926 		assertEquals(false, DefaultCodeFormatterConstants.getForceWrapping((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION)));
7927 		assertEquals(DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.getWrappingStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION)));
7928 		assertEquals(DefaultCodeFormatterConstants.INDENT_ON_COLUMN, DefaultCodeFormatterConstants.getIndentStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION)));
7929 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7930 		preferences.tab_char = DefaultCodeFormatterOptions.MIXED;
7931 		preferences.indentation_size = 4;
7932 		preferences.tab_size = 8;
7933 		preferences.page_width = 57;
7934 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
7935 		runTest(codeFormatter, "test551", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
7936 	}
7937 
7938 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=73104
test552()7939 	public void test552() {
7940 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7941 		options.put(
7942 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
7943 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
7944 		options.put(
7945 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION,
7946 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
7947 		assertEquals(false, DefaultCodeFormatterConstants.getForceWrapping((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION)));
7948 		assertEquals(DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.getWrappingStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION)));
7949 		assertEquals(DefaultCodeFormatterConstants.INDENT_ON_COLUMN, DefaultCodeFormatterConstants.getIndentStyle((String) options.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION)));
7950 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7951 		preferences.tab_char = DefaultCodeFormatterOptions.MIXED;
7952 		preferences.indentation_size = 4;
7953 		preferences.tab_size = 8;
7954 		preferences.page_width = 57;
7955 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
7956 		runTest(codeFormatter, "test552", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
7957 	}
7958 
7959 	/**
7960 	 * Add support for comment formatting
7961 	 */
test553()7962 	public void test553() {
7963 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7964 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7965 		preferences.comment_format_line_comment_starting_on_first_column = true;
7966         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
7967         preferences.tab_size = 4;
7968 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
7969 		runTest(codeFormatter, "test553", "A.java", CodeFormatter.K_SINGLE_LINE_COMMENT, false);//$NON-NLS-1$ //$NON-NLS-2$
7970 
7971 		runTest(codeFormatter, "test553", "A.java", CodeFormatter.K_UNKNOWN, false);//$NON-NLS-1$ //$NON-NLS-2$
7972 	}
7973 
7974 	/**
7975 	 * Add support for comment formatting
7976 	 */
test554()7977 	public void test554() {
7978 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7979 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7980 		preferences.comment_format_line_comment_starting_on_first_column = true;
7981         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
7982         preferences.tab_size = 4;
7983 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
7984 		runTest(codeFormatter, "test554", "A.java", CodeFormatter.K_SINGLE_LINE_COMMENT, false);//$NON-NLS-1$ //$NON-NLS-2$
7985 
7986 		runTest(codeFormatter, "test554", "A.java", CodeFormatter.K_UNKNOWN, false);//$NON-NLS-1$ //$NON-NLS-2$
7987 	}
7988 
7989 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=73104
test555()7990 	public void test555() {
7991 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
7992 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7993 		preferences.tab_char = DefaultCodeFormatterOptions.MIXED;
7994 		preferences.indentation_size = 4;
7995 		preferences.tab_size = 8;
7996 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
7997 		runTest(codeFormatter, "test555", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
7998 	}
7999 
8000 	/*
8001 	 * Empty array initializer formatting
8002 	 */
test556()8003 	public void test556() {
8004 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
8005 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8006         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
8007         preferences.tab_size = 4;
8008 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8009 		runTest(codeFormatter, "test556", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8010 	}
8011 
8012 	/*
8013 	 * Empty array initializer formatting
8014 	 */
test557()8015 	public void test557() {
8016 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
8017 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8018 		preferences.tab_size = 4;
8019 		preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
8020 		preferences.keep_empty_array_initializer_on_one_line = true;
8021 		preferences.insert_space_between_empty_braces_in_array_initializer = true;
8022 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8023 		runTest(codeFormatter, "test557", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8024 	}
8025 
8026 	/**
8027 	 * Initial test for <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=89302">bug 89302</a>
8028 	 * This test was deprecated in order to test backward compatibility
8029 	 * after the integration of the fix for bug 122247
8030 	 * @deprecated
8031 	 * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=122247">bug 122247</a>
8032 	 */
test558()8033 	public void test558() {
8034 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
8035 
8036 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_ENUM_CONSTANT, null);
8037 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_FIELD, null);
8038 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_METHOD, null);
8039 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PACKAGE, null);
8040 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_TYPE, null);
8041 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER, null);
8042 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_LOCAL_VARIABLE, null);
8043 		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=122247: use deprecated option
8044 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION, JavaCore.DO_NOT_INSERT);
8045 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8046         preferences.tab_size = 4;
8047         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
8048 		preferences.insert_space_after_comma_in_enum_declarations = false;
8049 		Hashtable javaCoreOptions = JavaCore.getOptions();
8050 		try {
8051 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
8052 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8053 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8054 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8055 			JavaCore.setOptions(newJavaCoreOptions);
8056 
8057 			Map compilerOptions = new HashMap();
8058 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8059 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8060 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8061 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
8062 			runTest(codeFormatter, "test558", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8063 		} finally {
8064 			JavaCore.setOptions(javaCoreOptions);
8065 		}
8066 	}
8067 
8068 	/**
8069 	 * Initial test for <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=89302">bug 89302</a>
8070 	 * This test was deprecated in order to test backward compatibility
8071 	 * after the integration of the fix for bug 122247
8072 	 * @deprecated
8073 	 * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=122247">bug 122247</a>
8074 	 */
test559()8075 	public void test559() {
8076 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
8077 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_ENUM_CONSTANT, null);
8078 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_FIELD, null);
8079 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_METHOD, null);
8080 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PACKAGE, null);
8081 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_TYPE, null);
8082 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER, null);
8083 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_LOCAL_VARIABLE, null);
8084 		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=122247: use deprecated option
8085 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION, JavaCore.DO_NOT_INSERT);
8086 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8087         preferences.tab_size = 4;
8088         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
8089 		preferences.insert_space_after_comma_in_enum_declarations = true;
8090 		Hashtable javaCoreOptions = JavaCore.getOptions();
8091 		try {
8092 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
8093 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8094 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8095 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8096 			JavaCore.setOptions(newJavaCoreOptions);
8097 
8098 			Map compilerOptions = new HashMap();
8099 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8100 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8101 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8102 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
8103 			runTest(codeFormatter, "test559", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8104 		} finally {
8105 			JavaCore.setOptions(javaCoreOptions);
8106 		}
8107 	}
8108 
8109 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=81497
test560()8110 	public void test560() {
8111 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
8112 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8113         preferences.tab_size = 4;
8114         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
8115 		preferences.brace_position_for_array_initializer = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
8116 		preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
8117 		preferences.brace_position_for_method_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
8118 		preferences.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE;
8119 		preferences.keep_empty_array_initializer_on_one_line = false;
8120 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8121 		runTest(codeFormatter, "test560", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8122 	}
8123 
8124 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=81497
test561()8125 	public void test561() {
8126 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
8127 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8128         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
8129         preferences.tab_size = 4;
8130 		preferences.brace_position_for_array_initializer = DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED;
8131 		preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
8132 		preferences.brace_position_for_method_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
8133 		preferences.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE;
8134 		preferences.keep_empty_array_initializer_on_one_line = true;
8135 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8136 		runTest(codeFormatter, "test561", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8137 	}
8138 
8139 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=89318
test562()8140 	public void test562() {
8141 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
8142 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8143         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
8144         preferences.tab_size = 4;
8145 		preferences.insert_space_after_closing_angle_bracket_in_type_arguments = false;
8146 		Hashtable javaCoreOptions = JavaCore.getOptions();
8147 		try {
8148 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
8149 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8150 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8151 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8152 			JavaCore.setOptions(newJavaCoreOptions);
8153 
8154 			Map compilerOptions = new HashMap();
8155 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8156 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8157 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8158 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
8159 			runTest(codeFormatter, "test562", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS, false);//$NON-NLS-1$ //$NON-NLS-2$
8160 		} finally {
8161 			JavaCore.setOptions(javaCoreOptions);
8162 		}
8163 	}
8164 
8165 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=89318
test563()8166 	public void test563() {
8167 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
8168 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8169         preferences.tab_size = 4;
8170         preferences.tab_size = 4;
8171         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
8172 		preferences.insert_space_after_closing_angle_bracket_in_type_arguments = true;
8173 		Hashtable javaCoreOptions = JavaCore.getOptions();
8174 		try {
8175 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
8176 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8177 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8178 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8179 			JavaCore.setOptions(newJavaCoreOptions);
8180 
8181 			Map compilerOptions = new HashMap();
8182 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8183 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8184 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8185 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
8186 			runTest(codeFormatter, "test563", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS, false);//$NON-NLS-1$ //$NON-NLS-2$
8187 		} finally {
8188 			JavaCore.setOptions(javaCoreOptions);
8189 		}
8190 	}
8191 
8192 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=89299
test564()8193 	public void test564() {
8194 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
8195 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8196         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
8197         preferences.tab_size = 4;
8198 		preferences.brace_position_for_array_initializer = DefaultCodeFormatterConstants.NEXT_LINE;
8199 		preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
8200 		preferences.brace_position_for_method_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
8201 		preferences.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE;
8202 		preferences.keep_empty_array_initializer_on_one_line = false;
8203 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8204 		runTest(codeFormatter, "test564", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8205 	}
8206 
8207 	/*// https://bugs.eclipse.org/bugs/show_bug.cgi?id=49896
8208 	public void test565() {
8209 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
8210 		options.put(
8211 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION,
8212 				DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
8213 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8214 		preferences.use_tabs_only_for_leading_indentations = true;
8215 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
8216 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8217 		runTest(codeFormatter, "test565", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8218 	}*/
8219 
8220 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=73658
test566()8221 	public void test566() {
8222 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
8223 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8224         preferences.tab_size = 4;
8225         preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
8226 		preferences.brace_position_for_enum_constant = DefaultCodeFormatterConstants.NEXT_LINE;
8227 		preferences.brace_position_for_enum_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
8228 		Hashtable javaCoreOptions = JavaCore.getOptions();
8229 		try {
8230 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
8231 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8232 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8233 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8234 			JavaCore.setOptions(newJavaCoreOptions);
8235 
8236 			Map compilerOptions = new HashMap();
8237 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8238 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8239 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8240 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
8241 			runTest(codeFormatter, "test566", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8242 		} finally {
8243 			JavaCore.setOptions(javaCoreOptions);
8244 		}
8245 	}
8246 
8247 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=49896
test567()8248 	public void test567() {
8249 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8250 		options.put(
8251 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
8252 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
8253 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8254         preferences.use_tabs_only_for_leading_indentations = true;
8255         preferences.page_width = 35;
8256 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8257 		runTest(codeFormatter, "test567", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8258 	}
8259 
8260 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=49896
test568()8261 	public void test568() {
8262 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8263 		options.put(
8264 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
8265 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
8266 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8267         preferences.indentation_size = 4;
8268         preferences.tab_size = 4;
8269         preferences.tab_char = DefaultCodeFormatterOptions.MIXED;
8270 		preferences.use_tabs_only_for_leading_indentations = true;
8271         preferences.page_width = 35;
8272 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8273 		runTest(codeFormatter, "test568", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8274 	}
8275 
8276 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=49896
test569()8277 	public void test569() {
8278 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8279 		options.put(
8280 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
8281 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
8282 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8283         preferences.indentation_size = 4;
8284         preferences.tab_size = 4;
8285         preferences.tab_char = DefaultCodeFormatterOptions.TAB;
8286 		preferences.use_tabs_only_for_leading_indentations = false;
8287         preferences.page_width = 40;
8288 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8289 		runTest(codeFormatter, "test569", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8290 	}
8291 
8292 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=77809
test570()8293 	public void test570() {
8294 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8295 		options.put(
8296 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTS,
8297 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
8298 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8299 		Hashtable javaCoreOptions = JavaCore.getOptions();
8300 		try {
8301 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
8302 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8303 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8304 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8305 			JavaCore.setOptions(newJavaCoreOptions);
8306 
8307 			Map compilerOptions = new HashMap();
8308 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8309 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8310 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8311 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
8312 			runTest(codeFormatter, "test570", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8313 		} finally {
8314 			JavaCore.setOptions(javaCoreOptions);
8315 		}
8316 	}
8317 
8318 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=77809
test571()8319 	public void test571() {
8320 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8321 		options.put(
8322 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTS,
8323 				DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
8324 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8325 		Hashtable javaCoreOptions = JavaCore.getOptions();
8326 		try {
8327 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
8328 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8329 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8330 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8331 			JavaCore.setOptions(newJavaCoreOptions);
8332 
8333 			Map compilerOptions = new HashMap();
8334 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8335 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8336 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8337 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
8338 			runTest(codeFormatter, "test571", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8339 		} finally {
8340 			JavaCore.setOptions(javaCoreOptions);
8341 		}
8342 	}
8343 
8344 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90213
test572()8345 	public void test572() {
8346 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8347 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8348 		preferences.insert_space_after_opening_brace_in_array_initializer = false;
8349 		preferences.insert_space_before_closing_brace_in_array_initializer = false;
8350 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8351 		runTest(codeFormatter, "test572", "A.java", CodeFormatter.K_STATEMENTS, false);//$NON-NLS-1$ //$NON-NLS-2$
8352 	}
8353 
8354 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90213
test573()8355 	public void test573() {
8356 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8357 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8358 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8359 		runTest(codeFormatter, "test573", "A.java", CodeFormatter.K_STATEMENTS, false);//$NON-NLS-1$ //$NON-NLS-2$
8360 	}
8361 
8362 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=91238
test574()8363 	public void test574() {
8364 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8365 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8366 		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102780
8367 		preferences.comment_indent_root_tags = false;
8368 		preferences.comment_align_tags_descriptions_grouped = false;
8369  		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8370 		runTest(codeFormatter, "test574", "A.java", CodeFormatter.K_JAVA_DOC, false);//$NON-NLS-1$ //$NON-NLS-2$
8371 	}
8372 
8373 	/**
8374 	 * Initial test for <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=77809">bug 77809</a>
8375 	 * This test was deprecated in order to test backward compatibility
8376 	 * after the integration of the fix for bug 122247
8377 	 * @deprecated
8378 	 * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=122247">bug 122247</a>
8379 	 */
8380 
test575()8381 	public void test575() {
8382 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8383 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_ENUM_CONSTANT, null);
8384 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_FIELD, null);
8385 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_METHOD, null);
8386 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PACKAGE, null);
8387 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_TYPE, null);
8388 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER, null);
8389 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_LOCAL_VARIABLE, null);
8390 		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=122247: use deprecated option
8391 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION, JavaCore.INSERT);
8392 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8393 		Hashtable javaCoreOptions = JavaCore.getOptions();
8394 		try {
8395 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
8396 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8397 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8398 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8399 			JavaCore.setOptions(newJavaCoreOptions);
8400 
8401 			Map compilerOptions = new HashMap();
8402 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8403 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8404 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8405 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
8406 			runTest(codeFormatter, "test575", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8407 		} finally {
8408 			JavaCore.setOptions(javaCoreOptions);
8409 		}
8410 	}
8411 
8412 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=95431
test576()8413 	public void test576() {
8414 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8415 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8416 		Hashtable javaCoreOptions = JavaCore.getOptions();
8417 		try {
8418 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
8419 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8420 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8421 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8422 			JavaCore.setOptions(newJavaCoreOptions);
8423 
8424 			Map compilerOptions = new HashMap();
8425 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8426 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8427 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8428 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
8429 			runTest(codeFormatter, "test576", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8430 		} finally {
8431 			JavaCore.setOptions(javaCoreOptions);
8432 		}
8433 	}
8434 
8435 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=98037
test577()8436 	public void test577() {
8437 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8438 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8439 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8440 		runTest(codeFormatter, "test577", "A.java", CodeFormatter.K_UNKNOWN, false);//$NON-NLS-1$ //$NON-NLS-2$
8441 	}
8442 
8443 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=98037
test578()8444 	public void test578() {
8445 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8446 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8447 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8448 		runTest(codeFormatter, "test578", "A.java", CodeFormatter.K_UNKNOWN, false);//$NON-NLS-1$ //$NON-NLS-2$
8449 	}
8450 
8451 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=98139
test579()8452 	public void test579() {
8453 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8454 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8455 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8456 		runTest(codeFormatter, "test579", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8457 	}
8458 
8459 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=98139
test580()8460 	public void test580() {
8461 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8462 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8463 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8464 		runTest(codeFormatter, "test580", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8465 	}
8466 
8467 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=99084
test581()8468 	public void test581() {
8469 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8470 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8471 		Hashtable javaCoreOptions = JavaCore.getOptions();
8472 		try {
8473 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
8474 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8475 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8476 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8477 			JavaCore.setOptions(newJavaCoreOptions);
8478 
8479 			Map compilerOptions = new HashMap();
8480 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8481 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8482 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8483 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
8484 			runTest(codeFormatter, "test581", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8485 		} finally {
8486 			JavaCore.setOptions(javaCoreOptions);
8487 		}
8488 	}
8489 
8490 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=99084
test582()8491 	public void test582() {
8492 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8493 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8494 		preferences.insert_space_after_closing_angle_bracket_in_type_arguments = false;
8495 		Hashtable javaCoreOptions = JavaCore.getOptions();
8496 		try {
8497 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
8498 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8499 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8500 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8501 			JavaCore.setOptions(newJavaCoreOptions);
8502 
8503 			Map compilerOptions = new HashMap();
8504 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8505 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8506 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8507 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
8508 			runTest(codeFormatter, "test582", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8509 		} finally {
8510 			JavaCore.setOptions(javaCoreOptions);
8511 		}
8512 	}
8513 
8514 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=100062
test583()8515 	public void test583() {
8516 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8517 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8518 		Hashtable javaCoreOptions = JavaCore.getOptions();
8519 		try {
8520 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
8521 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8522 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8523 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8524 			JavaCore.setOptions(newJavaCoreOptions);
8525 
8526 			Map compilerOptions = new HashMap();
8527 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8528 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8529 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8530 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
8531 			runTest(codeFormatter, "test583", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8532 		} finally {
8533 			JavaCore.setOptions(javaCoreOptions);
8534 		}
8535 	}
8536 
8537 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=49896
test584()8538 	public void test584() {
8539 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8540 		options.put(DefaultCodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS, DefaultCodeFormatterConstants.TRUE);
8541 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, DefaultCodeFormatterConstants.MIXED);
8542 		options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "65");
8543 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
8544 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8545 		Hashtable javaCoreOptions = JavaCore.getOptions();
8546 		try {
8547 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
8548 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8549 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8550 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8551 			JavaCore.setOptions(newJavaCoreOptions);
8552 
8553 			Map compilerOptions = new HashMap();
8554 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8555 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8556 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8557 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
8558 			runTest(codeFormatter, "test584", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8559 		} finally {
8560 			JavaCore.setOptions(javaCoreOptions);
8561 		}
8562 	}
8563 
8564 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=49896
test585()8565 	public void test585() {
8566 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8567 		options.put(DefaultCodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS, DefaultCodeFormatterConstants.TRUE);
8568 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, DefaultCodeFormatterConstants.MIXED);
8569 		options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "80");
8570 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
8571 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8572 		Hashtable javaCoreOptions = JavaCore.getOptions();
8573 		try {
8574 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
8575 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8576 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8577 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8578 			JavaCore.setOptions(newJavaCoreOptions);
8579 
8580 			Map compilerOptions = new HashMap();
8581 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8582 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8583 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8584 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
8585 			runTest(codeFormatter, "test585", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8586 		} finally {
8587 			JavaCore.setOptions(javaCoreOptions);
8588 		}
8589 	}
8590 
8591 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=49896
test586()8592 	public void test586() {
8593 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8594 		options.put(DefaultCodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS, DefaultCodeFormatterConstants.TRUE);
8595 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
8596 		options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "65");
8597 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
8598 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8599 		Hashtable javaCoreOptions = JavaCore.getOptions();
8600 		try {
8601 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
8602 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8603 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8604 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8605 			JavaCore.setOptions(newJavaCoreOptions);
8606 
8607 			Map compilerOptions = new HashMap();
8608 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8609 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8610 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8611 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
8612 			runTest(codeFormatter, "test586", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8613 		} finally {
8614 			JavaCore.setOptions(javaCoreOptions);
8615 		}
8616 	}
8617 
8618 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=49896
test587()8619 	public void test587() {
8620 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8621 		options.put(DefaultCodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS, DefaultCodeFormatterConstants.TRUE);
8622 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
8623 		options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "80");
8624 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
8625 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8626 		Hashtable javaCoreOptions = JavaCore.getOptions();
8627 		try {
8628 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
8629 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8630 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8631 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8632 			JavaCore.setOptions(newJavaCoreOptions);
8633 
8634 			Map compilerOptions = new HashMap();
8635 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8636 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8637 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8638 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
8639 			runTest(codeFormatter, "test587", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8640 		} finally {
8641 			JavaCore.setOptions(javaCoreOptions);
8642 		}
8643 	}
8644 
8645 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=101230
test588()8646 	public void test588() {
8647 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8648 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8649 		Hashtable javaCoreOptions = JavaCore.getOptions();
8650 		try {
8651 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
8652 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8653 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8654 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8655 			JavaCore.setOptions(newJavaCoreOptions);
8656 
8657 			Map compilerOptions = new HashMap();
8658 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8659 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8660 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8661 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
8662 			runTest(codeFormatter, "test588", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8663 		} finally {
8664 			JavaCore.setOptions(javaCoreOptions);
8665 		}
8666 	}
8667 
8668 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=104796
test589()8669 	public void test589() {
8670 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8671 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8672 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8673 		runTest(codeFormatter, "test589", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8674 	}
8675 
8676 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=103706
test590()8677 	public void test590() {
8678 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8679 		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_EMPTY_LINES, DefaultCodeFormatterConstants.TRUE);
8680 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8681 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8682 		runTest(codeFormatter, "test590", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8683 	}
8684 
8685 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=103706
test591()8686 	public void test591() {
8687 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8688 		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_EMPTY_LINES, DefaultCodeFormatterConstants.FALSE);
8689 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8690 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8691 		runTest(codeFormatter, "test591", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8692 	}
8693 
8694 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=98089
test592()8695 	public void test592() {
8696 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8697 		options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION,
8698 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
8699 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_DECLARATION, JavaCore.INSERT);
8700 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_DECLARATION, JavaCore.INSERT);
8701 		options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "60");
8702 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.SPACE);
8703 		options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
8704 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
8705 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_INVOCATION, JavaCore.INSERT);
8706 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION, JavaCore.INSERT);
8707 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8708 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8709 		runTest(codeFormatter, "test592", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8710 	}
8711 
8712 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=71766
test593()8713 	public void test593() {
8714 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8715 		options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ASSIGNMENT,
8716 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
8717 		options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION,
8718 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NO_SPLIT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
8719 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8720 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8721 		runTest(codeFormatter, "test593", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8722 	}
8723 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=71766
test594()8724 	public void test594() {
8725 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8726 		options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ASSIGNMENT,
8727 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
8728 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8729 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8730 		runTest(codeFormatter, "test594", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8731 	}
8732 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=71766
test595()8733 	public void test595() {
8734 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8735 		options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ASSIGNMENT,
8736 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
8737 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8738 		setPageWidth80(preferences);
8739 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8740 		runTest(codeFormatter, "test595", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8741 	}
8742 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=71766
test596()8743 	public void test596() {
8744 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8745 		options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ASSIGNMENT,
8746 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
8747 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8748 		setPageWidth80(preferences);
8749 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8750 		runTest(codeFormatter, "test596", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8751 	}
8752 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=87193
test597()8753 	public void test597() {
8754 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8755 		options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
8756 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
8757 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, DefaultCodeFormatterConstants.MIXED);
8758 		options.put(DefaultCodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS, DefaultCodeFormatterConstants.TRUE);
8759 		options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "60");
8760 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8761 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8762 		runTest(codeFormatter, "test597", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8763 	}
8764 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=87193
test598()8765 	public void test598() {
8766 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8767 		options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
8768 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
8769 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
8770 		options.put(DefaultCodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS, DefaultCodeFormatterConstants.TRUE);
8771 		options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "60");
8772 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8773 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8774 		runTest(codeFormatter, "test598", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8775 	}
8776 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=87193
test599()8777 	public void test599() {
8778 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8779 		options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
8780 				DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
8781 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
8782 		options.put(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION, "1");
8783 		options.put(DefaultCodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS, DefaultCodeFormatterConstants.TRUE);
8784 		options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "60");
8785 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8786 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8787 		runTest(codeFormatter, "test599", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8788 	}
8789 	// test Scribe2.hasNLSTag()
test600()8790 	public void test600() {
8791 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8792 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8793 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8794 		runTest(codeFormatter, "test600", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8795 	}
8796 	// Binary expression
test601()8797 	public void test601() {
8798 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8799 		String alignment = DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT);
8800 		options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ADDITIVE_OPERATOR, alignment);
8801 		options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_MULTIPLICATIVE_OPERATOR, alignment);
8802 		options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_LOGICAL_OPERATOR, alignment);
8803 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
8804 		options.put(DefaultCodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS, DefaultCodeFormatterConstants.TRUE);
8805 		options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "60");
8806 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8807 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8808 		runTest(codeFormatter, "test601", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8809 	}
8810 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=108916
test605()8811 	public void test605() {
8812 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8813 		options.put(
8814 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTS,
8815 				DefaultCodeFormatterConstants.createAlignmentValue(
8816 						true,
8817 						DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE,
8818 						DefaultCodeFormatterConstants.INDENT_DEFAULT));
8819 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8820 		Hashtable javaCoreOptions = JavaCore.getOptions();
8821 		try {
8822 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
8823 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8824 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8825 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8826 			JavaCore.setOptions(newJavaCoreOptions);
8827 
8828 			Map compilerOptions = new HashMap();
8829 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8830 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8831 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8832 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
8833 			runTest(codeFormatter, "test605", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8834 		} finally {
8835 			JavaCore.setOptions(javaCoreOptions);
8836 		}
8837 	}
8838 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=110304
test606()8839 	public void test606() {
8840 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8841 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN, JavaCore.DO_NOT_INSERT);
8842 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8843 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8844 		runTest(codeFormatter, "test606", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8845 	}
8846 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=111270
test607()8847 	public void test607() {
8848 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8849 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8850 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8851 		runTest(codeFormatter, "test607", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8852 	}
8853 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=111270
test608()8854 	public void test608() {
8855 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8856 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8857 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8858 		runTest(codeFormatter, "test608", "A.java", CodeFormatter.K_JAVA_DOC, false);//$NON-NLS-1$ //$NON-NLS-2$
8859 	}
8860 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=116858
test609()8861 	public void test609() {
8862 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8863 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8864 		preferences.indent_switchstatements_compare_to_cases = true;
8865 		preferences.indent_switchstatements_compare_to_switch = true;
8866 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8867 		runTest(codeFormatter, "test609", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8868 	}
8869 	/**
8870 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=122914
8871 	 */
test610()8872 	public void test610() {
8873 		String resourcePath = getResource("test610", "formatter.xml");
8874 		Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "mhdk");
8875 		assertNotNull("No preferences", options);
8876 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8877 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8878 		runTest(codeFormatter, "test610", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
8879 	}
8880 
8881 	/**
8882 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=111446
8883 	 */
test611()8884 	public void test611() {
8885 		{
8886 			// only tabs, indentation size = 4, tab size = 4
8887 			Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8888 			DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8889 			preferences.tab_char = DefaultCodeFormatterOptions.TAB;
8890 			preferences.tab_size = 4;
8891 			preferences.indentation_size = 4;
8892 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8893 			assertEquals("Wrong indentation string", "\t", codeFormatter.createIndentationString(1));
8894 			assertEquals("Wrong indentation string", "\t\t", codeFormatter.createIndentationString(2));
8895 			assertEquals("Wrong indentation string", "\t\t\t", codeFormatter.createIndentationString(3));
8896 		}
8897 		{
8898 			// only tabs, indentation size = 8, tab size = 8
8899 			Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8900 			DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8901 			preferences.tab_char = DefaultCodeFormatterOptions.TAB;
8902 			preferences.tab_size = 8;
8903 			preferences.indentation_size = 8;
8904 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8905 			assertEquals("Wrong indentation string", "\t", codeFormatter.createIndentationString(1));
8906 			assertEquals("Wrong indentation string", "\t\t", codeFormatter.createIndentationString(2));
8907 			assertEquals("Wrong indentation string", "\t\t\t", codeFormatter.createIndentationString(3));
8908 		}
8909 		{
8910 			// only spaces, indentation size = 2, tab size = 4
8911 			// tab size is ignored
8912 			Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8913 			DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8914 			preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
8915 			preferences.tab_size = 4;
8916 			preferences.indentation_size = 2;
8917 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8918 			assertEquals("Wrong indentation string", "  ", codeFormatter.createIndentationString(1));
8919 			assertEquals("Wrong indentation string", "    ", codeFormatter.createIndentationString(2));
8920 			assertEquals("Wrong indentation string", "      ", codeFormatter.createIndentationString(3));
8921 		}
8922 		{
8923 			// mixed, indentation size = 4 tab size = 2
8924 			Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8925 			DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8926 			preferences.tab_char = DefaultCodeFormatterOptions.MIXED;
8927 			preferences.tab_size = 2;
8928 			preferences.indentation_size = 4;
8929 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8930 			assertEquals("Wrong indentation string", "\t\t", codeFormatter.createIndentationString(1));
8931 			assertEquals("Wrong indentation string", "\t\t\t\t", codeFormatter.createIndentationString(2));
8932 		}
8933 		{
8934 			// mixed, indentation size = 2, tab size = 4
8935 			Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8936 			DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8937 			preferences.tab_char = DefaultCodeFormatterOptions.MIXED;
8938 			preferences.tab_size = 4;
8939 			preferences.indentation_size = 2;
8940 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
8941 			assertEquals("Wrong indentation string", "  ", codeFormatter.createIndentationString(1));
8942 			assertEquals("Wrong indentation string", "\t", codeFormatter.createIndentationString(2));
8943 			assertEquals("Wrong indentation string", "\t  ", codeFormatter.createIndentationString(3));
8944 		}
8945 	}
8946 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=126625
test612()8947 	public void test612() {
8948 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8949 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8950 		preferences.indent_body_declarations_compare_to_annotation_declaration_header = false;
8951 		preferences.indent_body_declarations_compare_to_type_header = true;
8952 		preferences.keep_annotation_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
8953 		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
8954 		Hashtable javaCoreOptions = JavaCore.getOptions();
8955 		try {
8956 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
8957 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8958 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8959 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8960 			JavaCore.setOptions(newJavaCoreOptions);
8961 
8962 			Map compilerOptions = new HashMap();
8963 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8964 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8965 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8966 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
8967 			runTest(codeFormatter, "test612", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8968 		} finally {
8969 			JavaCore.setOptions(javaCoreOptions);
8970 		}
8971 	}
8972 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=126625
test613()8973 	public void test613() {
8974 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
8975 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
8976 		preferences.indent_body_declarations_compare_to_annotation_declaration_header = true;
8977 		preferences.indent_body_declarations_compare_to_type_header = false;
8978 		preferences.keep_annotation_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
8979 		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
8980 		Hashtable javaCoreOptions = JavaCore.getOptions();
8981 		try {
8982 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
8983 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8984 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8985 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8986 			JavaCore.setOptions(newJavaCoreOptions);
8987 
8988 			Map compilerOptions = new HashMap();
8989 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
8990 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
8991 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
8992 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
8993 			runTest(codeFormatter, "test613", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
8994 		} finally {
8995 			JavaCore.setOptions(javaCoreOptions);
8996 		}
8997 	}
8998 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=128848
test614()8999 	public void test614() {
9000 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9001 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9002 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9003 		runTest(codeFormatter, "test614", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
9004 	}
9005 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=128848
test615()9006 	public void test615() {
9007 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9008 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9009 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9010 		runTest(codeFormatter, "test615", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
9011 	}
9012 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=128848
test616()9013 	public void test616() {
9014 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9015 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9016 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9017 		runTest(codeFormatter, "test616", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
9018 	}
9019 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=131013
test617()9020 	public void test617() {
9021 		String resourcePath = getResource("test617", "formatter.xml");
9022 		Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "JRK");
9023 		assertNotNull("No preferences", options);
9024 		options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_STRING_CONCATENATION,
9025 				DefaultCodeFormatterConstants.createAlignmentValue(
9026 					true,
9027 					DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
9028 					DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
9029 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9030 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9031 		runTest(codeFormatter, "test617", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
9032 	}
9033 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=137224
test618()9034 	public void test618() {
9035 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9036 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9037 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9038 		runTest(codeFormatter, "test618", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
9039 	}
9040 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=137224
test619()9041 	public void test619() {
9042 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9043 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9044 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9045 		runTest(codeFormatter, "test619", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS, false);//$NON-NLS-1$ //$NON-NLS-2$
9046 	}
9047 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=139291
test620()9048 	public void test620() {
9049 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9050 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS, JavaCore.DO_NOT_INSERT);
9051 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9052 		Hashtable javaCoreOptions = JavaCore.getOptions();
9053 		try {
9054 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
9055 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
9056 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
9057 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
9058 			JavaCore.setOptions(newJavaCoreOptions);
9059 
9060 			Map compilerOptions = new HashMap();
9061 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
9062 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
9063 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
9064 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
9065 			runTest(codeFormatter, "test620", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
9066 		} finally {
9067 			JavaCore.setOptions(javaCoreOptions);
9068 		}
9069 	}
9070 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=139291
test621()9071 	public void test621() {
9072 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9073 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS, JavaCore.DO_NOT_INSERT);
9074 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9075 		Hashtable javaCoreOptions = JavaCore.getOptions();
9076 		try {
9077 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
9078 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
9079 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
9080 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
9081 			JavaCore.setOptions(newJavaCoreOptions);
9082 
9083 			Map compilerOptions = new HashMap();
9084 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
9085 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
9086 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
9087 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
9088 			runTest(codeFormatter, "test621", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
9089 		} finally {
9090 			JavaCore.setOptions(javaCoreOptions);
9091 		}
9092 	}
9093 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=148370
test622()9094 	public void test622() {
9095 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9096 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9097 		Hashtable javaCoreOptions = JavaCore.getOptions();
9098 		try {
9099 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
9100 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
9101 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
9102 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
9103 			JavaCore.setOptions(newJavaCoreOptions);
9104 
9105 			Map compilerOptions = new HashMap();
9106 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
9107 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
9108 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
9109 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
9110 			runTest(codeFormatter, "test622", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
9111 		} finally {
9112 			JavaCore.setOptions(javaCoreOptions);
9113 		}
9114 	}
9115 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=148370
test623()9116 	public void test623() {
9117 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9118 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9119 		Hashtable javaCoreOptions = JavaCore.getOptions();
9120 		try {
9121 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
9122 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
9123 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
9124 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
9125 			JavaCore.setOptions(newJavaCoreOptions);
9126 
9127 			Map compilerOptions = new HashMap();
9128 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
9129 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
9130 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
9131 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
9132 			runTest(codeFormatter, "test623", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
9133 		} finally {
9134 			JavaCore.setOptions(javaCoreOptions);
9135 		}
9136 	}
9137 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=148370
test624()9138 	public void test624() {
9139 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9140 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9141 		Hashtable javaCoreOptions = JavaCore.getOptions();
9142 		try {
9143 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
9144 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
9145 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
9146 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
9147 			JavaCore.setOptions(newJavaCoreOptions);
9148 
9149 			Map compilerOptions = new HashMap();
9150 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
9151 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
9152 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
9153 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
9154 			runTest(codeFormatter, "test624", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
9155 		} finally {
9156 			JavaCore.setOptions(javaCoreOptions);
9157 		}
9158 	}
9159 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102728
test625()9160 	public void test625() {
9161 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9162 		options.put(
9163 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_STRING_CONCATENATION,
9164 				DefaultCodeFormatterConstants.createAlignmentValue(
9165 						true,
9166 						DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
9167 						DefaultCodeFormatterConstants.INDENT_DEFAULT));
9168 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9169 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9170 		runTest(codeFormatter, "test625", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
9171 	}
9172 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=152725
test626()9173 	public void test626() {
9174 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9175 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9176 		Hashtable javaCoreOptions = JavaCore.getOptions();
9177 		try {
9178 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
9179 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6);
9180 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6);
9181 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6);
9182 			JavaCore.setOptions(newJavaCoreOptions);
9183 
9184 			Map compilerOptions = new HashMap();
9185 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6);
9186 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6);
9187 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6);
9188 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
9189 			runTest(codeFormatter, "test626", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
9190 		} finally {
9191 			JavaCore.setOptions(javaCoreOptions);
9192 		}
9193 	}
9194 
9195 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=158267
test627()9196 	public void test627() {
9197 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9198 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9199 		preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP;
9200 		Hashtable javaCoreOptions = JavaCore.getOptions();
9201 		try {
9202 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
9203 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
9204 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
9205 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
9206 			JavaCore.setOptions(newJavaCoreOptions);
9207 
9208 			Map compilerOptions = new HashMap();
9209 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
9210 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
9211 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
9212 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
9213 			runTest(codeFormatter, "test627", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
9214 		} finally {
9215 			JavaCore.setOptions(javaCoreOptions);
9216 		}
9217 	}
9218 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=158267
test628()9219 	public void test628() {
9220 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9221 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9222 		preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP;
9223 		Hashtable javaCoreOptions = JavaCore.getOptions();
9224 		try {
9225 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
9226 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
9227 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
9228 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
9229 			JavaCore.setOptions(newJavaCoreOptions);
9230 
9231 			Map compilerOptions = new HashMap();
9232 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
9233 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
9234 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
9235 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
9236 			runTest(codeFormatter, "test628", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
9237 		} finally {
9238 			JavaCore.setOptions(javaCoreOptions);
9239 		}
9240 	}
9241 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=158267
test629()9242 	public void test629() {
9243 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9244 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9245 		preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP;
9246 		Hashtable javaCoreOptions = JavaCore.getOptions();
9247 		try {
9248 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
9249 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
9250 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
9251 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
9252 			JavaCore.setOptions(newJavaCoreOptions);
9253 
9254 			Map compilerOptions = new HashMap();
9255 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
9256 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
9257 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
9258 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
9259 			runTest(codeFormatter, "test629", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
9260 		} finally {
9261 			JavaCore.setOptions(javaCoreOptions);
9262 		}
9263 	}
9264 
9265 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=158267
test630()9266 	public void test630() {
9267 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipseDefaultSettings());
9268 		preferences.insert_space_after_opening_paren_in_parenthesized_expression = true;
9269 		preferences.insert_space_before_closing_paren_in_parenthesized_expression = true;
9270 		preferences.insert_space_before_parenthesized_expression_in_throw = true;
9271 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9272 		runTest(codeFormatter, "test630", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9273 	}
9274 
9275 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=158267
test631()9276 	public void test631() {
9277 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9278 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION, JavaCore.INSERT);
9279 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_PARENTHESIZED_EXPRESSION, JavaCore.INSERT);
9280 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_THROW, JavaCore.INSERT);
9281 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9282 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9283 		runTest(codeFormatter, "test631", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9284 	}
9285 
9286 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=158267
test632()9287 	public void test632() {
9288 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9289 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION, JavaCore.INSERT);
9290 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_PARENTHESIZED_EXPRESSION, JavaCore.INSERT);
9291 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN, JavaCore.DO_NOT_INSERT);
9292 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_THROW, JavaCore.DO_NOT_INSERT);
9293 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9294 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9295 		runTest(codeFormatter, "test632", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9296 	}
9297 
9298 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=165210
test633()9299 	public void test633() {
9300 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9301 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_IMPORT_GROUPS, "3");
9302 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9303 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9304 		runTest(codeFormatter, "test633", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9305 	}
9306 
9307 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=165210
test634()9308 	public void test634() {
9309 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9310 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_IMPORT_GROUPS, "1");
9311 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9312 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9313 		runTest(codeFormatter, "test634", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9314 	}
9315 
9316 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=165210
test635()9317 	public void test635() {
9318 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9319 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_IMPORT_GROUPS, "1");
9320 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_IMPORTS, "0");
9321 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9322 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9323 		runTest(codeFormatter, "test635", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9324 	}
9325 
9326 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=165210
test636()9327 	public void test636() {
9328 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9329 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_IMPORT_GROUPS, "3");
9330 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9331 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9332 		runTest(codeFormatter, "test636", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9333 	}
9334 
9335 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=165210
test637()9336 	public void test637() {
9337 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9338 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_IMPORT_GROUPS, "2");
9339 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9340 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9341 		runTest(codeFormatter, "test637", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9342 	}
9343 
9344 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=165210
test638()9345 	public void test638() {
9346 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9347 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_IMPORT_GROUPS, "1");
9348 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9349 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9350 		runTest(codeFormatter, "test638", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9351 	}
9352 
9353 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=165210
test639()9354 	public void test639() {
9355 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9356 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_IMPORT_GROUPS, "2");
9357 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9358 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9359 		runTest(codeFormatter, "test639", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9360 	}
9361 
9362 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=165210
test640()9363 	public void test640() {
9364 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9365 		options.put(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_IMPORT_GROUPS, "1");
9366 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9367 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9368 		runTest(codeFormatter, "test640", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9369 	}
9370 
9371 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=168109
test641()9372 	public void test641() {
9373 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9374 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, DefaultCodeFormatterConstants.MIXED);
9375 		options.put(DefaultCodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS, DefaultCodeFormatterConstants.TRUE);
9376 		options.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "36");
9377 		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENTATION_SIZE, "2");
9378 		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
9379 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9380 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9381 		runTest(codeFormatter, "test641", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9382 	}
9383 
9384 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=166962
test642()9385 	public void test642() {
9386 		String resourcePath = getResource("test642", "formatter.xml");
9387 		Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "Visionnaire");
9388 		assertNotNull("No preferences", options);
9389 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9390 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9391 		runTest(codeFormatter, "test642", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
9392 	}
9393 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=171634
test643()9394 	public void test643() {
9395 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9396 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING, JavaCore.INSERT);
9397 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9398 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9399 		runTest(codeFormatter, "test643", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9400 	}
9401 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=171634
test644()9402 	public void test644() {
9403 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9404 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING, JavaCore.INSERT);
9405 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9406 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9407 		runTest(codeFormatter, "test644", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9408 	}
9409 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=171634
test645()9410 	public void test645() {
9411 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9412 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING, JavaCore.INSERT);
9413 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9414 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9415 		runTest(codeFormatter, "test645", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9416 	}
9417 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=171634
test646()9418 	public void test646() {
9419 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9420 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING, JavaCore.DO_NOT_INSERT);
9421 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9422 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9423 		runTest(codeFormatter, "test646", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9424 	}
9425 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=171634
test647()9426 	public void test647() {
9427 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9428 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING, JavaCore.DO_NOT_INSERT);
9429 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9430 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9431 		runTest(codeFormatter, "test647", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9432 	}
9433 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=171634
test648()9434 	public void test648() {
9435 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9436 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING, JavaCore.DO_NOT_INSERT);
9437 		options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "0");
9438 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9439 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9440 		runTest(codeFormatter, "test648", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9441 	}
9442 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=171634
test649()9443 	public void test649() {
9444 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9445 		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING, JavaCore.INSERT);
9446 		options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "0");
9447 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9448 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9449 		runTest(codeFormatter, "test649", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9450 	}
9451 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=172848
test650()9452 	public void test650() {
9453 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9454 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9455 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9456 		runTest(codeFormatter, "test650", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9457 	}
9458 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=172848
test651()9459 	public void test651() {
9460 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9461 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9462 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9463 		runTest(codeFormatter, "test651", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9464 	}
9465 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=172848
test652()9466 	public void test652() {
9467 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9468 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9469 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9470 		runTest(codeFormatter, "test652", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9471 	}
9472 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=172848
test653()9473 	public void test653() {
9474 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9475 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9476 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9477 		runTest(codeFormatter, "test653", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9478 	}
9479 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=172848
test654()9480 	public void test654() {
9481 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9482 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9483 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9484 		runTest(codeFormatter, "test654", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9485 	}
9486 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=172848
test655()9487 	public void test655() {
9488 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9489 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9490 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9491 		runTest(codeFormatter, "test655", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9492 	}
9493 
test656()9494 	public void test656() {
9495 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9496 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9497 		preferences.indent_empty_lines = false;
9498 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9499 		runTest(codeFormatter, "test656", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9500 	}
9501 
test657()9502 	public void test657() {
9503 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9504 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9505 		preferences.indent_empty_lines = true;
9506 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9507 		runTest(codeFormatter, "test657", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9508 	}
9509 
9510 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=20793
test658()9511 	public void test658() {
9512 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9513 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9514 		preferences.never_indent_block_comments_on_first_column = false;
9515 		preferences.never_indent_line_comments_on_first_column = false;
9516 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9517 		runTest(codeFormatter, "test658", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9518 	}
9519 
9520 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=20793
test659()9521 	public void test659() {
9522 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9523 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9524 		preferences.never_indent_block_comments_on_first_column = true;
9525 		preferences.never_indent_line_comments_on_first_column = true;
9526 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9527 		runTest(codeFormatter, "test659", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9528 	}
9529 
9530 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=20793
test660()9531 	public void test660() {
9532 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9533 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9534 		preferences.never_indent_block_comments_on_first_column = false;
9535 		preferences.never_indent_line_comments_on_first_column = true;
9536 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9537 		runTest(codeFormatter, "test660", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9538 	}
9539 
9540 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=20793
test661()9541 	public void test661() {
9542 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9543 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9544 		preferences.never_indent_block_comments_on_first_column = true;
9545 		preferences.never_indent_line_comments_on_first_column = false;
9546 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9547 		runTest(codeFormatter, "test661", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9548 	}
9549 
9550 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=20793
test662()9551 	public void test662() {
9552 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9553 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9554 		preferences.never_indent_block_comments_on_first_column = true;
9555 		preferences.never_indent_line_comments_on_first_column = true;
9556 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9557 		runTest(codeFormatter, "test662", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9558 	}
9559 
9560 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=20793
test663()9561 	public void test663() {
9562 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9563 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9564 		preferences.never_indent_block_comments_on_first_column = true;
9565 		preferences.never_indent_line_comments_on_first_column = true;
9566 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9567 		runTest(codeFormatter, "test663", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9568 	}
9569 
9570 	/**
9571 	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=79068
9572 	 */
test664()9573 	public void test664() {
9574 		Map options = DefaultCodeFormatterConstants.getEclipse21Settings();
9575 		options.put(
9576 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
9577 				DefaultCodeFormatterConstants.createAlignmentValue(
9578 						true,
9579 						DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
9580 						DefaultCodeFormatterConstants.INDENT_BY_ONE
9581 				));
9582 		options.put(
9583 				DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_STRING_CONCATENATION,
9584 				DefaultCodeFormatterConstants.createAlignmentValue(
9585 						false,
9586 						DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
9587 						DefaultCodeFormatterConstants.INDENT_BY_ONE
9588 				));
9589 		options.put(DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_STRING_CONCATENATION, DefaultCodeFormatterConstants.FALSE);
9590 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9591 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9592 		runTest(codeFormatter, "test664", "A.java", CodeFormatter.K_STATEMENTS);//$NON-NLS-1$ //$NON-NLS-2$
9593 	}
9594 
9595 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=49314
test665()9596 	public void test665() {
9597 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9598 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9599 		preferences.never_indent_block_comments_on_first_column = true;
9600 		preferences.never_indent_line_comments_on_first_column = true;
9601 		preferences.comment_format_block_comment = false;
9602 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9603 		runTest(codeFormatter, "test665", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9604 	}
9605 
9606 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=172324
test666()9607 	public void test666() {
9608 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9609 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9610 		preferences.never_indent_block_comments_on_first_column = true;
9611 		preferences.never_indent_line_comments_on_first_column = true;
9612 		preferences.comment_format_block_comment = false;
9613 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9614 		runTest(codeFormatter, "test666", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9615 	}
9616 
9617 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=192285
test667()9618 	public void test667() {
9619 		Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9620 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9621 		preferences.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP;
9622 		Hashtable javaCoreOptions = JavaCore.getOptions();
9623 		try {
9624 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
9625 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
9626 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
9627 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
9628 			JavaCore.setOptions(newJavaCoreOptions);
9629 
9630 			Map compilerOptions = new HashMap();
9631 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
9632 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
9633 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
9634 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
9635 			runTest(codeFormatter, "test667", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
9636 		} finally {
9637 			JavaCore.setOptions(javaCoreOptions);
9638 		}
9639 	}
9640 
9641 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=198362
test668()9642 	public void test668() {
9643 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9644 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9645 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9646 		runTest(codeFormatter, "test668", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9647 	}
9648 
9649 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=203020
test669()9650 	public void test669() {
9651 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9652 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9653 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9654 		runTest(codeFormatter, "test669", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9655 	}
9656 
9657 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=203020
test670()9658 	public void test670() {
9659 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9660 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9661 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9662 		runTest(codeFormatter, "test670", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9663 	}
9664 
9665 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=203304
test671()9666 	public void test671() {
9667 		/* old version
9668 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9669 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9670 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9671 		IRegion[] regions = new IRegion[] {
9672 				new Region(59, 20),
9673 				new Region(101, 20)
9674 		};
9675 		runTest(codeFormatter, "test671", "A.java", CodeFormatter.K_COMPILATION_UNIT, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
9676 		*/
9677 		String source =
9678 			"public class A {\n" +
9679 			"	public static void main(String[] args) {\n" +
9680 			"[#		int a     =     1;#]\n" +
9681 			"		int b     =     2;\n" +
9682 			"[#		int c     =     3;#]\n" +
9683 			"	}\n" +
9684 			"}\n";
9685 		formatSource(source,
9686 			"public class A {\n" +
9687 			"	public static void main(String[] args) {\n" +
9688 			"		int a = 1;\n" +
9689 			"		int b     =     2;\n" +
9690 			"		int c = 3;\n" +
9691 			"	}\n" +
9692 			"}\n",
9693 			CodeFormatter.K_COMPILATION_UNIT,
9694 			0 /*no indentation*/,
9695 			true /*repeat formatting twice*/
9696 		);
9697 	}
9698 
9699 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=203304
test672()9700 	public void test672() {
9701 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9702 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9703 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9704 		IRegion[] regions = new IRegion[] {
9705 				new Region(0, 18),
9706 				new Region(38, 18)
9707 		};
9708 		runTest(codeFormatter, "test672", "A.java", CodeFormatter.K_STATEMENTS, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
9709 	}
9710 
9711 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=203304
test673()9712 	public void test673() {
9713 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9714 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9715 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9716 		IRegion[] regions = new IRegion[] {
9717 				new Region(0, 9),
9718 				new Region(19, 19)
9719 		};
9720 		runTest(codeFormatter, "test673", "A.java", CodeFormatter.K_EXPRESSION, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
9721 	}
9722 
9723 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=203304
test674()9724 	public void test674() {
9725 		/* old version
9726 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9727 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9728 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9729 		IRegion[] regions = new IRegion[] {
9730 				new Region(44, 126),
9731 				new Region(276, 54)
9732 		};
9733 		runTest(codeFormatter, "test674", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
9734 		*/
9735 		String source =
9736 			"public class A {\n" +
9737 			"	\n" +
9738 			"	\n" +
9739 			"	private class Inner1 {[#\n" +
9740 			"	    	 \n" +
9741 			"	    	 \n" +
9742 			"	    	      void    bar () {   }\n" +
9743 			"	    	      \n" +
9744 			"	    	   void    i()\n" +
9745 			"	    	   {\n" +
9746 			"	    		   \n" +
9747 			"	    	      }\n" +
9748 			"	     #]}\n" +
9749 			"	     \n" +
9750 			"	     \n" +
9751 			"	private class Inner2 {\n" +
9752 			"	    	     void    xy()  {\n" +
9753 			"	    	    	 \n" +
9754 			"	    }\n" +
9755 			"	     }\n" +
9756 			"}\n" +
9757 			"class B {[#\n" +
9758 			"	     private      void foo() {\n" +
9759 			"	    	 \n" +
9760 			"	          }\n" +
9761 			"#]}\n";
9762 		formatSource(source,
9763 			"public class A {\n" +
9764 			"	\n" +
9765 			"	\n" +
9766 			"	private class Inner1 {\n" +
9767 			"\n" +
9768 			"		void bar() {\n" +
9769 			"		}\n" +
9770 			"\n" +
9771 			"		void i() {\n" +
9772 			"\n" +
9773 			"		}\n" +
9774 			"	}\n" +
9775 			"	     \n" +
9776 			"	     \n" +
9777 			"	private class Inner2 {\n" +
9778 			"	    	     void    xy()  {\n" +
9779 			"	    	    	 \n" +
9780 			"	    }\n" +
9781 			"	     }\n" +
9782 			"}\n" +
9783 			"class B {\n" +
9784 			"	private void foo() {\n" +
9785 			"\n" +
9786 			"	}\n" +
9787 			"}\n",
9788 			CodeFormatter.K_CLASS_BODY_DECLARATIONS,
9789 			0 /*no indentation*/,
9790 			true /*repeat formatting twice*/
9791 		);
9792 	}
9793 
9794 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=203304
9795 	// NOT_FIXED_YET: https://bugs.eclipse.org/bugs/show_bug.cgi?id=204091
_test675()9796 	public void _test675() {
9797 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9798 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9799 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9800 		IRegion[] regions = new IRegion[] {
9801 				new Region(10, 20),
9802 				new Region(50, 14),
9803 				new Region(68, 25)
9804 		};
9805 		runTest(codeFormatter, "test675", "A.java", CodeFormatter.K_MULTI_LINE_COMMENT, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
9806 	}
9807 
9808 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=203304
9809 	// NOT_FIXED_YET: https://bugs.eclipse.org/bugs/show_bug.cgi?id=204091
_test676()9810 	public void _test676() {
9811 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9812 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9813 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9814 		IRegion[] regions = new IRegion[] {
9815 				new Region(3, 16),
9816 				new Region(31, 16)
9817 		};
9818 		runTest(codeFormatter, "test676", "A.java", CodeFormatter.K_SINGLE_LINE_COMMENT, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
9819 	}
9820 
9821 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=203304
9822 	// NOT_FIXED_YET: https://bugs.eclipse.org/bugs/show_bug.cgi?id=204091
_test677()9823 	public void _test677() {
9824 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9825 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9826 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9827 		IRegion[] regions = new IRegion[] {
9828 				new Region(4, 16),
9829 				new Region(32, 16)
9830 		};
9831 		runTest(codeFormatter, "test677", "A.java", CodeFormatter.K_JAVA_DOC, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
9832 	}
9833 
9834 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=203304
test678()9835 	public void test678() {
9836 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9837 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9838 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9839 		IRegion[] regions = new IRegion[] {
9840 				new Region(59, 20),
9841 				new Region(101, 20)
9842 		};
9843 		runTest(codeFormatter, "test671", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
9844 	}
9845 
9846 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=203304
test679()9847 	public void test679() {
9848 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9849 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9850 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9851 		IRegion[] regions = new IRegion[] {
9852 				new Region(0, 18),
9853 				new Region(38, 18)
9854 		};
9855 		runTest(codeFormatter, "test672", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
9856 	}
9857 
9858 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=203304
test680()9859 	public void test680() {
9860 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9861 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9862 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9863 		IRegion[] regions = new IRegion[] {
9864 				new Region(0, 9),
9865 				new Region(19, 19)
9866 		};
9867 		runTest(codeFormatter, "test673", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
9868 	}
9869 
9870 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=203304
test681()9871 	public void test681() {
9872 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9873 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9874 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9875 		IRegion[] regions = new IRegion[] {
9876 				new Region(44, 126),
9877 				new Region(276, 54)
9878 		};
9879 		runTest(codeFormatter, "test674", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
9880 	}
9881 
9882 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=204091
9883 //
9884 //	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=203304
9885 //	public void test682() {
9886 //		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9887 //		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9888 //		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9889 //		IRegion[] regions = new IRegion[] {
9890 //				new Region(10, 20),
9891 //				new Region(50, 14),
9892 //				new Region(68, 25)
9893 //		};
9894 //		runTest(codeFormatter, "test675", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
9895 //	}
9896 //
9897 //	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=203304
9898 //	public void test683() {
9899 //		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9900 //		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9901 //		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9902 //		IRegion[] regions = new IRegion[] {
9903 //				new Region(3, 16),
9904 //				new Region(31, 16)
9905 //		};
9906 //		runTest(codeFormatter, "test676", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
9907 //	}
9908 //
9909 //	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=203304
9910 //	public void test684() {
9911 //		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9912 //		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9913 //		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9914 //		IRegion[] regions = new IRegion[] {
9915 //				new Region(4, 16),
9916 //				new Region(32, 16)
9917 //		};
9918 //		runTest(codeFormatter, "test677", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
9919 //	}
9920 
9921 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=208541
test685()9922 	public void test685() {
9923 		/* old version
9924 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9925 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9926 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9927 		IRegion[] regions = new IRegion[] {
9928 				new Region(18, 35)
9929 		};
9930 		runTest(codeFormatter, "test685", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
9931 		*/
9932 		String source =
9933 			"public class A {\n" +
9934 			" [#                       int i=1;    #]           \n" +
9935 			"}\n";
9936 		// Note that whitespaces outside the region are kept after the formatting
9937 		// This is intentional since fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=234583
9938 		// The formatter should not touch code outside the given region(s)...
9939 		formatSource(source,
9940 			"public class A {\n" +
9941 			" 	int i = 1;           \n" +
9942 			"}\n",
9943 			CodeFormatter.K_UNKNOWN,
9944 			0 /*no indentation*/,
9945 			true /*repeat formatting twice*/
9946 		);
9947 	}
9948 
9949 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=208541
test686()9950 	public void test686() {
9951 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9952 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9953 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9954 		runTest(codeFormatter, "test685", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
9955 	}
9956 
9957 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=208541
test687()9958 	public void test687() {
9959 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9960 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9961 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9962 		IRegion[] regions = new IRegion[] {
9963 				new Region(17, 25)
9964 		};
9965 		runTest(codeFormatter, "test687", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
9966 	}
9967 
9968 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=208541
test688a()9969 	public void test688a() {
9970 		/* old version
9971 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9972 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
9973 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
9974 		IRegion[] regions = new IRegion[] {
9975 				new Region(18, 48)
9976 		};
9977 		runTest(codeFormatter, "test688", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
9978 		*/
9979 		String source =
9980 			"public class A {\n" +
9981 			" [#                       int i=1;               \n" +
9982 			"}#]\n";
9983 		// Note that whitespaces outside the region are kept after the formatting
9984 		// This is intentional since fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=234583
9985 		// The formatter should not touch code outside the given region(s)...
9986 		formatSource(source,
9987 			"public class A {\n" +
9988 			" 	int i = 1;\n" +
9989 			"}\n",
9990 			CodeFormatter.K_UNKNOWN,
9991 			0 /*no indentation*/,
9992 			true /*repeat formatting twice*/
9993 		);
9994 	}
9995 
test688b()9996 	public void test688b() {
9997 		/* old version
9998 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
9999 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10000 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10001 		IRegion[] regions = new IRegion[] {
10002 				new Region(18, 49)
10003 		};
10004 		runTest(codeFormatter, "test688", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
10005 		*/
10006 		String source =
10007 			"public class A {\n" +
10008 			" [#                       int i=1;               \n" +
10009 			"}\n#]";
10010 		// Note that whitespaces outside the region are kept after the formatting
10011 		// This is intentional since fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=234583
10012 		// The formatter should not touch code outside the given region(s)...
10013 		formatSource(source,
10014 			"public class A {\n" +
10015 			" 	int i = 1;\n" +
10016 			"}\n"
10017 		);
10018 	}
10019 
10020 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=208541
test689()10021 	public void test689() {
10022 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10023 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10024 		preferences.line_separator = "\n";//$NON-NLS-1$
10025 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10026 		IRegion[] regions = new IRegion[] {
10027 				new Region(31, 23)
10028 		};
10029 		runTest(codeFormatter, "test689", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
10030 	}
10031 
10032 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=208541
test690()10033 	public void test690() {
10034 		/* old version
10035 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10036 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10037 		preferences.line_separator = "\r";//$NON-NLS-1$
10038 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10039 		IRegion[] regions = new IRegion[] {
10040 				new Region(31, 23)
10041 		};
10042 		runTest(codeFormatter, "test689", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\r");//$NON-NLS-1$ //$NON-NLS-2$
10043 		*/
10044 		this.formatterPrefs.line_separator = "\r";//$NON-NLS-1$
10045 		String source =
10046 			"package pkg1;\n" +
10047 			"public class A {\n" +
10048 			"[#        int i = 1;     #]\n" +
10049 			"\n" +
10050 			"}\n";
10051 		// Note that whitespaces outside the region are kept after the formatting
10052 		// This is intentional since fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=234583
10053 		// The formatter should not touch code outside the given region(s)...
10054 		formatSource(source,
10055 			"package pkg1;\n" +
10056 			"public class A {\n" +
10057 			"	int i = 1;\n" +
10058 			"\n" +
10059 			"}\n",
10060 			CodeFormatter.K_UNKNOWN,
10061 			0 /*no indentation*/,
10062 			true /*repeat formatting twice*/
10063 		);
10064 	}
10065 
10066 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=208541
test691()10067 	public void test691() {
10068 		/* old version
10069 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10070 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10071 		preferences.line_separator = "\r\n";//$NON-NLS-1$
10072 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10073 		IRegion[] regions = new IRegion[] {
10074 				new Region(31, 22)
10075 		};
10076 		runTest(codeFormatter, "test689", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\r\n");//$NON-NLS-1$ //$NON-NLS-2$
10077 		*/
10078 		this.formatterPrefs.line_separator = "\r\n";//$NON-NLS-1$
10079 		String source =
10080 			"package pkg1;\n" +
10081 			"public class A {\n" +
10082 			"[#        int i = 1;    #] \n" +
10083 			"\n" +
10084 			"}\n";
10085 		// Note that whitespaces outside the region are kept after the formatting
10086 		// This is intentional since fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=234583
10087 		// The formatter should not touch code outside the given region(s)...
10088 		formatSource(source,
10089 			"package pkg1;\n" +
10090 			"public class A {\n" +
10091 			"	int i = 1; \n" +
10092 			"\n" +
10093 			"}\n",
10094 			CodeFormatter.K_UNKNOWN,
10095 			0 /*no indentation*/,
10096 			true /*repeat formatting twice*/
10097 		);
10098 	}
10099 
10100 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=208541
test692()10101 	public void test692() {
10102 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10103 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10104 		preferences.page_width = 999;
10105 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10106 		IRegion[] regions = new IRegion[] {
10107 				new Region(83, 41)
10108 		};
10109 		runTest(codeFormatter, "test692", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
10110 	}
10111 
10112 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=210922
test693()10113 	public void test693() {
10114 		final class MyRegion implements IRegion {
10115 			public int getLength() {
10116 				return 0;
10117 			}
10118 			public int getOffset() {
10119 				return 0;
10120 			}
10121 		}
10122 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10123 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10124 		preferences.line_separator = "\n";//$NON-NLS-1$
10125 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10126 		IRegion[] regions = new IRegion[] {
10127 				new MyRegion()
10128 		};
10129 		runTest(codeFormatter, "test693", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
10130 	}
10131 
10132 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=213283
test694a()10133 	public void test694a() {
10134 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10135 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10136 		preferences.line_separator = "\n";//$NON-NLS-1$
10137 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10138 		IRegion[] regions = new IRegion[] {
10139 				new Region(33, 32)
10140 		};
10141 		runTest(codeFormatter, "test694", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
10142 	}
10143 
10144 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=213283
test694b()10145 	public void test694b() {
10146 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10147 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10148 		preferences.line_separator = "\n";//$NON-NLS-1$
10149 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10150 		IRegion[] regions = new IRegion[] {
10151 				new Region(33, 33)
10152 		};
10153 		runTest(codeFormatter, "test694", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
10154 	}
10155 
10156 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=213284
test695()10157 	public void test695() {
10158 		/* old version
10159 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10160 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10161 		preferences.line_separator = "\n";//$NON-NLS-1$
10162 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10163 		IRegion[] regions = new IRegion[] {
10164 				new Region(59, 1)
10165 		};
10166 		runTest(codeFormatter, "test695", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
10167 		*/
10168 		String source =
10169 			"package test1;\n" +
10170 			"public class A {\n" +
10171 			"\n" +
10172 			"        public int field;\n" +
10173 			"[#\n#]" +
10174 			"\n" +
10175 			"}\r\n";
10176 		// Note that whitespaces outside the region are kept after the formatting
10177 		// This is intentional since fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=234583
10178 		// The formatter should not touch code outside the given region(s)...
10179 		formatSource(source,
10180 			"package test1;\n" +
10181 			"public class A {\n" +
10182 			"\n" +
10183 			"        public int field;\n" +
10184 			"\n" +
10185 			"}\r\n",
10186 			CodeFormatter.K_UNKNOWN,
10187 			0 /*no indentation*/,
10188 			true /*repeat formatting twice*/
10189 		);
10190 	}
10191 
10192 	// variation on bugs 208541, 213283, 213284
test696a()10193 	public void test696a() {
10194 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10195 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10196 		preferences.line_separator = "\n";//$NON-NLS-1$
10197 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10198 		IRegion[] regions = new IRegion[] {
10199 				new Region(17, 56)
10200 		};
10201 		runTest(codeFormatter, "test696a", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
10202 	}
10203 
10204 	// variation on bugs 208541, 213283, 213284
test696b()10205 	public void test696b() {
10206 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10207 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10208 		preferences.line_separator = "\n";//$NON-NLS-1$
10209 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10210 		IRegion[] regions = new IRegion[] {
10211 				new Region(17, 57)
10212 		};
10213 		runTest(codeFormatter, "test696b", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
10214 	}
10215 
10216 	// variation on bugs 208541, 213283, 213284
test697a()10217 	public void test697a() {
10218 		/* old version
10219 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10220 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10221 		preferences.line_separator = "\n";//$NON-NLS-1$
10222 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10223 		IRegion[] regions = new IRegion[] {
10224 				new Region(17, 55) // end of line selection
10225 		};
10226 		runTest(codeFormatter, "test697", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
10227 		*/
10228 		String source =
10229 			"public class A {\n" +
10230 			"[#	\n" +
10231 			"	\n" +
10232 			"	\n" +
10233 			"                        int i = 1;               #]\n" +
10234 			"\n" +
10235 			"\n" +
10236 			"\n" +
10237 			"}\n" +
10238 			"";
10239 		// Note that whitespaces outside the region are kept after the formatting
10240 		// This is intentional since fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=234583
10241 		// The formatter should not touch code outside the given region(s)...
10242 		formatSource(source,
10243 			"public class A {\n" +
10244 			"\n" +
10245 			"	int i = 1;\n" +
10246 			"\n" +
10247 			"\n" +
10248 			"\n" +
10249 			"}\n",
10250 			CodeFormatter.K_UNKNOWN,
10251 			0 /*no indentation*/,
10252 			true /*repeat formatting twice*/
10253 		);
10254 	}
10255 
10256 	// variation on bugs 208541, 213283, 213284
test697b()10257 	public void test697b() {
10258 		/* old version
10259 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10260 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10261 		preferences.line_separator = "\n";//$NON-NLS-1$
10262 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10263 		IRegion[] regions = new IRegion[] {
10264 				new Region(17, 56) // end of line selection + 1
10265 		};
10266 		runTest(codeFormatter, "test697", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
10267 		*/
10268 		String source =
10269 			"public class A {\n" +
10270 			"[#	\n" +
10271 			"	\n" +
10272 			"	\n" +
10273 			"                        int i = 1;               \n" +
10274 			"#]\n" +
10275 			"\n" +
10276 			"\n" +
10277 			"}\n" +
10278 			"";
10279 		// Note that whitespaces outside the region are kept after the formatting
10280 		// This is intentional since fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=234583
10281 		// The formatter should not touch code outside the given region(s)...
10282 		formatSource(source,
10283 			"public class A {\n" +
10284 			"\n" +
10285 			"	int i = 1;\n" +
10286 			"\n" +
10287 			"\n" +
10288 			"}\n",
10289 			CodeFormatter.K_UNKNOWN,
10290 			0 /*no indentation*/,
10291 			true /*repeat formatting twice*/
10292 		);
10293 	}
10294 
10295 	// variation on bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=208541
10296 //	public void test698() {
10297 //		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10298 //		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10299 //		preferences.line_separator = "\n";//$NON-NLS-1$
10300 //		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10301 //		IRegion[] regions = new IRegion[] {
10302 //				new Region(17, 40) // partial line selection
10303 //		};
10304 //		runTest(codeFormatter, "test698", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
10305 //	}
10306 
10307 	// variation on bugs 208541, 213283, 213284
test699()10308 	public void test699() {
10309 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10310 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10311 		preferences.line_separator = "\n";//$NON-NLS-1$
10312 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10313 		IRegion[] regions = new IRegion[] {
10314 				new Region(0, 78) // nothing selected --> format all
10315 		};
10316 		runTest(codeFormatter, "test699", "A.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
10317 	}
10318 
10319 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=122247
test700()10320 	public void test700() {
10321 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10322 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10323 		preferences.line_separator = "\n";//$NON-NLS-1$
10324 		preferences.insert_new_line_after_annotation_on_parameter = false; // override default
10325 		setPageWidth80(preferences);
10326 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10327 		IRegion[] regions = new IRegion[] {
10328 				new Region(0, 221) // nothing selected --> format all
10329 		};
10330 		runTest(codeFormatter, "test700", "X.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
10331 	}
10332 
10333 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=122247
test701()10334 	public void test701() {
10335 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10336 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10337 		preferences.line_separator = "\n";//$NON-NLS-1$
10338 		preferences.insert_new_line_after_annotation_on_parameter = true;
10339 		setPageWidth80(preferences);
10340 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10341 		IRegion[] regions = new IRegion[] {
10342 				new Region(0, 221) // nothing selected --> format all
10343 		};
10344 		runTest(codeFormatter, "test701", "X.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
10345 	}
10346 
10347 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=122247
test702()10348 	public void test702() {
10349 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10350 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10351 		preferences.line_separator = "\n";//$NON-NLS-1$
10352 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10353 		IRegion[] regions = new IRegion[] {
10354 				new Region(0, 86) // nothing selected --> format all
10355 		};
10356 		runTest(codeFormatter, "test702", "X.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
10357 	}
10358 
10359 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=122247
test703()10360 	public void test703() {
10361 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10362 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10363 		preferences.line_separator = "\n";//$NON-NLS-1$
10364 		preferences.insert_new_line_after_annotation_on_parameter = true;
10365 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10366 		IRegion[] regions = new IRegion[] {
10367 				new Region(0, 86) // nothing selected --> format all
10368 		};
10369 		runTest(codeFormatter, "test703", "X.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
10370 	}
10371 
10372 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=122247
test704()10373 	public void test704() {
10374 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10375 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10376 		preferences.line_separator = "\n";//$NON-NLS-1$
10377 		preferences.insert_new_line_after_annotation_on_type = false;
10378 		preferences.insert_new_line_after_annotation_on_field = false;
10379 		preferences.insert_new_line_after_annotation_on_method = false;
10380 		preferences.insert_new_line_after_annotation_on_package = false;
10381 		preferences.insert_new_line_after_annotation_on_parameter = true;
10382 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10383 		IRegion[] regions = new IRegion[] {
10384 				new Region(0, 86) // nothing selected --> format all
10385 		};
10386 		runTest(codeFormatter, "test704", "X.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
10387 	}
10388 
10389 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=122247
test705()10390 	public void test705() {
10391 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10392 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10393 		preferences.line_separator = "\n";//$NON-NLS-1$
10394 		preferences.insert_new_line_after_annotation_on_type = false;
10395 		preferences.insert_new_line_after_annotation_on_field = false;
10396 		preferences.insert_new_line_after_annotation_on_method = false;
10397 		preferences.insert_new_line_after_annotation_on_package = false;
10398 		preferences.insert_new_line_after_annotation_on_parameter = false;
10399 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10400 		IRegion[] regions = new IRegion[] {
10401 				new Region(0, 86) // nothing selected --> format all
10402 		};
10403 		runTest(codeFormatter, "test705", "X.java", CodeFormatter.K_UNKNOWN, 0, false, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
10404 	}
10405 
10406 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=122247
10407 	// test706 through test712 format the same CU with different combination of annotation formatting options
test706()10408 	public void test706() {
10409 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10410 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10411 		preferences.line_separator = "\n";//$NON-NLS-1$
10412 		preferences.insert_new_line_after_annotation_on_type = false;
10413 		preferences.insert_new_line_after_annotation_on_field = false;
10414 		preferences.insert_new_line_after_annotation_on_method = false;
10415 		preferences.insert_new_line_after_annotation_on_package = false;
10416 		preferences.insert_new_line_after_annotation_on_parameter = true;
10417 		preferences.insert_new_line_after_annotation_on_local_variable = false;
10418 		Hashtable javaCoreOptions = JavaCore.getOptions();
10419 		try {
10420 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
10421 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10422 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10423 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
10424 			JavaCore.setOptions(newJavaCoreOptions);
10425 
10426 			Map compilerOptions = new HashMap();
10427 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10428 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10429 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
10430 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
10431 			runTest(codeFormatter, "test706", "X.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
10432 		} finally {
10433 			JavaCore.setOptions(javaCoreOptions);
10434 		}
10435 	}
10436 
10437 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=122247
test707()10438 	public void test707() {
10439 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10440 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10441 		preferences.insert_new_line_after_annotation_on_type = true;
10442 		preferences.insert_new_line_after_annotation_on_field = true;
10443 		preferences.insert_new_line_after_annotation_on_method = true;
10444 		preferences.insert_new_line_after_annotation_on_package = true;
10445 		preferences.insert_new_line_after_annotation_on_parameter = true;
10446 		preferences.insert_new_line_after_annotation_on_local_variable = false;
10447 		preferences.line_separator = "\n";//$NON-NLS-1$
10448 		Hashtable javaCoreOptions = JavaCore.getOptions();
10449 		try {
10450 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
10451 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10452 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10453 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
10454 			JavaCore.setOptions(newJavaCoreOptions);
10455 
10456 			Map compilerOptions = new HashMap();
10457 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10458 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10459 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
10460 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
10461 			runTest(codeFormatter, "test707", "X.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
10462 		} finally {
10463 			JavaCore.setOptions(javaCoreOptions);
10464 		}
10465 	}
10466 
10467 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=122247
test708()10468 	public void test708() {
10469 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10470 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10471 		preferences.line_separator = "\n";//$NON-NLS-1$
10472 		preferences.insert_new_line_after_annotation_on_type = true;
10473 		preferences.insert_new_line_after_annotation_on_field = true;
10474 		preferences.insert_new_line_after_annotation_on_method = true;
10475 		preferences.insert_new_line_after_annotation_on_package = true;
10476 		preferences.insert_new_line_after_annotation_on_parameter = false;
10477 		preferences.insert_new_line_after_annotation_on_local_variable = false;
10478 		setPageWidth80(preferences);
10479 		Hashtable javaCoreOptions = JavaCore.getOptions();
10480 		try {
10481 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
10482 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10483 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10484 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
10485 			JavaCore.setOptions(newJavaCoreOptions);
10486 
10487 			Map compilerOptions = new HashMap();
10488 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10489 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10490 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
10491 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
10492 			runTest(codeFormatter, "test708", "X.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
10493 		} finally {
10494 			JavaCore.setOptions(javaCoreOptions);
10495 		}
10496 	}
10497 
10498 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=122247
test709()10499 	public void test709() {
10500 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10501 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10502 		preferences.insert_new_line_after_annotation_on_type = false;
10503 		preferences.insert_new_line_after_annotation_on_field = false;
10504 		preferences.insert_new_line_after_annotation_on_method = false;
10505 		preferences.insert_new_line_after_annotation_on_package = false;
10506 		preferences.insert_new_line_after_annotation_on_parameter = false;
10507 		preferences.insert_new_line_after_annotation_on_local_variable = false;
10508 		preferences.line_separator = "\n";//$NON-NLS-1$
10509 		setPageWidth80(preferences);
10510 		Hashtable javaCoreOptions = JavaCore.getOptions();
10511 		try {
10512 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
10513 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10514 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10515 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
10516 			JavaCore.setOptions(newJavaCoreOptions);
10517 
10518 			Map compilerOptions = new HashMap();
10519 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10520 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10521 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
10522 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
10523 			runTest(codeFormatter, "test709", "X.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
10524 		} finally {
10525 			JavaCore.setOptions(javaCoreOptions);
10526 		}
10527 	}
10528 
10529 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=122247
test710()10530 	public void test710() {
10531 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10532 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10533 		preferences.insert_new_line_after_annotation_on_type = false;
10534 		preferences.insert_new_line_after_annotation_on_field = false;
10535 		preferences.insert_new_line_after_annotation_on_method = false;
10536 		preferences.insert_new_line_after_annotation_on_package = false;
10537 		preferences.insert_new_line_after_annotation_on_parameter = true;
10538 		preferences.insert_new_line_after_annotation_on_local_variable = true;
10539 		preferences.line_separator = "\n";//$NON-NLS-1$
10540 		Hashtable javaCoreOptions = JavaCore.getOptions();
10541 		try {
10542 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
10543 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10544 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10545 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
10546 			JavaCore.setOptions(newJavaCoreOptions);
10547 
10548 			Map compilerOptions = new HashMap();
10549 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10550 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10551 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
10552 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
10553 			runTest(codeFormatter, "test710", "X.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
10554 		} finally {
10555 			JavaCore.setOptions(javaCoreOptions);
10556 		}
10557 	}
10558 
10559 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=122247
test711()10560 	public void test711() {
10561 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10562 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10563 		preferences.insert_new_line_after_annotation_on_type = false;
10564 		preferences.insert_new_line_after_annotation_on_field = false;
10565 		preferences.insert_new_line_after_annotation_on_method = false;
10566 		preferences.insert_new_line_after_annotation_on_package = false;
10567 		preferences.insert_new_line_after_annotation_on_parameter = false;
10568 		preferences.insert_new_line_after_annotation_on_local_variable = true;
10569 		preferences.line_separator = "\n";//$NON-NLS-1$
10570 		setPageWidth80(preferences);
10571 		Hashtable javaCoreOptions = JavaCore.getOptions();
10572 		try {
10573 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
10574 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10575 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10576 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
10577 			JavaCore.setOptions(newJavaCoreOptions);
10578 
10579 			Map compilerOptions = new HashMap();
10580 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10581 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10582 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
10583 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
10584 			runTest(codeFormatter, "test711", "X.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
10585 		} finally {
10586 			JavaCore.setOptions(javaCoreOptions);
10587 		}
10588 	}
10589 
10590 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=122247
test712()10591 	public void test712() {
10592 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10593 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10594 		preferences.line_separator = "\n";//$NON-NLS-1$
10595 		setPageWidth80(preferences);
10596 		// use defaults
10597 		Hashtable javaCoreOptions = JavaCore.getOptions();
10598 		try {
10599 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
10600 			newJavaCoreOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10601 			newJavaCoreOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10602 			newJavaCoreOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
10603 			JavaCore.setOptions(newJavaCoreOptions);
10604 
10605 			Map compilerOptions = new HashMap();
10606 			compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10607 			compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10608 			compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
10609 			DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
10610 			runTest(codeFormatter, "test712", "X.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
10611 		} finally {
10612 			JavaCore.setOptions(javaCoreOptions);
10613 		}
10614 	}
10615 
10616 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=222182
test713()10617 	public void test713() {
10618 		String resourcePath = getResource("test713", "formatter.xml");
10619 		Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "Dani");
10620 		assertNotNull("No preferences", options);
10621 		/* old version
10622 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10623 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10624 		runTest(codeFormatter, "test713", "A.java", CodeFormatter.K_COMPILATION_UNIT, 0, false, 76, 27);//$NON-NLS-1$ //$NON-NLS-2$
10625 		*/
10626 		this.formatterPrefs = new DefaultCodeFormatterOptions(options);
10627 		String source =
10628 			"package pack;\n" +
10629 			"\n" +
10630 			"public class A {\n" +
10631 			"    /**\n" +
10632 			"         * @see A.Inner\n" +
10633 			"         */\n" +
10634 			"[#    public class Inner { }\n" +
10635 			"#]}";
10636 		formatSource(source,
10637 			"package pack;\n" +
10638 			"\n" +
10639 			"public class A {\n" +
10640 			"    /**\n" +
10641 			"         * @see A.Inner\n" +
10642 			"         */\n" +
10643 			"	public class Inner {\n" +
10644 			"	}\n" +
10645 			"}"
10646 		);
10647 	}
10648 
10649 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=102780
test714()10650 	public void test714() {
10651 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10652 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10653 		// verify that the javadoc is indented, though the formatting of javadoc comments is disabled
10654 		preferences.comment_format_javadoc_comment = false;
10655 		setPageWidth80(preferences);
10656 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10657 		runTest(codeFormatter, "test714", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
10658 	}
10659 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=244477
test715()10660 	public void test715() {
10661 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10662 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10663 		preferences.keep_empty_array_initializer_on_one_line = true;
10664 		preferences.insert_space_before_comma_in_array_initializer = false;
10665 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10666 		runTest(codeFormatter, "test715", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
10667 	}
10668 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=244477
test716()10669 	public void test716() {
10670 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10671 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10672 		preferences.keep_empty_array_initializer_on_one_line = true;
10673 		preferences.insert_space_before_comma_in_array_initializer = true;
10674 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10675 		runTest(codeFormatter, "test716", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
10676 	}
10677 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=244477
test717()10678 	public void test717() {
10679 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10680 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10681 		preferences.keep_empty_array_initializer_on_one_line = false;
10682 		preferences.insert_space_before_comma_in_array_initializer = false;
10683 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10684 		runTest(codeFormatter, "test717", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
10685 	}
10686 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=244477
test718()10687 	public void test718() {
10688 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10689 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10690 		preferences.keep_empty_array_initializer_on_one_line = false;
10691 		preferences.insert_space_before_comma_in_array_initializer = true;
10692 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10693 		runTest(codeFormatter, "test718", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
10694 	}
10695 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=250753
test719()10696 	public void test719() {
10697 		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10698 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10699 		preferences.keep_empty_array_initializer_on_one_line = false;
10700 		preferences.insert_space_between_empty_braces_in_array_initializer = true;
10701 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10702 		runTest(codeFormatter, "test719", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
10703 	}
10704 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=270983
test720()10705 public void test720() {
10706 	final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10707 	DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10708 	Map compilerOptions = new HashMap();
10709 	compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10710 	compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10711 	compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
10712 	DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
10713 	runTest(codeFormatter, "test720", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
10714 }
10715 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=270983
test721()10716 public void test721() {
10717 	final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10718 	DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10719 	Map compilerOptions = new HashMap();
10720 	compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10721 	compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10722 	compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
10723 	DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
10724 	runTest(codeFormatter, "test721", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
10725 }
10726 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=283133
test722()10727 public void test722() {
10728 	try {
10729 		assertEquals("Should be 0", 0, IndentManipulation.measureIndentUnits("", 1, 0));
10730 	} catch (IllegalArgumentException e) {
10731 		assertTrue("Should not happen", false);
10732 	}
10733 }
10734 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=284679
test723()10735 public void test723() {
10736 	final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10737 	DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10738 	Map compilerOptions = new HashMap();
10739 	compilerOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10740 	compilerOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10741 	compilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
10742 	DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, compilerOptions);
10743 	runTest(codeFormatter, "test723", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);//$NON-NLS-1$ //$NON-NLS-2$
10744 }
10745 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=150741
test724()10746 public void test724() {
10747 	this.formatterPrefs.insert_new_line_after_label = true;
10748 	String source =
10749 		"public class X {\n" +
10750 		"	public static void main(String[] args) {\n" +
10751 		"		LABEL:for (int i = 0; i < 10; i++) {\n" +
10752 		"		}\n" +
10753 		"	}\n" +
10754 		"\n" +
10755 		"}\n" +
10756 		"";
10757 	formatSource(source,
10758 		"public class X {\n" +
10759 		"	public static void main(String[] args) {\n" +
10760 		"		LABEL:\n" +
10761 		"		for (int i = 0; i < 10; i++) {\n" +
10762 		"		}\n" +
10763 		"	}\n" +
10764 		"\n" +
10765 		"}\n"
10766 	);
10767 }
10768 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=308000
test725()10769 public void test725() {
10770 	this.formatterPrefs = null;
10771 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6);
10772 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6);
10773 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6);
10774 	String source =
10775 		"@Deprecated package pack;\n" +
10776 		"public class Test {\n" +
10777 		"    @Deprecated Test(String s) {}\n" +
10778 		"    @Deprecated String label;\n" +
10779 		"    @Deprecated void foo() {}\n" +
10780 		"    @Deprecated interface I {}\n" +
10781 		"}\n";
10782 	formatSource(source,
10783 		"@Deprecated\n" +
10784 		"package pack;\n" +
10785 		"\n" +
10786 		"public class Test {\n" +
10787 		"	@Deprecated\n" +
10788 		"	Test(String s) {\n" +
10789 		"	}\n" +
10790 		"\n" +
10791 		"	@Deprecated\n" +
10792 		"	String label;\n" +
10793 		"\n" +
10794 		"	@Deprecated\n" +
10795 		"	void foo() {\n" +
10796 		"	}\n" +
10797 		"\n" +
10798 		"	@Deprecated\n" +
10799 		"	interface I {\n" +
10800 		"	}\n" +
10801 		"}\n"
10802 	);
10803 }
test726()10804 public void test726() {
10805 	this.formatterPrefs = null;
10806 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6);
10807 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6);
10808 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6);
10809 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_TYPE, DefaultCodeFormatterConstants.FALSE);
10810 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_FIELD, DefaultCodeFormatterConstants.FALSE);
10811 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_METHOD, DefaultCodeFormatterConstants.FALSE);
10812 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PACKAGE, DefaultCodeFormatterConstants.FALSE);
10813 	String source =
10814 		"@Deprecated package pack;\n" +
10815 		"public class Test {\n" +
10816 		"    @Deprecated Test(String s) {}\n" +
10817 		"    @Deprecated String label;\n" +
10818 		"    @Deprecated void foo() {}\n" +
10819 		"    @Deprecated interface I {}\n" +
10820 		"}\n";
10821 	formatSource(source,
10822 		"@Deprecated package pack;\n" +
10823 		"\n" +
10824 		"public class Test {\n" +
10825 		"	@Deprecated Test(String s) {\n" +
10826 		"	}\n" +
10827 		"\n" +
10828 		"	@Deprecated String label;\n" +
10829 		"\n" +
10830 		"	@Deprecated void foo() {\n" +
10831 		"	}\n" +
10832 		"\n" +
10833 		"	@Deprecated interface I {\n" +
10834 		"	}\n" +
10835 		"}\n"
10836 	);
10837 }
10838 /**
10839  * @deprecated Use a deprecated formatter option.
10840  */
test727()10841 public void test727() {
10842 	this.formatterPrefs = null;
10843 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6);
10844 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6);
10845 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6);
10846 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_LOCAL_VARIABLE, DefaultCodeFormatterConstants.TRUE);
10847 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_FIELD, DefaultCodeFormatterConstants.FALSE);
10848 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_METHOD, DefaultCodeFormatterConstants.FALSE);
10849 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PACKAGE, DefaultCodeFormatterConstants.FALSE);
10850 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_TYPE, DefaultCodeFormatterConstants.FALSE);
10851 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER, DefaultCodeFormatterConstants.FALSE);
10852 	String source =
10853 		"@Deprecated package pack;\n" +
10854 		"public class Test {\n" +
10855 		"    @Deprecated Test(String s) {}\n" +
10856 		"    @Deprecated String label;\n" +
10857 		"    @Deprecated void foo() {}\n" +
10858 		"    @Deprecated interface I {}\n" +
10859 		"}\n";
10860 	formatSource(source,
10861 		"@Deprecated package pack;\n" +
10862 		"\n" +
10863 		"public class Test {\n" +
10864 		"	@Deprecated Test(String s) {\n" +
10865 		"	}\n" +
10866 		"\n" +
10867 		"	@Deprecated String label;\n" +
10868 		"\n" +
10869 		"	@Deprecated void foo() {\n" +
10870 		"	}\n" +
10871 		"\n" +
10872 		"	@Deprecated interface I {\n" +
10873 		"	}\n" +
10874 		"}\n"
10875 	);
10876 }
10877 
10878 /**
10879  * @deprecated Use a deprecated formatter option.
10880  */
test728()10881 public void test728() {
10882 	this.formatterPrefs = null;
10883 	this.formatterOptions.remove(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_ENUM_CONSTANT);
10884 	this.formatterOptions.remove(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_FIELD);
10885 	this.formatterOptions.remove(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_METHOD);
10886 	this.formatterOptions.remove(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PACKAGE);
10887 	this.formatterOptions.remove(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_TYPE);
10888 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6);
10889 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6);
10890 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6);
10891 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION, DefaultCodeFormatterConstants.FALSE);
10892 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_MEMBER, JavaCore.DO_NOT_INSERT);
10893 	String source =
10894 		"@Deprecated package pack;\n" +
10895 		"public class Test {\n" +
10896 		"    @Deprecated Test(String s) {}\n" +
10897 		"    @Deprecated String label;\n" +
10898 		"    @Deprecated void foo() {}\n" +
10899 		"    @Deprecated interface I {}\n" +
10900 		"}\n";
10901 	formatSource(source,
10902 		"@Deprecated package pack;\n" +
10903 		"\n" +
10904 		"public class Test {\n" +
10905 		"	@Deprecated Test(String s) {\n" +
10906 		"	}\n" +
10907 		"\n" +
10908 		"	@Deprecated String label;\n" +
10909 		"\n" +
10910 		"	@Deprecated void foo() {\n" +
10911 		"	}\n" +
10912 		"\n" +
10913 		"	@Deprecated interface I {\n" +
10914 		"	}\n" +
10915 		"}\n"
10916 	);
10917 }
test729()10918 public void test729() {
10919 	this.formatterPrefs = null;
10920 	String profilePath = getResource("profiles", "b308000.xml");
10921 	this.formatterOptions = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(profilePath, "b308000");
10922 	assertNotNull("No preferences", this.formatterOptions);
10923 	String source =
10924 		"package p;\n" +
10925 		"\n" +
10926 		"@Deprecated public class C {\n" +
10927 		"	@Deprecated public static void main(@Deprecated String[] args) {\n" +
10928 		"		@Deprecated int i= 2;\n" +
10929 		"		System.out.println(i);\n" +
10930 		"	}\n" +
10931 		"}\n";
10932 	formatSource(source,
10933 		"package p;\n" +
10934 		"\n" +
10935 		"@Deprecated public class C {\n" +
10936 		"	@Deprecated public static void main(@Deprecated String[] args) {\n" +
10937 		"		@Deprecated\n" +
10938 		"		int i = 2;\n" +
10939 		"		System.out.println(i);\n" +
10940 		"	}\n" +
10941 		"}\n"
10942 	);
10943 }
test730()10944 public void test730() {
10945 	this.formatterPrefs = null;
10946 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10947 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10948 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
10949 	String source = "enum Fail1 {A;;{}}";
10950 	formatSource(
10951 		source,
10952 		"enum Fail1 {\n" +
10953 		"	A;\n" +
10954 		"	;\n" +
10955 		"\n" +
10956 		"	{\n" +
10957 		"	}\n" +
10958 		"}"
10959 	);
10960 }
test731()10961 public void test731() {
10962 	this.formatterPrefs = null;
10963 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10964 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10965 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
10966 	String source = "enum Fail2 {A,B;;{}}";
10967 	formatSource(
10968 		source,
10969 		"enum Fail2 {\n" +
10970 		"	A, B;\n" +
10971 		"	;\n" +
10972 		"\n" +
10973 		"	{\n" +
10974 		"	}\n" +
10975 		"}"
10976 	);
10977 }
test732()10978 public void test732() {
10979 	this.formatterPrefs = null;
10980 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10981 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10982 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
10983 	String source = "enum Fail3 {A;;public void foo() {}}";
10984 	formatSource(
10985 		source,
10986 		"enum Fail3 {\n" +
10987 		"	A;\n" +
10988 		"	;\n" +
10989 		"\n" +
10990 		"	public void foo() {\n" +
10991 		"	}\n" +
10992 		"}"
10993 	);
10994 }
test733()10995 public void test733() {
10996 	this.formatterPrefs = null;
10997 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
10998 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
10999 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
11000 	String source = "enum Fail4 {A;;public int i = 0;}";
11001 	formatSource(
11002 		source,
11003 		"enum Fail4 {\n" +
11004 		"	A;\n" +
11005 		"	;\n" +
11006 		"\n" +
11007 		"	public int i = 0;\n" +
11008 		"}"
11009 	);
11010 }
11011 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=282988
test734()11012 public void test734() {
11013 	this.formatterPrefs = null;
11014 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_PRESERVE_WHITE_SPACE_BETWEEN_CODE_AND_LINE_COMMENT, DefaultCodeFormatterConstants.TRUE);
11015 	String source =
11016 		"package p;\n" +
11017 		"\n" +
11018 		"public class Comment {\n" +
11019 		"	public static void main(String[] args) {\n" +
11020 		"		//                         internal indentation\n" +
11021 		"		int i = 1;				// tabs\n" +
11022 		"		int j = 2;              // spaces\n" +
11023 		"		int k = 3;			    // mixed tabs and spaces\n" +
11024 		"		System.out.print(i);	/* does not affect block comments */\n" +
11025 		"	}\n" +
11026 		"}\n";
11027 	formatSource(source,
11028 		"package p;\n" +
11029 		"\n" +
11030 		"public class Comment {\n" +
11031 		"	public static void main(String[] args) {\n" +
11032 		"		// internal indentation\n" +
11033 		"		int i = 1;				// tabs\n" +
11034 		"		int j = 2;              // spaces\n" +
11035 		"		int k = 3;			    // mixed tabs and spaces\n" +
11036 		"		System.out.print(i); /* does not affect block comments */\n" +
11037 		"	}\n" +
11038 		"}\n"
11039 	);
11040 }
11041 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=282988
test735()11042 public void test735() {
11043 	this.formatterPrefs = null;
11044 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_PRESERVE_WHITE_SPACE_BETWEEN_CODE_AND_LINE_COMMENT, DefaultCodeFormatterConstants.FALSE);
11045 	String source =
11046 		"package p;\n" +
11047 		"\n" +
11048 		"public class Comment {\n" +
11049 		"	public static void main(String[] args) {\n" +
11050 		"		//                         internal indentation\n" +
11051 		"		int i = 1;				// tabs\n" +
11052 		"		int j = 2;              // spaces\n" +
11053 		"		int k = 3;			    // mixed tabs and spaces\n" +
11054 		"		System.out.print(i);	/* does not affect block comments */\n" +
11055 		"	}\n" +
11056 		"}\n";
11057 	formatSource(source,
11058 		"package p;\n" +
11059 		"\n" +
11060 		"public class Comment {\n" +
11061 		"	public static void main(String[] args) {\n" +
11062 		"		// internal indentation\n" +
11063 		"		int i = 1; // tabs\n" +
11064 		"		int j = 2; // spaces\n" +
11065 		"		int k = 3; // mixed tabs and spaces\n" +
11066 		"		System.out.print(i); /* does not affect block comments */\n" +
11067 		"	}\n" +
11068 		"}\n"
11069 	);
11070 }
11071 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=282988
test736()11072 public void test736() {
11073 	this.formatterPrefs = null;
11074 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_PRESERVE_WHITE_SPACE_BETWEEN_CODE_AND_LINE_COMMENT, DefaultCodeFormatterConstants.TRUE);
11075 	String source =
11076 		"package p;\n" +
11077 		"\n" +
11078 		"public class Comment {\n" +
11079 		"	public static void main(String[] args) {\n" +
11080 		"		//                         internal indentation\n" +
11081 		"		int i = 1;// tabs\n" +
11082 		"		int j = 2;// spaces\n" +
11083 		"		int k = 3;// mixed tabs and spaces\n" +
11084 		"		System.out.print(i);	/* does not affect block comments */\n" +
11085 		"	}\n" +
11086 		"}\n";
11087 	formatSource(source,
11088 		"package p;\n" +
11089 		"\n" +
11090 		"public class Comment {\n" +
11091 		"	public static void main(String[] args) {\n" +
11092 		"		// internal indentation\n" +
11093 		"		int i = 1;// tabs\n" +
11094 		"		int j = 2;// spaces\n" +
11095 		"		int k = 3;// mixed tabs and spaces\n" +
11096 		"		System.out.print(i); /* does not affect block comments */\n" +
11097 		"	}\n" +
11098 		"}\n"
11099 	);
11100 }
11101 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=282988
test737()11102 public void test737() {
11103 	this.formatterPrefs = null;
11104 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_PRESERVE_WHITE_SPACE_BETWEEN_CODE_AND_LINE_COMMENT, DefaultCodeFormatterConstants.FALSE);
11105 	String source =
11106 		"package p;\n" +
11107 		"\n" +
11108 		"public class Comment {\n" +
11109 		"	public static void main(String[] args) {\n" +
11110 		"		//                         internal indentation\n" +
11111 		"		int i = 1;// tabs\n" +
11112 		"		int j = 2;// spaces\n" +
11113 		"		int k = 3;// mixed tabs and spaces\n" +
11114 		"		System.out.print(i);	/* does not affect block comments */\n" +
11115 		"	}\n" +
11116 		"}\n";
11117 	formatSource(source,
11118 		"package p;\n" +
11119 		"\n" +
11120 		"public class Comment {\n" +
11121 		"	public static void main(String[] args) {\n" +
11122 		"		// internal indentation\n" +
11123 		"		int i = 1;// tabs\n" +
11124 		"		int j = 2;// spaces\n" +
11125 		"		int k = 3;// mixed tabs and spaces\n" +
11126 		"		System.out.print(i); /* does not affect block comments */\n" +
11127 		"	}\n" +
11128 		"}\n"
11129 	);
11130 }
11131 // binary literals / underscores in literals / multi catch
test738()11132 public void test738() {
11133 	this.formatterPrefs = null;
11134 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11135 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11136 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11137 	String source =
11138 		"public class Test {\n" +
11139 		"	int i = 0b0001;\n" +
11140 		"	int j = 0b0_0_0_1;\n" +
11141 		"	void foo(String s) {\n" +
11142 		"		try {\n" +
11143 		"			FileReader reader = new FileReader(s);\n" +
11144 		"		} catch(FileNotFoundException | IOException | Exception e) {\n" +
11145 		"			e.printStackTrace();\n" +
11146 		"		}\n" +
11147 		"	}\n" +
11148 		"}\n";
11149 	formatSource(source,
11150 		"public class Test {\n" +
11151 		"	int i = 0b0001;\n" +
11152 		"	int j = 0b0_0_0_1;\n" +
11153 		"\n" +
11154 		"	void foo(String s) {\n" +
11155 		"		try {\n" +
11156 		"			FileReader reader = new FileReader(s);\n" +
11157 		"		} catch (FileNotFoundException | IOException | Exception e) {\n" +
11158 		"			e.printStackTrace();\n" +
11159 		"		}\n" +
11160 		"	}\n" +
11161 		"}\n"
11162 	);
11163 }
11164 //try-with-resources
test739()11165 public void test739() {
11166 	this.formatterPrefs = null;
11167 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11168 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11169 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11170 	String source =
11171 		"public class Test {\n" +
11172 		"	void foo(String s) {\n" +
11173 		"		try (FileReader reader = new FileReader(s)) {\n" +
11174 		"			reader.read();\n" +
11175 		"		} catch(IOException e) {\n" +
11176 		"			e.printStackTrace();\n" +
11177 		"		}\n" +
11178 		"	}\n" +
11179 		"}\n";
11180 	formatSource(source,
11181 		"public class Test {\n" +
11182 		"	void foo(String s) {\n" +
11183 		"		try (FileReader reader = new FileReader(s)) {\n" +
11184 		"			reader.read();\n" +
11185 		"		} catch (IOException e) {\n" +
11186 		"			e.printStackTrace();\n" +
11187 		"		}\n" +
11188 		"	}\n" +
11189 		"}\n"
11190 	);
11191 }
11192 //try-with-resources
test740()11193 public void test740() {
11194 	this.formatterPrefs = null;
11195 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11196 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11197 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11198 	String source =
11199 		"public class Test {\n" +
11200 		"	void foo(String s) {\n" +
11201 		"		try (FileReader reader = new FileReader(s)) {\n" +
11202 		"			reader.read();\n" +
11203 		"		} catch(IOException e) {\n" +
11204 		"			e.printStackTrace();\n" +
11205 		"		}\n" +
11206 		"	}\n" +
11207 		"}\n";
11208 	formatSource(source,
11209 		"public class Test {\n" +
11210 		"	void foo(String s) {\n" +
11211 		"		try (FileReader reader = new FileReader(s)) {\n" +
11212 		"			reader.read();\n" +
11213 		"		} catch (IOException e) {\n" +
11214 		"			e.printStackTrace();\n" +
11215 		"		}\n" +
11216 		"	}\n" +
11217 		"}\n"
11218 	);
11219 }
11220 //try-with-resources
test741()11221 public void test741() {
11222 	this.formatterPrefs = null;
11223 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11224 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11225 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11226 	String source =
11227 		"public class Test {\n" +
11228 		"	void foo(String s) {\n" +
11229 		"		try (FileReader reader = new FileReader(s)) {\n" +
11230 		"			reader.read();\n" +
11231 		"		} catch(IOException e) {\n" +
11232 		"			e.printStackTrace();\n" +
11233 		"		} finally {\n" +
11234 		"			System.out.println(\"finally block\");\n" +
11235 		"		}\n" +
11236 		"	}\n" +
11237 		"}\n";
11238 	formatSource(source,
11239 		"public class Test {\n" +
11240 		"	void foo(String s) {\n" +
11241 		"		try (FileReader reader = new FileReader(s)) {\n" +
11242 		"			reader.read();\n" +
11243 		"		} catch (IOException e) {\n" +
11244 		"			e.printStackTrace();\n" +
11245 		"		} finally {\n" +
11246 		"			System.out.println(\"finally block\");\n" +
11247 		"		}\n" +
11248 		"	}\n" +
11249 		"}\n"
11250 	);
11251 }
11252 //try-with-resources
test742()11253 public void test742() {
11254 	this.formatterPrefs = null;
11255 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11256 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11257 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11258 	String source =
11259 		"public class Test {\n" +
11260 		"	void foo(String s) {\n" +
11261 		"		try (FileReader reader = new FileReader(s)) {\n" +
11262 		"			reader.read();\n" +
11263 		"		} catch(FileNotFoundException | IOException | Exception e) {\n" +
11264 		"			e.printStackTrace();\n" +
11265 		"		} finally {\n" +
11266 		"			System.out.println(\"finally block\");\n" +
11267 		"		}\n" +
11268 		"	}\n" +
11269 		"}\n";
11270 	formatSource(source,
11271 		"public class Test {\n" +
11272 		"	void foo(String s) {\n" +
11273 		"		try (FileReader reader = new FileReader(s)) {\n" +
11274 		"			reader.read();\n" +
11275 		"		} catch (FileNotFoundException | IOException | Exception e) {\n" +
11276 		"			e.printStackTrace();\n" +
11277 		"		} finally {\n" +
11278 		"			System.out.println(\"finally block\");\n" +
11279 		"		}\n" +
11280 		"	}\n" +
11281 		"}\n"
11282 	);
11283 }
11284 //try-with-resources
test743()11285 public void test743() {
11286 	this.formatterPrefs = null;
11287 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11288 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11289 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11290 	String source =
11291 		"public class Test {\n" +
11292 		"	void foo(String s) {\n" +
11293 		"		try (FileReader reader = new FileReader(s);) {\n" +
11294 		"			reader.read();\n" +
11295 		"		} catch(FileNotFoundException | IOException | Exception e) {\n" +
11296 		"			e.printStackTrace();\n" +
11297 		"		} finally {\n" +
11298 		"			System.out.println(\"finally block\");\n" +
11299 		"		}\n" +
11300 		"	}\n" +
11301 		"}\n";
11302 	formatSource(source,
11303 		"public class Test {\n" +
11304 		"	void foo(String s) {\n" +
11305 		"		try (FileReader reader = new FileReader(s);) {\n" +
11306 		"			reader.read();\n" +
11307 		"		} catch (FileNotFoundException | IOException | Exception e) {\n" +
11308 		"			e.printStackTrace();\n" +
11309 		"		} finally {\n" +
11310 		"			System.out.println(\"finally block\");\n" +
11311 		"		}\n" +
11312 		"	}\n" +
11313 		"}\n"
11314 	);
11315 }
11316 //try-with-resources
test744()11317 public void test744() {
11318 	this.formatterPrefs = null;
11319 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11320 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11321 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11322 	setFormatterOptions80();
11323 	String source =
11324 		"public class Test {\n" +
11325 		"	void foo(String s) {\n" +
11326 		"		try (FileReader reader = new FileReader(s);FileReader reader2 = new FileReader(s)) {\n" +
11327 		"			reader.read();\n" +
11328 		"			reader2.read();\n" +
11329 		"		} catch(FileNotFoundException | IOException | Exception e) {\n" +
11330 		"			e.printStackTrace();\n" +
11331 		"		} finally {\n" +
11332 		"			System.out.println(\"finally block\");\n" +
11333 		"		}\n" +
11334 		"	}\n" +
11335 		"}\n";
11336 	formatSource(source,
11337 		"public class Test {\n" +
11338 		"	void foo(String s) {\n" +
11339 		"		try (FileReader reader = new FileReader(s);\n" +
11340 		"				FileReader reader2 = new FileReader(s)) {\n" +
11341 		"			reader.read();\n" +
11342 		"			reader2.read();\n" +
11343 		"		} catch (FileNotFoundException | IOException | Exception e) {\n" +
11344 		"			e.printStackTrace();\n" +
11345 		"		} finally {\n" +
11346 		"			System.out.println(\"finally block\");\n" +
11347 		"		}\n" +
11348 		"	}\n" +
11349 		"}\n"
11350 	);
11351 }
11352 //try-with-resources
test745()11353 public void test745() {
11354 	this.formatterPrefs = null;
11355 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11356 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11357 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11358 	setFormatterOptions80();
11359 	String source =
11360 		"public class Test {\n" +
11361 		"	void foo(String s) {\n" +
11362 		"		try (FileReader reader = new FileReader(s);FileReader reader2 = new FileReader(s);) {\n" +
11363 		"			reader.read();\n" +
11364 		"			reader2.read();\n" +
11365 		"		} catch(FileNotFoundException | IOException | Exception e) {\n" +
11366 		"			e.printStackTrace();\n" +
11367 		"		} finally {\n" +
11368 		"			System.out.println(\"finally block\");\n" +
11369 		"		}\n" +
11370 		"	}\n" +
11371 		"}\n";
11372 	formatSource(source,
11373 		"public class Test {\n" +
11374 		"	void foo(String s) {\n" +
11375 		"		try (FileReader reader = new FileReader(s);\n" +
11376 		"				FileReader reader2 = new FileReader(s);) {\n" +
11377 		"			reader.read();\n" +
11378 		"			reader2.read();\n" +
11379 		"		} catch (FileNotFoundException | IOException | Exception e) {\n" +
11380 		"			e.printStackTrace();\n" +
11381 		"		} finally {\n" +
11382 		"			System.out.println(\"finally block\");\n" +
11383 		"		}\n" +
11384 		"	}\n" +
11385 		"}\n"
11386 	);
11387 }
11388 //diamond
test746()11389 public void test746() {
11390 	this.formatterPrefs = null;
11391 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11392 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11393 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11394 	String source =
11395 		"public class Test {\n" +
11396 		"	List foo(String s) {\n" +
11397 		"		List<String> l = new ArrayList<>();\n" +
11398 		"		l.add(s);\n" +
11399 		"		return l;\n" +
11400 		"	}\n" +
11401 		"}\n";
11402 	formatSource(source,
11403 		"public class Test {\n" +
11404 		"	List foo(String s) {\n" +
11405 		"		List<String> l = new ArrayList<>();\n" +
11406 		"		l.add(s);\n" +
11407 		"		return l;\n" +
11408 		"	}\n" +
11409 		"}\n"
11410 	);
11411 }
11412 //diamond
test747()11413 public void test747() {
11414 	this.formatterPrefs = null;
11415 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11416 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11417 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11418 	String source =
11419 		"public class Test {\n" +
11420 		"	List foo(String s) {\n" +
11421 		"		List<String> l = new java.util.ArrayList<>();\n" +
11422 		"		l.add(s);\n" +
11423 		"		return l;\n" +
11424 		"	}\n" +
11425 		"}\n";
11426 	formatSource(source,
11427 		"public class Test {\n" +
11428 		"	List foo(String s) {\n" +
11429 		"		List<String> l = new java.util.ArrayList<>();\n" +
11430 		"		l.add(s);\n" +
11431 		"		return l;\n" +
11432 		"	}\n" +
11433 		"}\n"
11434 	);
11435 }
11436 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=335309
test748()11437 public void test748() {
11438 	final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
11439 	DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
11440 	DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
11441 	IRegion[] regions = new IRegion[] {
11442 			new Region(705, 0)
11443 	};
11444 	runTest(codeFormatter, "test748", "RecipeDocumentProvider.java", CodeFormatter.K_COMPILATION_UNIT, 0, true, regions, "\n");//$NON-NLS-1$ //$NON-NLS-2$
11445 }
11446 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349008
test749()11447 public void test749() throws Exception {
11448 	this.formatterPrefs = null;
11449 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11450 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11451 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11452 	String source =
11453 		"package test;\n" +
11454 		"\n" +
11455 		"public class FormatterError {\n" +
11456 		"	public void storeSomething(String s) throws Exception {\n" +
11457 		"		try (FileReader fis = new FileReader(s); FileReader fis2 = new FileReader(s); FileReader fis3 = new FileReader(s)) {\n" +
11458 		"	}\n" +
11459 		"	}\n" +
11460 		"}\n";
11461 	formatSource(source,
11462 		"package test;\n" +
11463 		"\n" +
11464 		"public class FormatterError {\n" +
11465 		"	public void storeSomething(String s) throws Exception {\n" +
11466 		"		try (FileReader fis = new FileReader(s);\n" +
11467 		"				FileReader fis2 = new FileReader(s);\n" +
11468 		"				FileReader fis3 = new FileReader(s)) {\n" +
11469 		"		}\n" +
11470 		"	}\n" +
11471 		"}\n"
11472 	);
11473 }
11474 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349396
11475 // To verify that the whitespace options for resources in try statement work correctly
test750()11476 public void test750() throws Exception {
11477 	this.formatterPrefs = null;
11478 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11479 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11480 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11481 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_TRY, JavaCore.DO_NOT_INSERT);
11482 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_TRY, JavaCore.INSERT);
11483 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_TRY, JavaCore.INSERT);
11484 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_TRY_RESOURCES, JavaCore.INSERT);
11485 	String source =
11486 		"package test;\n" +
11487 		"\n" +
11488 		"public class FormatterError {\n" +
11489 		"	public void storeSomething(String s) throws Exception {\n" +
11490 		"		try(          FileReader fis = new FileReader(s);FileReader fis2 = new FileReader(s); FileReader fis3 = new FileReader(s);) {\n" +
11491 		"	}\n" +
11492 		"	}\n" +
11493 		"}\n";
11494 	formatSource(source,
11495 		"package test;\n" +
11496 		"\n" +
11497 		"public class FormatterError {\n" +
11498 		"	public void storeSomething(String s) throws Exception {\n" +
11499 		"		try( FileReader fis = new FileReader(s) ;\n" +
11500 		"				FileReader fis2 = new FileReader(s) ;\n" +
11501 		"				FileReader fis3 = new FileReader(s) ; ) {\n" +
11502 		"		}\n" +
11503 		"	}\n" +
11504 		"}\n"
11505 	);
11506 }
11507 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349396
11508 // To check behavior with different line wrapping and indentation policies.
test751()11509 public void test751() throws Exception {
11510 	this.formatterPrefs = null;
11511 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11512 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11513 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11514 	this.formatterOptions.put(
11515 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_RESOURCES_IN_TRY,
11516 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NO_SPLIT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
11517 	setFormatterOptions80();
11518 	String source =
11519 			"package test;\n" +
11520 			"\n" +
11521 			"public class FormatterError {\n" +
11522 			"	public void storeSomething(String s) throws Exception {\n" +
11523 			"		try(          FileReader fis = new FileReader(s);FileReader fis2 = new FileReader(s); FileReader fis3 = new FileReader(s);) {\n" +
11524 			"	}\n" +
11525 			"	}\n" +
11526 			"}\n";
11527 	formatSource(source,
11528 			"package test;\n" +
11529 			"\n" +
11530 			"public class FormatterError {\n" +
11531 			"	public void storeSomething(String s) throws Exception {\n" +
11532 			"		try (FileReader fis = new FileReader(\n" +
11533 			"				s); FileReader fis2 = new FileReader(\n" +
11534 			"						s); FileReader fis3 = new FileReader(s);) {\n" +
11535 			"		}\n" +
11536 			"	}\n" +
11537 			"}\n"
11538 	);
11539 }
11540 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349396
11541 // To check behavior with different line wrapping and indentation policies.
test752()11542 public void test752() throws Exception {
11543 	this.formatterPrefs = null;
11544 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11545 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11546 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11547 	this.formatterOptions.put(
11548 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_RESOURCES_IN_TRY,
11549 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
11550 	String source =
11551 		"package test;\n" +
11552 		"\n" +
11553 		"public class FormatterError {\n" +
11554 		"	public void storeSomething(String s) throws Exception {\n" +
11555 		"		try(          FileReader fis = new FileReader(s);FileReader fis2 = new FileReader(s); FileReader fis3 = new FileReader(s);) {\n" +
11556 		"	}\n" +
11557 		"	}\n" +
11558 		"}\n";
11559 	formatSource(source,
11560 		"package test;\n" +
11561 		"\n" +
11562 		"public class FormatterError {\n" +
11563 		"	public void storeSomething(String s) throws Exception {\n" +
11564 		"		try (	FileReader fis = new FileReader(s);\n" +
11565 		"				FileReader fis2 = new FileReader(s);\n" +
11566 		"				FileReader fis3 = new FileReader(s);) {\n" +
11567 		"		}\n" +
11568 		"	}\n" +
11569 		"}\n"
11570 	);
11571 }
11572 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349396
11573 // To check behavior with different line wrapping and indentation policies.
test753()11574 public void test753() throws Exception {
11575 	this.formatterPrefs = null;
11576 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11577 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11578 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11579 	this.formatterOptions.put(
11580 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_RESOURCES_IN_TRY,
11581 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_BY_ONE));
11582 	String source =
11583 		"package test;\n" +
11584 		"\n" +
11585 		"public class FormatterError {\n" +
11586 		"	public void storeSomething(String s) throws Exception {\n" +
11587 		"		try(          FileReader fis = new FileReader(s);FileReader fis2 = new FileReader(s); FileReader fis3 = new FileReader(s);) {\n" +
11588 		"	}\n" +
11589 		"	}\n" +
11590 		"}\n";
11591 	formatSource(source,
11592 		"package test;\n" +
11593 		"\n" +
11594 		"public class FormatterError {\n" +
11595 		"	public void storeSomething(String s) throws Exception {\n" +
11596 		"		try (FileReader fis = new FileReader(s);\n" +
11597 		"			FileReader fis2 = new FileReader(s);\n" +
11598 		"			FileReader fis3 = new FileReader(s);) {\n" +
11599 		"		}\n" +
11600 		"	}\n" +
11601 		"}\n"
11602 	);
11603 }
11604 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349396
11605 // To check behavior with different line wrapping and indentation policies.
test754()11606 public void test754() throws Exception {
11607 	this.formatterPrefs = null;
11608 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11609 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11610 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11611 	this.formatterOptions.put(
11612 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_RESOURCES_IN_TRY,
11613 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
11614 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "120");
11615 	String source =
11616 		"package test;\n" +
11617 		"\n" +
11618 		"public class FormatterError {\n" +
11619 		"	public void storeSomething(String s) throws Exception {\n" +
11620 		"		try(          FileReader fis = new FileReader(s);FileReader fis2 = new FileReader(s); FileReader fis3 = new FileReader(s);) {\n" +
11621 		"	}\n" +
11622 		"	}\n" +
11623 		"}\n";
11624 	formatSource(source,
11625 		"package test;\n" +
11626 		"\n" +
11627 		"public class FormatterError {\n" +
11628 		"	public void storeSomething(String s) throws Exception {\n" +
11629 		"		try (FileReader fis = new FileReader(s); FileReader fis2 = new FileReader(s);\n" +
11630 		"				FileReader fis3 = new FileReader(s);) {\n" +
11631 		"		}\n" +
11632 		"	}\n" +
11633 		"}\n"
11634 	);
11635 }
11636 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349396
11637 // To check behavior with different line wrapping and indentation policies.
test755()11638 public void test755() throws Exception {
11639 	this.formatterPrefs = null;
11640 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11641 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11642 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11643 	this.formatterOptions.put(
11644 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_RESOURCES_IN_TRY,
11645 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
11646 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "120");
11647 	String source =
11648 		"package test;\n" +
11649 		"\n" +
11650 		"public class FormatterError {\n" +
11651 		"	public void storeSomething(String s) throws Exception {\n" +
11652 		"		try(          FileReader fis = new FileReader(s);FileReader fis2 = new FileReader(s); FileReader fis3 = new FileReader(s);) {\n" +
11653 		"	}\n" +
11654 		"	}\n" +
11655 		"}\n";
11656 	formatSource(source,
11657 		"package test;\n" +
11658 		"\n" +
11659 		"public class FormatterError {\n" +
11660 		"	public void storeSomething(String s) throws Exception {\n" +
11661 		"		try (	FileReader fis = new FileReader(s); FileReader fis2 = new FileReader(s);\n" +
11662 		"				FileReader fis3 = new FileReader(s);) {\n" +
11663 		"		}\n" +
11664 		"	}\n" +
11665 		"}\n"
11666 	);
11667 }
11668 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349396
11669 // To check behavior with different line wrapping and indentation policies.
test756()11670 public void test756() throws Exception {
11671 	this.formatterPrefs = null;
11672 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11673 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11674 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11675 	this.formatterOptions.put(
11676 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_RESOURCES_IN_TRY,
11677 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_BY_ONE));
11678 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "120");
11679 	String source =
11680 		"package test;\n" +
11681 		"\n" +
11682 		"public class FormatterError {\n" +
11683 		"	public void storeSomething(String s) throws Exception {\n" +
11684 		"		try(          FileReader fis = new FileReader(s);FileReader fis2 = new FileReader(s); FileReader fis3 = new FileReader(s);) {\n" +
11685 		"	}\n" +
11686 		"	}\n" +
11687 		"}\n";
11688 	formatSource(source,
11689 		"package test;\n" +
11690 		"\n" +
11691 		"public class FormatterError {\n" +
11692 		"	public void storeSomething(String s) throws Exception {\n" +
11693 		"		try (FileReader fis = new FileReader(s); FileReader fis2 = new FileReader(s);\n" +
11694 		"			FileReader fis3 = new FileReader(s);) {\n" +
11695 		"		}\n" +
11696 		"	}\n" +
11697 		"}\n"
11698 	);
11699 }
11700 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349396
11701 // To check behavior with different line wrapping and indentation policies.
test757()11702 public void test757() throws Exception {
11703 	this.formatterPrefs = null;
11704 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11705 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11706 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11707 	this.formatterOptions.put(
11708 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_RESOURCES_IN_TRY,
11709 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT_FIRST_BREAK, DefaultCodeFormatterConstants.INDENT_DEFAULT));
11710 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "120");
11711 	String source =
11712 		"package test;\n" +
11713 		"\n" +
11714 		"public class FormatterError {\n" +
11715 		"	public void storeSomething(String s) throws Exception {\n" +
11716 		"		try(          FileReader fis = new FileReader(s);FileReader fis2 = new FileReader(s); FileReader fis3 = new FileReader(s);) {\n" +
11717 		"	}\n" +
11718 		"	}\n" +
11719 		"}\n";
11720 	formatSource(source,
11721 		"package test;\n" +
11722 		"\n" +
11723 		"public class FormatterError {\n" +
11724 		"	public void storeSomething(String s) throws Exception {\n" +
11725 		"		try (\n" +
11726 		"				FileReader fis = new FileReader(s); FileReader fis2 = new FileReader(s);\n" +
11727 		"				FileReader fis3 = new FileReader(s);) {\n" +
11728 		"		}\n" +
11729 		"	}\n" +
11730 		"}\n"
11731 	);
11732 }
11733 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349396
11734 // To check behavior with different line wrapping and indentation policies.
test758()11735 public void test758() throws Exception {
11736 	this.formatterPrefs = null;
11737 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11738 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11739 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11740 	this.formatterOptions.put(
11741 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_RESOURCES_IN_TRY,
11742 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT_FIRST_BREAK, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
11743 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "120");
11744 	String source =
11745 		"package test;\n" +
11746 		"\n" +
11747 		"public class FormatterError {\n" +
11748 		"	public void storeSomething(String s) throws Exception {\n" +
11749 		"		try(          FileReader fis = new FileReader(s);FileReader fis2 = new FileReader(s); FileReader fis3 = new FileReader(s);) {\n" +
11750 		"	}\n" +
11751 		"	}\n" +
11752 		"}\n";
11753 	formatSource(source,
11754 		"package test;\n" +
11755 		"\n" +
11756 		"public class FormatterError {\n" +
11757 		"	public void storeSomething(String s) throws Exception {\n" +
11758 		"		try (\n" +
11759 		"				FileReader fis = new FileReader(s); FileReader fis2 = new FileReader(s);\n" +
11760 		"				FileReader fis3 = new FileReader(s);) {\n" +
11761 		"		}\n" +
11762 		"	}\n" +
11763 		"}\n"
11764 	);
11765 }
11766 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349396
11767 // To check behavior with different line wrapping and indentation policies.
test759()11768 public void test759() throws Exception {
11769 	this.formatterPrefs = null;
11770 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11771 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11772 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11773 	this.formatterOptions.put(
11774 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_RESOURCES_IN_TRY,
11775 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT_FIRST_BREAK, DefaultCodeFormatterConstants.INDENT_BY_ONE));
11776 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "120");
11777 	String source =
11778 		"package test;\n" +
11779 		"\n" +
11780 		"public class FormatterError {\n" +
11781 		"	public void storeSomething(String s) throws Exception {\n" +
11782 		"		try(          FileReader fis = new FileReader(s);FileReader fis2 = new FileReader(s); FileReader fis3 = new FileReader(s);) {\n" +
11783 		"	}\n" +
11784 		"	}\n" +
11785 		"}\n";
11786 	formatSource(source,
11787 		"package test;\n" +
11788 		"\n" +
11789 		"public class FormatterError {\n" +
11790 		"	public void storeSomething(String s) throws Exception {\n" +
11791 		"		try (\n" +
11792 		"			FileReader fis = new FileReader(s); FileReader fis2 = new FileReader(s);\n" +
11793 		"			FileReader fis3 = new FileReader(s);) {\n" +
11794 		"		}\n" +
11795 		"	}\n" +
11796 		"}\n"
11797 	);
11798 }
11799 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349396
11800 // To check behavior with different line wrapping and indentation policies.
test760()11801 public void test760() throws Exception {
11802 	this.formatterPrefs = null;
11803 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11804 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11805 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11806 	this.formatterOptions.put(
11807 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_RESOURCES_IN_TRY,
11808 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_SHIFTED, DefaultCodeFormatterConstants.INDENT_DEFAULT));
11809 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "120");
11810 	String source =
11811 		"package test;\n" +
11812 		"\n" +
11813 		"public class FormatterError {\n" +
11814 		"	public void storeSomething(String s) throws Exception {\n" +
11815 		"		try(          FileReader fis = new FileReader(s);FileReader fis2 = new FileReader(s); FileReader fis3 = new FileReader(s);) {\n" +
11816 		"	}\n" +
11817 		"	}\n" +
11818 		"}\n";
11819 	formatSource(source,
11820 		"package test;\n" +
11821 		"\n" +
11822 		"public class FormatterError {\n" +
11823 		"	public void storeSomething(String s) throws Exception {\n" +
11824 		"		try (\n" +
11825 		"				FileReader fis = new FileReader(s);\n" +
11826 		"					FileReader fis2 = new FileReader(s);\n" +
11827 		"					FileReader fis3 = new FileReader(s);) {\n" +
11828 		"		}\n" +
11829 		"	}\n" +
11830 		"}\n"
11831 	);
11832 }
11833 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349396
11834 // To check behavior with different line wrapping and indentation policies.
test761()11835 public void test761() throws Exception {
11836 	this.formatterPrefs = null;
11837 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11838 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11839 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11840 	this.formatterOptions.put(
11841 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_RESOURCES_IN_TRY,
11842 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_SHIFTED, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
11843 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "120");
11844 	String source =
11845 		"package test;\n" +
11846 		"\n" +
11847 		"public class FormatterError {\n" +
11848 		"	public void storeSomething(String s) throws Exception {\n" +
11849 		"		try(          FileReader fis = new FileReader(s);FileReader fis2 = new FileReader(s); FileReader fis3 = new FileReader(s);) {\n" +
11850 		"	}\n" +
11851 		"	}\n" +
11852 		"}\n";
11853 	formatSource(source,
11854 		"package test;\n" +
11855 		"\n" +
11856 		"public class FormatterError {\n" +
11857 		"	public void storeSomething(String s) throws Exception {\n" +
11858 		"		try (\n" +
11859 		"				FileReader fis = new FileReader(s);\n" +
11860 		"					FileReader fis2 = new FileReader(s);\n" +
11861 		"					FileReader fis3 = new FileReader(s);) {\n" +
11862 		"		}\n" +
11863 		"	}\n" +
11864 		"}\n"
11865 	);
11866 }
11867 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349396
11868 // To check behavior with different line wrapping and indentation policies.
test762()11869 public void test762() throws Exception {
11870 	this.formatterPrefs = null;
11871 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11872 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11873 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11874 	this.formatterOptions.put(
11875 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_RESOURCES_IN_TRY,
11876 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_SHIFTED, DefaultCodeFormatterConstants.INDENT_BY_ONE));
11877 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "120");
11878 	String source =
11879 		"package test;\n" +
11880 		"\n" +
11881 		"public class FormatterError {\n" +
11882 		"	public void storeSomething(String s) throws Exception {\n" +
11883 		"		try(          FileReader fis = new FileReader(s);FileReader fis2 = new FileReader(s); FileReader fis3 = new FileReader(s);) {\n" +
11884 		"	}\n" +
11885 		"	}\n" +
11886 		"}\n";
11887 	formatSource(source,
11888 		"package test;\n" +
11889 		"\n" +
11890 		"public class FormatterError {\n" +
11891 		"	public void storeSomething(String s) throws Exception {\n" +
11892 		"		try (\n" +
11893 		"			FileReader fis = new FileReader(s);\n" +
11894 		"				FileReader fis2 = new FileReader(s);\n" +
11895 		"				FileReader fis3 = new FileReader(s);) {\n" +
11896 		"		}\n" +
11897 		"	}\n" +
11898 		"}\n"
11899 	);
11900 }
11901 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349396
11902 // To check behavior with different line wrapping and indentation policies.
test763()11903 public void test763() throws Exception {
11904 	this.formatterPrefs = null;
11905 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11906 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11907 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11908 	this.formatterOptions.put(
11909 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_RESOURCES_IN_TRY,
11910 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
11911 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "120");
11912 	String source =
11913 		"package test;\n" +
11914 		"\n" +
11915 		"public class FormatterError {\n" +
11916 		"	public void storeSomething(String s) throws Exception {\n" +
11917 		"		try(          FileReader fis = new FileReader(s);FileReader fis2 = new FileReader(s); FileReader fis3 = new FileReader(s);) {\n" +
11918 		"	}\n" +
11919 		"	}\n" +
11920 		"}\n";
11921 	formatSource(source,
11922 		"package test;\n" +
11923 		"\n" +
11924 		"public class FormatterError {\n" +
11925 		"	public void storeSomething(String s) throws Exception {\n" +
11926 		"		try (\n" +
11927 		"				FileReader fis = new FileReader(s);\n" +
11928 		"				FileReader fis2 = new FileReader(s);\n" +
11929 		"				FileReader fis3 = new FileReader(s);) {\n" +
11930 		"		}\n" +
11931 		"	}\n" +
11932 		"}\n"
11933 	);
11934 }
11935 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349396
11936 // To check behavior with different line wrapping and indentation policies.
test764()11937 public void test764() throws Exception {
11938 	this.formatterPrefs = null;
11939 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11940 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11941 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11942 	this.formatterOptions.put(
11943 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_RESOURCES_IN_TRY,
11944 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_BY_ONE));
11945 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "120");
11946 	String source =
11947 		"package test;\n" +
11948 		"\n" +
11949 		"public class FormatterError {\n" +
11950 		"	public void storeSomething(String s) throws Exception {\n" +
11951 		"		try(          FileReader fis = new FileReader(s);FileReader fis2 = new FileReader(s); FileReader fis3 = new FileReader(s);) {\n" +
11952 		"	}\n" +
11953 		"	}\n" +
11954 		"}\n";
11955 	formatSource(source,
11956 		"package test;\n" +
11957 		"\n" +
11958 		"public class FormatterError {\n" +
11959 		"	public void storeSomething(String s) throws Exception {\n" +
11960 		"		try (\n" +
11961 		"			FileReader fis = new FileReader(s);\n" +
11962 		"			FileReader fis2 = new FileReader(s);\n" +
11963 		"			FileReader fis3 = new FileReader(s);) {\n" +
11964 		"		}\n" +
11965 		"	}\n" +
11966 		"}\n"
11967 	);
11968 }
11969 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349396
11970 // To check behavior with different line wrapping and indentation policies.
test765()11971 public void test765() throws Exception {
11972 	this.formatterPrefs = null;
11973 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
11974 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
11975 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
11976 	this.formatterOptions.put(
11977 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_RESOURCES_IN_TRY,
11978 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
11979 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "120");
11980 	String source =
11981 		"package test;\n" +
11982 		"\n" +
11983 		"public class FormatterError {\n" +
11984 		"	public void storeSomething(String s) throws Exception {\n" +
11985 		"		try(          FileReader fis = new FileReader(s);FileReader fis2 = new FileReader(s); FileReader fis3 = new FileReader(s);) {\n" +
11986 		"	}\n" +
11987 		"	}\n" +
11988 		"}\n";
11989 	formatSource(source,
11990 		"package test;\n" +
11991 		"\n" +
11992 		"public class FormatterError {\n" +
11993 		"	public void storeSomething(String s) throws Exception {\n" +
11994 		"		try (\n" +
11995 		"				FileReader fis = new FileReader(s);\n" +
11996 		"				FileReader fis2 = new FileReader(s);\n" +
11997 		"				FileReader fis3 = new FileReader(s);) {\n" +
11998 		"		}\n" +
11999 		"	}\n" +
12000 		"}\n"
12001 	);
12002 }
12003 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349314
12004 // To check behavior with different line wrapping and indentation policies.
test766()12005 public void test766() throws Exception {
12006 	this.formatterPrefs = null;
12007 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
12008 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
12009 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
12010 	this.formatterOptions.put(
12011 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_UNION_TYPE_IN_MULTICATCH,
12012 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NO_SPLIT, DefaultCodeFormatterConstants.INDENT_DEFAULT));
12013 	String source =
12014 		"package test;\n" +
12015 		"\n" +
12016 		"public class FormatterError {\n" +
12017 		"	public void foo(boolean a) {\n" +
12018 		"		try{\n" +
12019 		"			if (a)\n" +
12020 		"				throw new FileNotFoundException();\n" +
12021 		"			else\n" +
12022 		"				throw new MyE();\n" +
12023 		"		} catch (MyE| FileNotFoundException| ArrayIndexOutOfBoundsException| IllegalArgumentException ex) {\n" +
12024 		"		}\n" +
12025 		"	}\n" +
12026 		"}\n" +
12027 		"class MyE extends Exception {}";
12028 	formatSource(source,
12029 		"package test;\n" +
12030 		"\n" +
12031 		"public class FormatterError {\n" +
12032 		"	public void foo(boolean a) {\n" +
12033 		"		try {\n" +
12034 		"			if (a)\n" +
12035 		"				throw new FileNotFoundException();\n" +
12036 		"			else\n" +
12037 		"				throw new MyE();\n" +
12038 		"		} catch (MyE | FileNotFoundException | ArrayIndexOutOfBoundsException | IllegalArgumentException ex) {\n" +
12039 		"		}\n" +
12040 		"	}\n" +
12041 		"}\n" +
12042 		"\n" +
12043 		"class MyE extends Exception {\n" +
12044 		"}"
12045 	);
12046 }
12047 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349314
12048 // To check behavior with default settings.
test767()12049 public void test767() throws Exception {
12050 	this.formatterPrefs = null;
12051 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
12052 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
12053 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
12054 	setFormatterOptions80();
12055 	String source =
12056 		"package test;\n" +
12057 		"\n" +
12058 		"public class FormatterError {\n" +
12059 		"	public void foo(boolean a) {\n" +
12060 		"		try{\n" +
12061 		"			if (a)\n" +
12062 		"				throw new FileNotFoundException();\n" +
12063 		"			else\n" +
12064 		"				throw new MyE();\n" +
12065 		"		} catch (MyE| FileNotFoundException| ArrayIndexOutOfBoundsException| IllegalArgumentException ex) {\n" +
12066 		"		}\n" +
12067 		"	}\n" +
12068 		"}\n" +
12069 		"class MyE extends Exception {}";
12070 	formatSource(source,
12071 		"package test;\n" +
12072 		"\n" +
12073 		"public class FormatterError {\n" +
12074 		"	public void foo(boolean a) {\n" +
12075 		"		try {\n" +
12076 		"			if (a)\n" +
12077 		"				throw new FileNotFoundException();\n" +
12078 		"			else\n" +
12079 		"				throw new MyE();\n" +
12080 		"		} catch (MyE | FileNotFoundException | ArrayIndexOutOfBoundsException\n" +
12081 		"				| IllegalArgumentException ex) {\n" +
12082 		"		}\n" +
12083 		"	}\n" +
12084 		"}\n" +
12085 		"\n" +
12086 		"class MyE extends Exception {\n" +
12087 		"}"
12088 	);
12089 }
12090 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349314
12091 // To check behavior with default settings.
test767a()12092 public void test767a() throws Exception {
12093 	this.formatterPrefs = null;
12094 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
12095 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
12096 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
12097 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "60");
12098 	String source =
12099 		"package test;\n" +
12100 		"\n" +
12101 		"public class FormatterError {\n" +
12102 		"	public void foo(boolean a) {\n" +
12103 		"		try{\n" +
12104 		"			if (a)\n" +
12105 		"				throw new FileNotFoundException();\n" +
12106 		"			else\n" +
12107 		"				throw new MyE();\n" +
12108 		"		} catch (MyE| FileNotFoundException| ArrayIndexOutOfBoundsException| IllegalArgumentException ex) {\n" +
12109 		"		}\n" +
12110 		"	}\n" +
12111 		"}\n" +
12112 		"class MyE extends Exception {}";
12113 	formatSource(source,
12114 		"package test;\n" +
12115 		"\n" +
12116 		"public class FormatterError {\n" +
12117 		"	public void foo(boolean a) {\n" +
12118 		"		try {\n" +
12119 		"			if (a)\n" +
12120 		"				throw new FileNotFoundException();\n" +
12121 		"			else\n" +
12122 		"				throw new MyE();\n" +
12123 		"		} catch (MyE | FileNotFoundException\n" +
12124 		"				| ArrayIndexOutOfBoundsException\n" +
12125 		"				| IllegalArgumentException ex) {\n" +
12126 		"		}\n" +
12127 		"	}\n" +
12128 		"}\n" +
12129 		"\n" +
12130 		"class MyE extends Exception {\n" +
12131 		"}"
12132 	);
12133 }
12134 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349314
12135 // To check behavior with default settings, and spaces before '|' and not after them.
test767b()12136 public void test767b() throws Exception {
12137 	this.formatterPrefs = null;
12138 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
12139 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
12140 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
12141 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_BITWISE_OPERATOR, JavaCore.INSERT);
12142 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_BITWISE_OPERATOR, JavaCore.DO_NOT_INSERT);
12143 	setFormatterOptions80();
12144 	String source =
12145 		"package test;\n" +
12146 		"\n" +
12147 		"public class FormatterError {\n" +
12148 		"	public void foo(boolean a) {\n" +
12149 		"		try{\n" +
12150 		"			if (a)\n" +
12151 		"				throw new FileNotFoundException();\n" +
12152 		"			else\n" +
12153 		"				throw new MyE();\n" +
12154 		"		} catch (MyE| FileNotFoundException| ArrayIndexOutOfBoundsException| IllegalArgumentException ex) {\n" +
12155 		"		}\n" +
12156 		"	}\n" +
12157 		"}\n" +
12158 		"class MyE extends Exception {}";
12159 	formatSource(source,
12160 		"package test;\n" +
12161 		"\n" +
12162 		"public class FormatterError {\n" +
12163 		"	public void foo(boolean a) {\n" +
12164 		"		try {\n" +
12165 		"			if (a)\n" +
12166 		"				throw new FileNotFoundException();\n" +
12167 		"			else\n" +
12168 		"				throw new MyE();\n" +
12169 		"		} catch (MyE |FileNotFoundException |ArrayIndexOutOfBoundsException\n" +
12170 		"				|IllegalArgumentException ex) {\n" +
12171 		"		}\n" +
12172 		"	}\n" +
12173 		"}\n" +
12174 		"\n" +
12175 		"class MyE extends Exception {\n" +
12176 		"}"
12177 	);
12178 }
12179 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349314
12180 // To check behavior with different line wrapping and indentation policies.
test768()12181 public void test768() throws Exception {
12182 	this.formatterPrefs = null;
12183 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
12184 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
12185 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
12186 	this.formatterOptions.put(
12187 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_UNION_TYPE_IN_MULTICATCH,
12188 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
12189 	setFormatterOptions80();
12190 	String source =
12191 		"package test;\n" +
12192 		"\n" +
12193 		"public class FormatterError {\n" +
12194 		"	public void foo(boolean a) {\n" +
12195 		"		try{\n" +
12196 		"			if (a)\n" +
12197 		"				throw new FileNotFoundException();\n" +
12198 		"			else\n" +
12199 		"				throw new MyE();\n" +
12200 		"		} catch (MyE| FileNotFoundException| ArrayIndexOutOfBoundsException| IllegalArgumentException ex) {\n" +
12201 		"		}\n" +
12202 		"	}\n" +
12203 		"}\n" +
12204 		"class MyE extends Exception {}";
12205 	formatSource(source,
12206 		"package test;\n" +
12207 		"\n" +
12208 		"public class FormatterError {\n" +
12209 		"	public void foo(boolean a) {\n" +
12210 		"		try {\n" +
12211 		"			if (a)\n" +
12212 		"				throw new FileNotFoundException();\n" +
12213 		"			else\n" +
12214 		"				throw new MyE();\n" +
12215 		"		} catch (	MyE | FileNotFoundException | ArrayIndexOutOfBoundsException\n" +
12216 		"					| IllegalArgumentException ex) {\n" +
12217 		"		}\n" +
12218 		"	}\n" +
12219 		"}\n" +
12220 		"\n" +
12221 		"class MyE extends Exception {\n" +
12222 		"}"
12223 	);
12224 }
12225 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349314
12226 // To check behavior with different line wrapping and indentation policies.
test769()12227 public void test769() throws Exception {
12228 	this.formatterPrefs = null;
12229 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
12230 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
12231 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
12232 	this.formatterOptions.put(
12233 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_UNION_TYPE_IN_MULTICATCH,
12234 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT, DefaultCodeFormatterConstants.INDENT_BY_ONE));
12235 	setFormatterOptions80();
12236 	String source =
12237 		"package test;\n" +
12238 		"\n" +
12239 		"public class FormatterError {\n" +
12240 		"	public void foo(boolean a) {\n" +
12241 		"		try{\n" +
12242 		"			if (a)\n" +
12243 		"				throw new FileNotFoundException();\n" +
12244 		"			else\n" +
12245 		"				throw new MyE();\n" +
12246 		"		} catch (MyE| FileNotFoundException| ArrayIndexOutOfBoundsException| IllegalArgumentException ex) {\n" +
12247 		"		}\n" +
12248 		"	}\n" +
12249 		"}\n" +
12250 		"class MyE extends Exception {}";
12251 	formatSource(source,
12252 		"package test;\n" +
12253 		"\n" +
12254 		"public class FormatterError {\n" +
12255 		"	public void foo(boolean a) {\n" +
12256 		"		try {\n" +
12257 		"			if (a)\n" +
12258 		"				throw new FileNotFoundException();\n" +
12259 		"			else\n" +
12260 		"				throw new MyE();\n" +
12261 		"		} catch (MyE | FileNotFoundException | ArrayIndexOutOfBoundsException\n" +
12262 		"			| IllegalArgumentException ex) {\n" +
12263 		"		}\n" +
12264 		"	}\n" +
12265 		"}\n" +
12266 		"\n" +
12267 		"class MyE extends Exception {\n" +
12268 		"}"
12269 	);
12270 }
12271 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349314
12272 // To check behavior with different line wrapping and indentation policies.
test770()12273 public void test770() throws Exception {
12274 	this.formatterPrefs = null;
12275 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
12276 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
12277 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
12278 	this.formatterOptions.put(
12279 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_UNION_TYPE_IN_MULTICATCH,
12280 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT_FIRST_BREAK, DefaultCodeFormatterConstants.INDENT_DEFAULT));
12281 	setFormatterOptions80();
12282 	String source =
12283 		"package test;\n" +
12284 		"\n" +
12285 		"public class FormatterError {\n" +
12286 		"	public void foo(boolean a) {\n" +
12287 		"		try{\n" +
12288 		"			if (a)\n" +
12289 		"				throw new FileNotFoundException();\n" +
12290 		"			else\n" +
12291 		"				throw new MyE();\n" +
12292 		"		} catch (MyE| FileNotFoundException| ArrayIndexOutOfBoundsException| IllegalArgumentException ex) {\n" +
12293 		"		}\n" +
12294 		"	}\n" +
12295 		"}\n" +
12296 		"class MyE extends Exception {}";
12297 	formatSource(source,
12298 		"package test;\n" +
12299 		"\n" +
12300 		"public class FormatterError {\n" +
12301 		"	public void foo(boolean a) {\n" +
12302 		"		try {\n" +
12303 		"			if (a)\n" +
12304 		"				throw new FileNotFoundException();\n" +
12305 		"			else\n" +
12306 		"				throw new MyE();\n" +
12307 		"		} catch (\n" +
12308 		"				MyE | FileNotFoundException | ArrayIndexOutOfBoundsException\n" +
12309 		"				| IllegalArgumentException ex) {\n" +
12310 		"		}\n" +
12311 		"	}\n" +
12312 		"}\n" +
12313 		"\n" +
12314 		"class MyE extends Exception {\n" +
12315 		"}"
12316 	);
12317 }
12318 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349314
12319 // To check behavior with different line wrapping and indentation policies.
test771()12320 public void test771() throws Exception {
12321 	this.formatterPrefs = null;
12322 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
12323 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
12324 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
12325 	this.formatterOptions.put(
12326 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_UNION_TYPE_IN_MULTICATCH,
12327 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT_FIRST_BREAK, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
12328 	setFormatterOptions80();
12329 	String source =
12330 		"package test;\n" +
12331 		"\n" +
12332 		"public class FormatterError {\n" +
12333 		"	public void foo(boolean a) {\n" +
12334 		"		try{\n" +
12335 		"			if (a)\n" +
12336 		"				throw new FileNotFoundException();\n" +
12337 		"			else\n" +
12338 		"				throw new MyE();\n" +
12339 		"		} catch (MyE| FileNotFoundException| ArrayIndexOutOfBoundsException| IllegalArgumentException ex) {\n" +
12340 		"		}\n" +
12341 		"	}\n" +
12342 		"}\n" +
12343 		"class MyE extends Exception {}";
12344 	formatSource(source,
12345 		"package test;\n" +
12346 		"\n" +
12347 		"public class FormatterError {\n" +
12348 		"	public void foo(boolean a) {\n" +
12349 		"		try {\n" +
12350 		"			if (a)\n" +
12351 		"				throw new FileNotFoundException();\n" +
12352 		"			else\n" +
12353 		"				throw new MyE();\n" +
12354 		"		} catch (\n" +
12355 		"					MyE | FileNotFoundException | ArrayIndexOutOfBoundsException\n" +
12356 		"					| IllegalArgumentException ex) {\n" +
12357 		"		}\n" +
12358 		"	}\n" +
12359 		"}\n" +
12360 		"\n" +
12361 		"class MyE extends Exception {\n" +
12362 		"}"
12363 	);
12364 }
12365 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349314
12366 // To check behavior with different line wrapping and indentation policies.
test772()12367 public void test772() throws Exception {
12368 	this.formatterPrefs = null;
12369 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
12370 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
12371 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
12372 	this.formatterOptions.put(
12373 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_UNION_TYPE_IN_MULTICATCH,
12374 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_COMPACT_FIRST_BREAK, DefaultCodeFormatterConstants.INDENT_BY_ONE));
12375 	setFormatterOptions80();
12376 	String source =
12377 		"package test;\n" +
12378 		"\n" +
12379 		"public class FormatterError {\n" +
12380 		"	public void foo(boolean a) {\n" +
12381 		"		try{\n" +
12382 		"			if (a)\n" +
12383 		"				throw new FileNotFoundException();\n" +
12384 		"			else\n" +
12385 		"				throw new MyE();\n" +
12386 		"		} catch (MyE| FileNotFoundException| ArrayIndexOutOfBoundsException| IllegalArgumentException ex) {\n" +
12387 		"		}\n" +
12388 		"	}\n" +
12389 		"}\n" +
12390 		"class MyE extends Exception {}";
12391 	formatSource(source,
12392 		"package test;\n" +
12393 		"\n" +
12394 		"public class FormatterError {\n" +
12395 		"	public void foo(boolean a) {\n" +
12396 		"		try {\n" +
12397 		"			if (a)\n" +
12398 		"				throw new FileNotFoundException();\n" +
12399 		"			else\n" +
12400 		"				throw new MyE();\n" +
12401 		"		} catch (\n" +
12402 		"			MyE | FileNotFoundException | ArrayIndexOutOfBoundsException\n" +
12403 		"			| IllegalArgumentException ex) {\n" +
12404 		"		}\n" +
12405 		"	}\n" +
12406 		"}\n" +
12407 		"\n" +
12408 		"class MyE extends Exception {\n" +
12409 		"}"
12410 	);
12411 }
12412 
12413 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349314
12414 // To check behavior with different line wrapping and indentation policies.
test773()12415 public void test773() throws Exception {
12416 	this.formatterPrefs = null;
12417 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
12418 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
12419 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
12420 	this.formatterOptions.put(
12421 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_UNION_TYPE_IN_MULTICATCH,
12422 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
12423 	setFormatterOptions80();
12424 	String source =
12425 		"package test;\n" +
12426 		"\n" +
12427 		"public class FormatterError {\n" +
12428 		"	public void foo(boolean a) {\n" +
12429 		"		try{\n" +
12430 		"			if (a)\n" +
12431 		"				throw new FileNotFoundException();\n" +
12432 		"			else\n" +
12433 		"				throw new MyE();\n" +
12434 		"		} catch (MyE| FileNotFoundException| ArrayIndexOutOfBoundsException| IllegalArgumentException ex) {\n" +
12435 		"		}\n" +
12436 		"	}\n" +
12437 		"}\n" +
12438 		"class MyE extends Exception {}";
12439 	formatSource(source,
12440 		"package test;\n" +
12441 		"\n" +
12442 		"public class FormatterError {\n" +
12443 		"	public void foo(boolean a) {\n" +
12444 		"		try {\n" +
12445 		"			if (a)\n" +
12446 		"				throw new FileNotFoundException();\n" +
12447 		"			else\n" +
12448 		"				throw new MyE();\n" +
12449 		"		} catch (MyE\n" +
12450 		"				| FileNotFoundException\n" +
12451 		"				| ArrayIndexOutOfBoundsException\n" +
12452 		"				| IllegalArgumentException ex) {\n" +
12453 		"		}\n" +
12454 		"	}\n" +
12455 		"}\n" +
12456 		"\n" +
12457 		"class MyE extends Exception {\n" +
12458 		"}"
12459 	);
12460 }
12461 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349314
12462 // To check behavior with different line wrapping and indentation policies.
test774()12463 public void test774() throws Exception {
12464 	this.formatterPrefs = null;
12465 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
12466 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
12467 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
12468 	this.formatterOptions.put(
12469 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_UNION_TYPE_IN_MULTICATCH,
12470 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
12471 	setFormatterOptions80();
12472 	String source =
12473 		"package test;\n" +
12474 		"\n" +
12475 		"public class FormatterError {\n" +
12476 		"	public void foo(boolean a) {\n" +
12477 		"		try{\n" +
12478 		"			if (a)\n" +
12479 		"				throw new FileNotFoundException();\n" +
12480 		"			else\n" +
12481 		"				throw new MyE();\n" +
12482 		"		} catch (MyE| FileNotFoundException| ArrayIndexOutOfBoundsException| IllegalArgumentException ex) {\n" +
12483 		"		}\n" +
12484 		"	}\n" +
12485 		"}\n" +
12486 		"class MyE extends Exception {}";
12487 	formatSource(source,
12488 		"package test;\n" +
12489 		"\n" +
12490 		"public class FormatterError {\n" +
12491 		"	public void foo(boolean a) {\n" +
12492 		"		try {\n" +
12493 		"			if (a)\n" +
12494 		"				throw new FileNotFoundException();\n" +
12495 		"			else\n" +
12496 		"				throw new MyE();\n" +
12497 		"		} catch (	MyE\n" +
12498 		"					| FileNotFoundException\n" +
12499 		"					| ArrayIndexOutOfBoundsException\n" +
12500 		"					| IllegalArgumentException ex) {\n" +
12501 		"		}\n" +
12502 		"	}\n" +
12503 		"}\n" +
12504 		"\n" +
12505 		"class MyE extends Exception {\n" +
12506 		"}"
12507 	);
12508 }
12509 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349314
12510 // To check behavior with different line wrapping and indentation policies.
test775()12511 public void test775() throws Exception {
12512 	this.formatterPrefs = null;
12513 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
12514 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
12515 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
12516 	this.formatterOptions.put(
12517 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_UNION_TYPE_IN_MULTICATCH,
12518 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_PER_LINE, DefaultCodeFormatterConstants.INDENT_BY_ONE));
12519 	setFormatterOptions80();
12520 	String source =
12521 		"package test;\n" +
12522 		"\n" +
12523 		"public class FormatterError {\n" +
12524 		"	public void foo(boolean a) {\n" +
12525 		"		try{\n" +
12526 		"			if (a)\n" +
12527 		"				throw new FileNotFoundException();\n" +
12528 		"			else\n" +
12529 		"				throw new MyE();\n" +
12530 		"		} catch (MyE| FileNotFoundException| ArrayIndexOutOfBoundsException| IllegalArgumentException ex) {\n" +
12531 		"		}\n" +
12532 		"	}\n" +
12533 		"}\n" +
12534 		"class MyE extends Exception {}";
12535 	formatSource(source,
12536 		"package test;\n" +
12537 		"\n" +
12538 		"public class FormatterError {\n" +
12539 		"	public void foo(boolean a) {\n" +
12540 		"		try {\n" +
12541 		"			if (a)\n" +
12542 		"				throw new FileNotFoundException();\n" +
12543 		"			else\n" +
12544 		"				throw new MyE();\n" +
12545 		"		} catch (MyE\n" +
12546 		"			| FileNotFoundException\n" +
12547 		"			| ArrayIndexOutOfBoundsException\n" +
12548 		"			| IllegalArgumentException ex) {\n" +
12549 		"		}\n" +
12550 		"	}\n" +
12551 		"}\n" +
12552 		"\n" +
12553 		"class MyE extends Exception {\n" +
12554 		"}"
12555 	);
12556 }
12557 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349314
12558 // To check behavior with different line wrapping and indentation policies.
test776()12559 public void test776() throws Exception {
12560 	this.formatterPrefs = null;
12561 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
12562 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
12563 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
12564 	this.formatterOptions.put(
12565 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_UNION_TYPE_IN_MULTICATCH,
12566 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_SHIFTED, DefaultCodeFormatterConstants.INDENT_DEFAULT));
12567 	setFormatterOptions80();
12568 	String source =
12569 		"package test;\n" +
12570 		"\n" +
12571 		"public class FormatterError {\n" +
12572 		"	public void foo(boolean a) {\n" +
12573 		"		try{\n" +
12574 		"			if (a)\n" +
12575 		"				throw new FileNotFoundException();\n" +
12576 		"			else\n" +
12577 		"				throw new MyE();\n" +
12578 		"		} catch (MyE| FileNotFoundException| ArrayIndexOutOfBoundsException| IllegalArgumentException ex) {\n" +
12579 		"		}\n" +
12580 		"	}\n" +
12581 		"}\n" +
12582 		"class MyE extends Exception {}";
12583 	formatSource(source,
12584 		"package test;\n" +
12585 		"\n" +
12586 		"public class FormatterError {\n" +
12587 		"	public void foo(boolean a) {\n" +
12588 		"		try {\n" +
12589 		"			if (a)\n" +
12590 		"				throw new FileNotFoundException();\n" +
12591 		"			else\n" +
12592 		"				throw new MyE();\n" +
12593 		"		} catch (\n" +
12594 		"				MyE\n" +
12595 		"					| FileNotFoundException\n" +
12596 		"					| ArrayIndexOutOfBoundsException\n" +
12597 		"					| IllegalArgumentException ex) {\n" +
12598 		"		}\n" +
12599 		"	}\n" +
12600 		"}\n" +
12601 		"\n" +
12602 		"class MyE extends Exception {\n" +
12603 		"}"
12604 	);
12605 }
12606 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349314
12607 // To check behavior with different line wrapping and indentation policies.
test777()12608 public void test777() throws Exception {
12609 	this.formatterPrefs = null;
12610 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
12611 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
12612 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
12613 	this.formatterOptions.put(
12614 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_UNION_TYPE_IN_MULTICATCH,
12615 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_SHIFTED, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
12616 	setFormatterOptions80();
12617 	String source =
12618 		"package test;\n" +
12619 		"\n" +
12620 		"public class FormatterError {\n" +
12621 		"	public void foo(boolean a) {\n" +
12622 		"		try{\n" +
12623 		"			if (a)\n" +
12624 		"				throw new FileNotFoundException();\n" +
12625 		"			else\n" +
12626 		"				throw new MyE();\n" +
12627 		"		} catch (MyE| FileNotFoundException| ArrayIndexOutOfBoundsException| IllegalArgumentException ex) {\n" +
12628 		"		}\n" +
12629 		"	}\n" +
12630 		"}\n" +
12631 		"class MyE extends Exception {}";
12632 	formatSource(source,
12633 		"package test;\n" +
12634 		"\n" +
12635 		"public class FormatterError {\n" +
12636 		"	public void foo(boolean a) {\n" +
12637 		"		try {\n" +
12638 		"			if (a)\n" +
12639 		"				throw new FileNotFoundException();\n" +
12640 		"			else\n" +
12641 		"				throw new MyE();\n" +
12642 		"		} catch (\n" +
12643 		"					MyE\n" +
12644 		"						| FileNotFoundException\n" +
12645 		"						| ArrayIndexOutOfBoundsException\n" +
12646 		"						| IllegalArgumentException ex) {\n" +
12647 		"		}\n" +
12648 		"	}\n" +
12649 		"}\n" +
12650 		"\n" +
12651 		"class MyE extends Exception {\n" +
12652 		"}"
12653 	);
12654 }
12655 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349314
12656 // To check behavior with different line wrapping and indentation policies.
test778()12657 public void test778() throws Exception {
12658 	this.formatterPrefs = null;
12659 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
12660 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
12661 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
12662 	this.formatterOptions.put(
12663 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_UNION_TYPE_IN_MULTICATCH,
12664 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NEXT_SHIFTED, DefaultCodeFormatterConstants.INDENT_BY_ONE));
12665 	setFormatterOptions80();
12666 	String source =
12667 		"package test;\n" +
12668 		"\n" +
12669 		"public class FormatterError {\n" +
12670 		"	public void foo(boolean a) {\n" +
12671 		"		try{\n" +
12672 		"			if (a)\n" +
12673 		"				throw new FileNotFoundException();\n" +
12674 		"			else\n" +
12675 		"				throw new MyE();\n" +
12676 		"		} catch (MyE| FileNotFoundException| ArrayIndexOutOfBoundsException| IllegalArgumentException ex) {\n" +
12677 		"		}\n" +
12678 		"	}\n" +
12679 		"}\n" +
12680 		"class MyE extends Exception {}";
12681 	formatSource(source,
12682 		"package test;\n" +
12683 		"\n" +
12684 		"public class FormatterError {\n" +
12685 		"	public void foo(boolean a) {\n" +
12686 		"		try {\n" +
12687 		"			if (a)\n" +
12688 		"				throw new FileNotFoundException();\n" +
12689 		"			else\n" +
12690 		"				throw new MyE();\n" +
12691 		"		} catch (\n" +
12692 		"			MyE\n" +
12693 		"				| FileNotFoundException\n" +
12694 		"				| ArrayIndexOutOfBoundsException\n" +
12695 		"				| IllegalArgumentException ex) {\n" +
12696 		"		}\n" +
12697 		"	}\n" +
12698 		"}\n" +
12699 		"\n" +
12700 		"class MyE extends Exception {\n" +
12701 		"}"
12702 	);
12703 }
12704 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349314
12705 // To check behavior with different line wrapping and indentation policies.
test779()12706 public void test779() throws Exception {
12707 	this.formatterPrefs = null;
12708 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
12709 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
12710 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
12711 	this.formatterOptions.put(
12712 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_UNION_TYPE_IN_MULTICATCH,
12713 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
12714 	setFormatterOptions80();
12715 	String source =
12716 		"package test;\n" +
12717 		"\n" +
12718 		"public class FormatterError {\n" +
12719 		"	public void foo(boolean a) {\n" +
12720 		"		try{\n" +
12721 		"			if (a)\n" +
12722 		"				throw new FileNotFoundException();\n" +
12723 		"			else\n" +
12724 		"				throw new MyE();\n" +
12725 		"		} catch (MyE| FileNotFoundException| ArrayIndexOutOfBoundsException| IllegalArgumentException ex) {\n" +
12726 		"		}\n" +
12727 		"	}\n" +
12728 		"}\n" +
12729 		"class MyE extends Exception {}";
12730 	formatSource(source,
12731 		"package test;\n" +
12732 		"\n" +
12733 		"public class FormatterError {\n" +
12734 		"	public void foo(boolean a) {\n" +
12735 		"		try {\n" +
12736 		"			if (a)\n" +
12737 		"				throw new FileNotFoundException();\n" +
12738 		"			else\n" +
12739 		"				throw new MyE();\n" +
12740 		"		} catch (\n" +
12741 		"				MyE\n" +
12742 		"				| FileNotFoundException\n" +
12743 		"				| ArrayIndexOutOfBoundsException\n" +
12744 		"				| IllegalArgumentException ex) {\n" +
12745 		"		}\n" +
12746 		"	}\n" +
12747 		"}\n" +
12748 		"\n" +
12749 		"class MyE extends Exception {\n" +
12750 		"}"
12751 	);
12752 }
12753 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=349314
12754 // To check behavior with different line wrapping and indentation policies.
test780()12755 public void test780() throws Exception {
12756 	this.formatterPrefs = null;
12757 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
12758 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
12759 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
12760 	this.formatterOptions.put(
12761 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_UNION_TYPE_IN_MULTICATCH,
12762 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
12763 	setFormatterOptions80();
12764 	String source =
12765 		"package test;\n" +
12766 		"\n" +
12767 		"public class FormatterError {\n" +
12768 		"	public void foo(boolean a) {\n" +
12769 		"		try{\n" +
12770 		"			if (a)\n" +
12771 		"				throw new FileNotFoundException();\n" +
12772 		"			else\n" +
12773 		"				throw new MyE();\n" +
12774 		"		} catch (MyE| FileNotFoundException| ArrayIndexOutOfBoundsException| IllegalArgumentException ex) {\n" +
12775 		"		}\n" +
12776 		"	}\n" +
12777 		"}\n" +
12778 		"class MyE extends Exception {}";
12779 	formatSource(source,
12780 		"package test;\n" +
12781 		"\n" +
12782 		"public class FormatterError {\n" +
12783 		"	public void foo(boolean a) {\n" +
12784 		"		try {\n" +
12785 		"			if (a)\n" +
12786 		"				throw new FileNotFoundException();\n" +
12787 		"			else\n" +
12788 		"				throw new MyE();\n" +
12789 		"		} catch (\n" +
12790 		"					MyE\n" +
12791 		"					| FileNotFoundException\n" +
12792 		"					| ArrayIndexOutOfBoundsException\n" +
12793 		"					| IllegalArgumentException ex) {\n" +
12794 		"		}\n" +
12795 		"	}\n" +
12796 		"}\n" +
12797 		"\n" +
12798 		"class MyE extends Exception {\n" +
12799 		"}"
12800 	);
12801 }
12802 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=349314
12803 //To check behavior with different line wrapping and indentation policies.
test781()12804 public void test781() throws Exception {
12805 	this.formatterPrefs = null;
12806 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
12807 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
12808 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
12809 	this.formatterOptions.put(
12810 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_UNION_TYPE_IN_MULTICATCH,
12811 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_BY_ONE));
12812 	setFormatterOptions80();
12813 	String source =
12814 		"package test;\n" +
12815 		"\n" +
12816 		"public class FormatterError {\n" +
12817 		"	public void foo(boolean a) {\n" +
12818 		"		try{\n" +
12819 		"			if (a)\n" +
12820 		"				throw new FileNotFoundException();\n" +
12821 		"			else\n" +
12822 		"				throw new MyE();\n" +
12823 		"		} catch (MyE| FileNotFoundException| ArrayIndexOutOfBoundsException| IllegalArgumentException ex) {\n" +
12824 		"		}\n" +
12825 		"	}\n" +
12826 		"}\n" +
12827 		"class MyE extends Exception {}";
12828 	formatSource(source,
12829 		"package test;\n" +
12830 		"\n" +
12831 		"public class FormatterError {\n" +
12832 		"	public void foo(boolean a) {\n" +
12833 		"		try {\n" +
12834 		"			if (a)\n" +
12835 		"				throw new FileNotFoundException();\n" +
12836 		"			else\n" +
12837 		"				throw new MyE();\n" +
12838 		"		} catch (\n" +
12839 		"			MyE\n" +
12840 		"			| FileNotFoundException\n" +
12841 		"			| ArrayIndexOutOfBoundsException\n" +
12842 		"			| IllegalArgumentException ex) {\n" +
12843 		"		}\n" +
12844 		"	}\n" +
12845 		"}\n" +
12846 		"\n" +
12847 		"class MyE extends Exception {\n" +
12848 		"}"
12849 	);
12850 }
12851 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=350895
12852 // To check behavior with default settings and wrap before '|' operator disabled.
test782()12853 public void test782() throws Exception {
12854 	this.formatterPrefs = null;
12855 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
12856 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
12857 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
12858 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_OR_OPERATOR_MULTICATCH, JavaCore.DISABLED);
12859 	setFormatterOptions80();
12860 	String source =
12861 		"package test;\n" +
12862 		"\n" +
12863 		"public class FormatterError {\n" +
12864 		"	public void foo(boolean a) {\n" +
12865 		"		try{\n" +
12866 		"			if (a)\n" +
12867 		"				throw new FileNotFoundException();\n" +
12868 		"			else\n" +
12869 		"				throw new MyE();\n" +
12870 		"		} catch (MyE| FileNotFoundException| ArrayIndexOutOfBoundsException| IllegalArgumentException ex) {\n" +
12871 		"		}\n" +
12872 		"	}\n" +
12873 		"}\n" +
12874 		"class MyE extends Exception {}";
12875 	formatSource(source,
12876 		"package test;\n" +
12877 		"\n" +
12878 		"public class FormatterError {\n" +
12879 		"	public void foo(boolean a) {\n" +
12880 		"		try {\n" +
12881 		"			if (a)\n" +
12882 		"				throw new FileNotFoundException();\n" +
12883 		"			else\n" +
12884 		"				throw new MyE();\n" +
12885 		"		} catch (MyE | FileNotFoundException | ArrayIndexOutOfBoundsException |\n" +
12886 		"				IllegalArgumentException ex) {\n" +
12887 		"		}\n" +
12888 		"	}\n" +
12889 		"}\n" +
12890 		"\n" +
12891 		"class MyE extends Exception {\n" +
12892 		"}"
12893 	);
12894 }
12895 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=359646
test783()12896 public void test783() throws Exception {
12897 	this.formatterPrefs = null;
12898 	String source =
12899 		"public class X {public static void main(String[] args) {\n" +
12900 		"  	long x = 0x8000000000000000L;\n" +
12901 		"  	System.out.println(x);\n" +
12902 		"  }\n" +
12903 		"}";
12904 	formatSource(source,
12905 		"public class X {\n" +
12906 		"	public static void main(String[] args) {\n" +
12907 		"		long x = 0x8000000000000000L;\n" +
12908 		"		System.out.println(x);\n" +
12909 		"	}\n" +
12910 		"}"
12911 	);
12912 }
12913 
12914 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=379793
12915 // To verify that the whitespace options for resources in try statement work correctly
testBug379793()12916 public void testBug379793() throws Exception {
12917 	this.formatterPrefs = null;
12918 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, "80");
12919 	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
12920 	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
12921 	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
12922 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_TRY, JavaCore.INSERT);
12923 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_SEMICOLON_IN_TRY_RESOURCES, JavaCore.INSERT);
12924 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION, "1");
12925 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.SPACE);
12926 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "2");
12927 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INDENTATION_SIZE, "2");
12928 	this.formatterOptions.put(
12929 			DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_RESOURCES_IN_TRY,
12930 			DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_DEFAULT));
12931 	String source =
12932 		"package test;\n" +
12933 		"\n" +
12934 		"public class FormatterError {\n" +
12935 		"  void jbtnJDBCTest_actionPerformed(final ActionEvent e) {\n" +
12936 		"    if ((driverClasses != null) && (JDBCURL != null)) {\n" +
12937 		"      if (test == true) {\n" +
12938 		"        try (final Connection connection = DriverManager.getConnection(JDBCURL);) {\n" +
12939 		"          test = (connection != null);\n" +
12940 		"          if (test == true) {\n" +
12941 		"            jTextArea1.setText(\"The test was completeted successfully!\");\n" +
12942 		"          }\n" +
12943 		"        } catch (final SQLException sx) {\n" +
12944 		"          jTextArea1\n" +
12945 		"            .setText(\"\");\n" +
12946 		"        }\n" +
12947 		"      }\n" +
12948 		"    }\n" +
12949 		"  }\n" +
12950 		"}\n";
12951 	formatSource(source,
12952 		"package test;\n" +
12953 		"\n" +
12954 		"public class FormatterError {\n" +
12955 		"  void jbtnJDBCTest_actionPerformed(final ActionEvent e) {\n" +
12956 		"    if ((driverClasses != null) && (JDBCURL != null)) {\n" +
12957 		"      if (test == true) {\n" +
12958 		"        try (\n" +
12959 		"          final Connection connection = DriverManager.getConnection(JDBCURL);) {\n" +
12960 		"          test = (connection != null);\n" +
12961 		"          if (test == true) {\n" +
12962 		"            jTextArea1.setText(\"The test was completeted successfully!\");\n" +
12963 		"          }\n" +
12964 		"        } catch (final SQLException sx) {\n" +
12965 		"          jTextArea1.setText(\"\");\n" +
12966 		"        }\n" +
12967 		"      }\n" +
12968 		"    }\n" +
12969 		"  }\n" +
12970 		"}\n"
12971 	);
12972 }
12973 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=405038
12974 //To verify that the whitespace options for resources in try statement work correctly
testBug405038()12975 public void testBug405038() throws Exception {
12976 	this.formatterPrefs = null;
12977 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ADDITIVE_OPERATOR, JavaCore.DO_NOT_INSERT);
12978 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ADDITIVE_OPERATOR, JavaCore.DO_NOT_INSERT);
12979 	String source =
12980 		"public class FormatterError {\n" +
12981 		"  int foo(int a, int b, int c) {\n" +
12982 		"        return a + b + ++c;\n" +
12983 		"    }\n" +
12984 		"}\n";
12985 	formatSource(source,
12986 		"public class FormatterError {\n" +
12987 		"	int foo(int a, int b, int c) {\n" +
12988 		"		return a+b+ ++c;\n" +
12989 		"	}\n" +
12990 		"}\n"
12991 	);
12992 }
12993 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=405038
12994 //To verify that the whitespace options for resources in try statement work correctly
testBug405038_2()12995 public void testBug405038_2() throws Exception {
12996 	this.formatterPrefs = null;
12997 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ADDITIVE_OPERATOR, JavaCore.DO_NOT_INSERT);
12998 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ADDITIVE_OPERATOR, JavaCore.DO_NOT_INSERT);
12999 	String source =
13000 		"public class FormatterError {\n" +
13001 		"  int foo(int a, int b, int c) {\n" +
13002 		"        return a + ++b + c;\n" +
13003 		"    }\n" +
13004 		"}\n";
13005 	formatSource(source,
13006 		"public class FormatterError {\n" +
13007 		"	int foo(int a, int b, int c) {\n" +
13008 		"		return a+ ++b+c;\n" +
13009 		"	}\n" +
13010 		"}\n"
13011 	);
13012 }
13013 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=405038
13014 //To verify that the whitespace options for resources in try statement work correctly
testBug405038_3()13015 public void testBug405038_3() throws Exception {
13016 	this.formatterPrefs = null;
13017 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ADDITIVE_OPERATOR, JavaCore.DO_NOT_INSERT);
13018 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ADDITIVE_OPERATOR, JavaCore.DO_NOT_INSERT);
13019 	String source =
13020 		"public class FormatterError {\n" +
13021 		"  int foo(int a, int b, int c) {\n" +
13022 		"        return a - --b + c;\n" +
13023 		"    }\n" +
13024 		"}\n";
13025 	formatSource(source,
13026 		"public class FormatterError {\n" +
13027 		"	int foo(int a, int b, int c) {\n" +
13028 		"		return a- --b+c;\n" +
13029 		"	}\n" +
13030 		"}\n"
13031 	);
13032 }
13033 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=405038
13034 //To verify that the whitespace options for resources in try statement work correctly
testBug405038_4()13035 public void testBug405038_4() throws Exception {
13036 	this.formatterPrefs = null;
13037 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ADDITIVE_OPERATOR, JavaCore.DO_NOT_INSERT);
13038 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ADDITIVE_OPERATOR, JavaCore.DO_NOT_INSERT);
13039 	String source =
13040 		"public class FormatterError {\n" +
13041 		"  int foo(int a, int b, int c) {\n" +
13042 		"        return a - -b + c;\n" +
13043 		"    }\n" +
13044 		"}\n";
13045 	formatSource(source,
13046 		"public class FormatterError {\n" +
13047 		"	int foo(int a, int b, int c) {\n" +
13048 		"		return a- -b+c;\n" +
13049 		"	}\n" +
13050 		"}\n"
13051 	);
13052 }
13053 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=405038
13054 //To verify that the whitespace options for resources in try statement work correctly
testBug405038_5()13055 public void testBug405038_5() throws Exception {
13056 	this.formatterPrefs = null;
13057 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ADDITIVE_OPERATOR, JavaCore.DO_NOT_INSERT);
13058 	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ADDITIVE_OPERATOR, JavaCore.DO_NOT_INSERT);
13059 	String source =
13060 		"public class FormatterError {\n" +
13061 		"  int foo(int a, int b, int c) {\n" +
13062 		"        return a - -b + ++c;\n" +
13063 		"    }\n" +
13064 		"}\n";
13065 	formatSource(source,
13066 		"public class FormatterError {\n" +
13067 		"	int foo(int a, int b, int c) {\n" +
13068 		"		return a- -b+ ++c;\n" +
13069 		"	}\n" +
13070 		"}\n"
13071 	);
13072 }
13073 
13074 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=432593
testBug432593()13075 public void testBug432593() throws IOException {
13076 	ICompilationUnit sourceUnit;
13077 	try {
13078 		sourceUnit = getCompilationUnit("Formatter" , "", "test432593", getIn("A.java"));
13079 		String src = sourceUnit.getSource();
13080 		assertNotNull(src);
13081 		String source = src.toString();
13082 		final Map options = JavaCore.getOptions();
13083 		options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
13084 		options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5);
13085 		options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
13086 		final CodeFormatter codeFormatter = ToolFactory.createCodeFormatter(options);
13087 		final TextEdit edit = codeFormatter.format(CodeFormatter.K_COMPILATION_UNIT, source, 0, source.length(), 0, "\r\n");
13088 		assertTrue(edit != null);
13089 	} catch (JavaModelException e) {
13090 		e.printStackTrace();
13091 	}
13092 }
13093 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=467229
testBug467229()13094 public void testBug467229() throws IOException {
13095 	final Map<String, String> optionsMap = JavaCore.getOptions();
13096 	int tabSize = 3;
13097 	int indentSize = 5;
13098 	String[] keysToCheck = {
13099 			DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE,
13100 			DefaultCodeFormatterConstants.FORMATTER_INDENTATION_SIZE };
13101 
13102 	optionsMap.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, tabSize + "");
13103 	optionsMap.put(DefaultCodeFormatterConstants.FORMATTER_INDENTATION_SIZE, indentSize + "");
13104 
13105 	/* compare with org.eclipse.jdt.internal.ui.preferences.formatter.IndentationTabPage.updateTabPreferences() */
13106 	optionsMap.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, DefaultCodeFormatterConstants.MIXED);
13107 	DefaultCodeFormatterOptions options = new DefaultCodeFormatterOptions(optionsMap);
13108 	assertEquals(tabSize, options.tab_size);
13109 	assertEquals(indentSize, options.indentation_size);
13110 	Map<String, String> optionsMap2 = options.getMap();
13111 	for (String key : keysToCheck) {
13112 		assertEquals(key, optionsMap.get(key), optionsMap2.get(key));
13113 	}
13114 
13115 	optionsMap.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.SPACE);
13116 	options.set(optionsMap);
13117 	assertEquals(indentSize, options.tab_size);
13118 	assertEquals(tabSize, options.indentation_size);
13119 	optionsMap2 = options.getMap();
13120 	for (String key : keysToCheck) {
13121 		assertEquals(key, optionsMap.get(key), optionsMap2.get(key));
13122 	}
13123 
13124 	optionsMap.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.TAB);
13125 	options.set(optionsMap);
13126 	assertEquals(tabSize, options.tab_size);
13127 	assertEquals(tabSize, options.indentation_size);
13128 	optionsMap2 = options.getMap();
13129 	String key = keysToCheck[0]; // the other is lost in this conversion
13130 	assertEquals(key, optionsMap.get(key), optionsMap2.get(key));
13131 }
13132 /**
13133  * https://bugs.eclipse.org/477476 - Auto-formatter gets indentation wrong when used as post-save action
13134  */
testBug477476a()13135 public void testBug477476a() {
13136 	setComplianceLevel(CompilerOptions.VERSION_1_5);
13137 	this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
13138 	runTest(codeFormatter(), "test477476a", "A.java", CodeFormatter.K_COMPILATION_UNIT, false);
13139 }
13140 /**
13141  * https://bugs.eclipse.org/477476 - Auto-formatter gets indentation wrong when used as post-save action
13142  */
testBug477476b()13143 public void testBug477476b() {
13144 	setComplianceLevel(CompilerOptions.VERSION_1_5);
13145 	try {
13146 		String input = getCompilationUnit("Formatter" , "", "test477476b", "A_in.java").getSource();
13147 		String output = getCompilationUnit("Formatter" , "", "test477476b", "A_out.java").getSource();
13148 		formatSource(input, output);
13149 	} catch (JavaModelException e) {
13150 		e.printStackTrace();
13151 		assertTrue(false);
13152 	}
13153 }
13154 /**
13155  * https://bugs.eclipse.org/485495 - [Formatter] does not insert space before semicolon at the end of the statement
13156  */
testBug485495()13157 public void testBug485495() {
13158 	this.formatterPrefs.insert_space_before_semicolon = true;
13159 	String source =
13160 		"package test ;\n" +
13161 		"\n" +
13162 		"import java.util.ArrayList ;\n" +
13163 		"\n" +
13164 		"public class Test {\n" +
13165 		"\n" +
13166 		"	interface I {\n" +
13167 		"		void method() ;\n" +
13168 		"	}\n" +
13169 		"\n" +
13170 		"	ArrayList<String> e = null ;\n" +
13171 		"	int i ;\n" +
13172 		"\n" +
13173 		"	void foo() {\n" +
13174 		"		int i = 0 ;\n" +
13175 		"		String s ;\n" +
13176 		"		if (i > 0)\n" +
13177 		"			return ;\n" +
13178 		"		for (int j = 0; j < 5; j++) {\n" +
13179 		"			Object o ;\n" +
13180 		"			while (i < 0)\n" +
13181 		"				o = new Object() {\n" +
13182 		"					int f ;\n" +
13183 		"\n" +
13184 		"					void bar() {\n" +
13185 		"						if (f > 0)\n" +
13186 		"							f = 5 ;\n" +
13187 		"						else\n" +
13188 		"							f = 16 ;\n" +
13189 		"						try {\n" +
13190 		"							f = 14 ;\n" +
13191 		"						} catch (Exception e) {\n" +
13192 		"							bar() ;\n" +
13193 		"						}\n" +
13194 		"					}\n" +
13195 		"				} ;\n" +
13196 		"			while (i < 0)\n" +
13197 		"				switch (i) {\n" +
13198 		"				case 4:\n" +
13199 		"					foo() ;\n" +
13200 		"				}\n" +
13201 		"		}\n" +
13202 		"	}\n" +
13203 		"}";
13204 	formatSource(source);
13205 }
13206 /**
13207  * https://bugs.eclipse.org/479109 - [formatter] Add option to group aligned fields with blank lines
13208  */
testBug479109a()13209 public void testBug479109a() {
13210 	this.formatterPrefs.align_type_members_on_columns = true;
13211 	this.formatterPrefs.align_fields_grouping_blank_lines = 1;
13212 	String source =
13213 		"public class Test {\n" +
13214 		"	String field1 = \"1\"; //\n" +
13215 		"\n" +
13216 		"	public String field2 = \"2222\"; //\n" +
13217 		"\n" +
13218 		"\n" +
13219 		"	protected final String field3 = \"333333333\"; //\n" +
13220 		"}";
13221 	formatSource(source,
13222 		"public class Test {\n" +
13223 		"	String field1 = \"1\"; //\n" +
13224 		"\n" +
13225 		"	public String field2 = \"2222\"; //\n" +
13226 		"\n" +
13227 		"	protected final String field3 = \"333333333\"; //\n" +
13228 		"}"
13229 	);
13230 }
13231 /**
13232  * https://bugs.eclipse.org/479109 - [formatter] Add option to group aligned fields with blank lines
13233  */
testBug479109b()13234 public void testBug479109b() {
13235 	this.formatterPrefs.align_type_members_on_columns = true;
13236 	this.formatterPrefs.align_fields_grouping_blank_lines = 2;
13237 	String source =
13238 		"public class Test {\n" +
13239 		"	String field1 = \"1\";\n" +
13240 		"\n" +
13241 		"	public String field2222 = \"2222\";\n" +
13242 		"\n" +
13243 		"\n" +
13244 		"	protected final String field3 = \"333333333\";\n" +
13245 		"}";
13246 	formatSource(source,
13247 		"public class Test {\n" +
13248 		"	String					field1		= \"1\";\n" +
13249 		"\n" +
13250 		"	public String			field2222	= \"2222\";\n" +
13251 		"\n" +
13252 		"	protected final String	field3		= \"333333333\";\n" +
13253 		"}"
13254 	);
13255 }
13256 /**
13257  * https://bugs.eclipse.org/479109 - [formatter] Add option to group aligned fields with blank lines
13258  */
testBug479109c()13259 public void testBug479109c() {
13260 	this.formatterPrefs.align_type_members_on_columns = true;
13261 	this.formatterPrefs.align_fields_grouping_blank_lines = 2;
13262 	this.formatterPrefs.number_of_empty_lines_to_preserve = 2;
13263 	String source =
13264 		"public class Test {\n" +
13265 		"	String field1 = \"1\"; //\n" +
13266 		"\n" +
13267 		"	public String field2222 = \"2222\"; //\n" +
13268 		"\n" +
13269 		"\n" +
13270 		"	protected final String field3 = \"333333333\"; //\n" +
13271 		"}";
13272 	formatSource(source,
13273 		"public class Test {\n" +
13274 		"	String			field1		= \"1\";		//\n" +
13275 		"\n" +
13276 		"	public String	field2222	= \"2222\";	//\n" +
13277 		"\n" +
13278 		"\n" +
13279 		"	protected final String field3 = \"333333333\"; //\n" +
13280 		"}"
13281 	);
13282 }
13283 /**
13284  * https://bugs.eclipse.org/479109 - [formatter] Add option to group aligned fields with blank lines
13285  */
testBug479109d()13286 public void testBug479109d() {
13287 	setFormatLineCommentOnFirstColumn();
13288 	this.formatterPrefs.align_type_members_on_columns = true;
13289 	this.formatterPrefs.align_fields_grouping_blank_lines = 2;
13290 	String source =
13291 		"public class Test {\n" +
13292 		"	String field1 = \"1\";\n" +
13293 		"\n" +
13294 		"	public String field2222 = \"2222\";\n" +
13295 		"\n" +
13296 		"// group separator\n" +
13297 		"\n" +
13298 		"	protected final String field3 = \"333333333\";\n" +
13299 		"}";
13300 	formatSource(source,
13301 		"public class Test {\n" +
13302 		"	String			field1		= \"1\";\n" +
13303 		"\n" +
13304 		"	public String	field2222	= \"2222\";\n" +
13305 		"\n" +
13306 		"	// group separator\n" +
13307 		"\n" +
13308 		"	protected final String field3 = \"333333333\";\n" +
13309 		"}"
13310 	);
13311 }
13312 /**
13313  * https://bugs.eclipse.org/487375 - [formatter] block comment in front of method signature effects too much indentation
13314  */
testBug486719()13315 public void testBug486719() {
13316 	this.formatterPrefs.page_width = 80;
13317 	String source =
13318 		"public class Example {\n" +
13319 		"	int foo(Object a, Object b, Object c) {\n" +
13320 		"		if (a == b) return 1;if (a == c) return 2; //$IDENTITY-COMPARISON$\n" +
13321 		"		boolean aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = a == b && a == c; //$IDENTITY-COMPARISON$\n" +
13322 		"		return 3;\n" +
13323 		"	}\n" +
13324 		"}";
13325 	formatSource(source);
13326 }
13327 /**
13328  * https://bugs.eclipse.org/432628 - [formatter] Add option "Insert new line after annotations on enum constants"
13329  */
testBug432628a()13330 public void testBug432628a() {
13331 	setComplianceLevel(CompilerOptions.VERSION_1_5);
13332 	this.formatterPrefs.insert_new_line_after_annotation_on_enum_constant = false;
13333 	String source =
13334 		"public enum SomeEnum {\n" +
13335 		"	@XmlEnumValue(\"val1\") VAL_1(\"val1\"), @XmlEnumValue(\"val2\") VAL_2(\"val2\");\n" +
13336 		"}";
13337 	formatSource(source);
13338 }
13339 /**
13340  * https://bugs.eclipse.org/432628 - [formatter] Add option "Insert new line after annotations on enum constants"
13341  */
testBug432628b()13342 public void testBug432628b() {
13343 	setComplianceLevel(CompilerOptions.VERSION_1_5);
13344 	this.formatterPrefs.insert_new_line_after_annotation_on_enum_constant = true;
13345 	String source =
13346 		"public enum SomeEnum {\n" +
13347 		"	@XmlEnumValue(\"val1\")\n" +
13348 		"	VAL_1(\"val1\"), @XmlEnumValue(\"val2\")\n" +
13349 		"	VAL_2(\"val2\");\n" +
13350 		"}";
13351 	formatSource(source);
13352 }
13353 /**
13354  * https://bugs.eclipse.org/432628 - [formatter] Add option "Insert new line after annotations on enum constants"
13355  */
testBug432628c()13356 public void testBug432628c() {
13357 	setComplianceLevel(CompilerOptions.VERSION_1_5);
13358 	this.formatterPrefs.insert_new_line_after_annotation_on_enum_constant = true;
13359 	this.formatterPrefs.alignment_for_enum_constants = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
13360 	String source =
13361 		"public enum SomeEnum {\n" +
13362 		"	@XmlEnumValue(\"val1\")\n" +
13363 		"	VAL_1(\"val1\"),\n" +
13364 		"	@XmlEnumValue(\"val2\")\n" +
13365 		"	VAL_2(\"val2\");\n" +
13366 		"}";
13367 	formatSource(source);
13368 }
13369 /**
13370  * https://bugs.eclipse.org/432628 - [formatter] Add option "Insert new line after annotations on enum constants"
13371  */
testBug432628d()13372 public void testBug432628d() {
13373 	setComplianceLevel(CompilerOptions.VERSION_1_5);
13374 	this.formatterPrefs.insert_new_line_after_annotation_on_enum_constant = false;
13375 	this.formatterPrefs.alignment_for_enum_constants = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
13376 	String source =
13377 		"public enum SomeEnum {\n" +
13378 		"	@XmlEnumValue(\"val1\") VAL_1(\"val1\"),\n" +
13379 		"	@XmlEnumValue(\"val2\") VAL_2(\"val2\");\n" +
13380 		"}";
13381 	formatSource(source);
13382 }
13383 /**
13384  * https://bugs.eclipse.org/118264 - [formatter] Enable wrapping of for loop setup
13385  */
testBug118264a()13386 public void testBug118264a() {
13387 	this.formatterPrefs.page_width = 50;
13388 	String source =
13389 		"class Example {\n" +
13390 		"	int foo(int argument) {\n" +
13391 		"		for (int counter = 0; counter < argument; counter++) {\n" +
13392 		"			doSomething(counter);\n" +
13393 		"		}\n" +
13394 		"	}\n" +
13395 		"}";
13396 	formatSource(source);
13397 }
13398 /**
13399  * https://bugs.eclipse.org/118264 - [formatter] Enable wrapping of for loop setup
13400  */
testBug118264b()13401 public void testBug118264b() {
13402 	this.formatterPrefs.alignment_for_expressions_in_for_loop_header = Alignment.M_COMPACT_SPLIT;
13403 	this.formatterPrefs.page_width = 50;
13404 	String source =
13405 		"class Example {\n" +
13406 		"	int foo(int argument) {\n" +
13407 		"		for (int counter = 0; counter < argument; counter++) {\n" +
13408 		"			doSomething(counter);\n" +
13409 		"		}\n" +
13410 		"	}\n" +
13411 		"}";
13412 	formatSource(source,
13413 		"class Example {\n" +
13414 		"	int foo(int argument) {\n" +
13415 		"		for (int counter = 0; counter < argument;\n" +
13416 		"				counter++) {\n" +
13417 		"			doSomething(counter);\n" +
13418 		"		}\n" +
13419 		"	}\n" +
13420 		"}"
13421 	);
13422 }
13423 /**
13424  * https://bugs.eclipse.org/118264 - [formatter] Enable wrapping of for loop setup
13425  */
testBug118264c()13426 public void testBug118264c() {
13427 	this.formatterPrefs.alignment_for_expressions_in_for_loop_header = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
13428 	String source =
13429 		"class Example {\n" +
13430 		"	int foo(int argument) {\n" +
13431 		"		for (int counter = 0; counter < argument; counter++) {\n" +
13432 		"			doSomething(counter);\n" +
13433 		"		}\n" +
13434 		"	}\n" +
13435 		"}";
13436 	formatSource(source,
13437 		"class Example {\n" +
13438 		"	int foo(int argument) {\n" +
13439 		"		for (\n" +
13440 		"				int counter = 0;\n" +
13441 		"				counter < argument;\n" +
13442 		"				counter++) {\n" +
13443 		"			doSomething(counter);\n" +
13444 		"		}\n" +
13445 		"	}\n" +
13446 		"}"
13447 	);
13448 }
13449 /**
13450  * https://bugs.eclipse.org/118264 - [formatter] Enable wrapping of for loop setup
13451  */
testBug118264d()13452 public void testBug118264d() {
13453 	this.formatterPrefs.alignment_for_expressions_in_for_loop_header = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
13454 	String source =
13455 		"class Example {\n" +
13456 		"	int foo(int argument) {\n" +
13457 		"		for (int counter = 0; ; ) {\n" +
13458 		"			doSomething(counter);\n" +
13459 		"		}\n" +
13460 		"	}\n" +
13461 		"}";
13462 	formatSource(source,
13463 		"class Example {\n" +
13464 		"	int foo(int argument) {\n" +
13465 		"		for (\n" +
13466 		"				int counter = 0;;) {\n" +
13467 		"			doSomething(counter);\n" +
13468 		"		}\n" +
13469 		"	}\n" +
13470 		"}"
13471 	);
13472 }
13473 /**
13474  * https://bugs.eclipse.org/118264 - [formatter] Enable wrapping of for loop setup
13475  */
testBug118264e()13476 public void testBug118264e() {
13477 	this.formatterPrefs.alignment_for_expressions_in_for_loop_header = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
13478 	String source =
13479 		"class Example {\n" +
13480 		"	int foo(int argument) {\n" +
13481 		"		for (;;argument--, argument--) {\n" +
13482 		"			doSomething(counter);\n" +
13483 		"		}\n" +
13484 		"	}\n" +
13485 		"}";
13486 	formatSource(source,
13487 		"class Example {\n" +
13488 		"	int foo(int argument) {\n" +
13489 		"		for (;;\n" +
13490 		"				argument--, argument--) {\n" +
13491 		"			doSomething(counter);\n" +
13492 		"		}\n" +
13493 		"	}\n" +
13494 		"}"
13495 	);
13496 }
13497 /**
13498  * https://bugs.eclipse.org/118264 - [formatter] Enable wrapping of for loop setup
13499  */
testBug118264f()13500 public void testBug118264f() {
13501 	this.formatterPrefs.alignment_for_expressions_in_for_loop_header = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
13502 	String source =
13503 		"class Example {\n" +
13504 		"	int foo(int argument) {\n" +
13505 		"		for (;;) {\n" +
13506 		"			doSomething(counter);\n" +
13507 		"		}\n" +
13508 		"	}\n" +
13509 		"}";
13510 	formatSource(source);
13511 }
13512 /**
13513  * https://bugs.eclipse.org/465910 - [formatter] add a 'wrap before operator' option for conditional expressions
13514  */
testBug465910()13515 public void testBug465910() {
13516 	this.formatterPrefs.alignment_for_conditional_expression = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
13517 	String source =
13518 		"class Example {\n" +
13519 		"	Result foo(boolean argument) {\n" +
13520 		"		return argument ? doOneThing() : doOtherThing();\n" +
13521 		"	}\n" +
13522 		"}";
13523 	formatSource(source,
13524 		"class Example {\n" +
13525 		"	Result foo(boolean argument) {\n" +
13526 		"		return argument\n" +
13527 		"				? doOneThing()\n" +
13528 		"				: doOtherThing();\n" +
13529 		"	}\n" +
13530 		"}"
13531 	);
13532 	this.formatterPrefs.wrap_before_conditional_operator = false;
13533 	formatSource(source,
13534 		"class Example {\n" +
13535 		"	Result foo(boolean argument) {\n" +
13536 		"		return argument ?\n" +
13537 		"				doOneThing() :\n" +
13538 		"				doOtherThing();\n" +
13539 		"	}\n" +
13540 		"}"
13541 	);
13542 }
13543 /**
13544  * https://bugs.eclipse.org/325631 - [formatter] Code formatter Expressions > Assignments lacks "Wrap before operator" option
13545  */
testBug325631()13546 public void testBug325631() {
13547 	this.formatterPrefs.alignment_for_assignment = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
13548 	String source =
13549 		"class Example {\n" +
13550 		"	String value = \"\";\n" +
13551 		"	void foo(boolean argument) {\n" +
13552 		"		if (\"test\".equals(value = artument))\n" +
13553 		"			doSomething();\n" +
13554 		"	}\n" +
13555 		"}";
13556 	formatSource(source,
13557 		"class Example {\n" +
13558 		"	String value =\n" +
13559 		"			\"\";\n" +
13560 		"\n" +
13561 		"	void foo(boolean argument) {\n" +
13562 		"		if (\"test\".equals(value =\n" +
13563 		"				artument))\n" +
13564 		"			doSomething();\n" +
13565 		"	}\n" +
13566 		"}");
13567 	this.formatterPrefs.wrap_before_assignment_operator = true;
13568 	formatSource(source,
13569 		"class Example {\n" +
13570 		"	String value\n" +
13571 		"			= \"\";\n" +
13572 		"\n" +
13573 		"	void foo(boolean argument) {\n" +
13574 		"		if (\"test\".equals(value\n" +
13575 		"				= artument))\n" +
13576 		"			doSomething();\n" +
13577 		"	}\n" +
13578 		"}"
13579 	);
13580 }
13581 /**
13582  * https://bugs.eclipse.org/370540 - [Formatter] New settings for parentheses positions
13583  */
testBug370540a()13584 public void testBug370540a() throws JavaModelException {
13585 	setComplianceLevel(CompilerOptions.VERSION_1_8);
13586 	String input = getCompilationUnit("Formatter", "", "test370540", "Example_in.java").getSource();
13587 	formatSource(input, getCompilationUnit("Formatter", "", "test370540", "Example_out01.java").getSource());
13588 }
13589 /**
13590  * https://bugs.eclipse.org/370540 - [Formatter] New settings for parentheses positions
13591  */
testBug370540b()13592 public void testBug370540b() throws JavaModelException {
13593 	setComplianceLevel(CompilerOptions.VERSION_1_8);
13594 	this.formatterPrefs.parenthesis_positions_in_method_declaration = DefaultCodeFormatterConstants.SEPARATE_LINES_IF_NOT_EMPTY;
13595 	String input = getCompilationUnit("Formatter", "", "test370540", "Example_in.java").getSource();
13596 	formatSource(input, getCompilationUnit("Formatter", "", "test370540", "Example_out02.java").getSource());
13597 }
13598 /**
13599  * https://bugs.eclipse.org/370540 - [Formatter] New settings for parentheses positions
13600  */
testBug370540c()13601 public void testBug370540c() throws JavaModelException {
13602 	setComplianceLevel(CompilerOptions.VERSION_1_8);
13603 	this.formatterPrefs.parenthesis_positions_in_method_declaration = DefaultCodeFormatterConstants.SEPARATE_LINES_IF_WRAPPED;
13604 	String input = getCompilationUnit("Formatter", "", "test370540", "Example_in.java").getSource();
13605 	formatSource(input, getCompilationUnit("Formatter", "", "test370540", "Example_out03.java").getSource());
13606 }
13607 /**
13608  * https://bugs.eclipse.org/370540 - [Formatter] New settings for parentheses positions
13609  */
testBug370540d()13610 public void testBug370540d() throws JavaModelException {
13611 	this.formatterPrefs.parenthesis_positions_in_method_declaration = DefaultCodeFormatterConstants.SEPARATE_LINES;
13612 	setComplianceLevel(CompilerOptions.VERSION_1_8);
13613 	String input = getCompilationUnit("Formatter", "", "test370540", "Example_in.java").getSource();
13614 	formatSource(input, getCompilationUnit("Formatter", "", "test370540", "Example_out04.java").getSource());
13615 }
13616 /**
13617  * https://bugs.eclipse.org/370540 - [Formatter] New settings for parentheses positions
13618  */
testBug370540e()13619 public void testBug370540e() throws JavaModelException {
13620 	setComplianceLevel(CompilerOptions.VERSION_1_8);
13621 	this.formatterPrefs.parenthesis_positions_in_method_invocation = DefaultCodeFormatterConstants.SEPARATE_LINES_IF_NOT_EMPTY;
13622 	String input = getCompilationUnit("Formatter", "", "test370540", "Example_in.java").getSource();
13623 	formatSource(input, getCompilationUnit("Formatter", "", "test370540", "Example_out05.java").getSource());
13624 }
13625 /**
13626  * https://bugs.eclipse.org/370540 - [Formatter] New settings for parentheses positions
13627  */
testBug370540f()13628 public void testBug370540f() throws JavaModelException {
13629 	setComplianceLevel(CompilerOptions.VERSION_1_8);
13630 	this.formatterPrefs.parenthesis_positions_in_method_invocation = DefaultCodeFormatterConstants.SEPARATE_LINES_IF_WRAPPED;
13631 	this.formatterPrefs.parenthesis_positions_in_enum_constant_declaration = DefaultCodeFormatterConstants.SEPARATE_LINES;
13632 	String input = getCompilationUnit("Formatter", "", "test370540", "Example_in.java").getSource();
13633 	formatSource(input, getCompilationUnit("Formatter", "", "test370540", "Example_out06.java").getSource());
13634 }
13635 /**
13636  * https://bugs.eclipse.org/370540 - [Formatter] New settings for parentheses positions
13637  */
testBug370540g()13638 public void testBug370540g() throws JavaModelException {
13639 	setComplianceLevel(CompilerOptions.VERSION_1_8);
13640 	this.formatterPrefs.parenthesis_positions_in_enum_constant_declaration = DefaultCodeFormatterConstants.SEPARATE_LINES_IF_NOT_EMPTY;
13641 	this.formatterPrefs.parenthesis_positions_in_if_while_statement = DefaultCodeFormatterConstants.SEPARATE_LINES;
13642 	String input = getCompilationUnit("Formatter", "", "test370540", "Example_in.java").getSource();
13643 	formatSource(input, getCompilationUnit("Formatter", "", "test370540", "Example_out07.java").getSource());
13644 }
13645 /**
13646  * https://bugs.eclipse.org/370540 - [Formatter] New settings for parentheses positions
13647  */
testBug370540h()13648 public void testBug370540h() throws JavaModelException {
13649 	setComplianceLevel(CompilerOptions.VERSION_1_8);
13650 	this.formatterPrefs.parenthesis_positions_in_if_while_statement = DefaultCodeFormatterConstants.SEPARATE_LINES_IF_WRAPPED;
13651 	this.formatterPrefs.parenthesis_positions_in_lambda_declaration = DefaultCodeFormatterConstants.SEPARATE_LINES_IF_NOT_EMPTY;
13652 	String input = getCompilationUnit("Formatter", "", "test370540", "Example_in.java").getSource();
13653 	formatSource(input, getCompilationUnit("Formatter", "", "test370540", "Example_out08.java").getSource());
13654 }
13655 /**
13656  * https://bugs.eclipse.org/370540 - [Formatter] New settings for parentheses positions
13657  */
testBug370540i()13658 public void testBug370540i() throws JavaModelException {
13659 	setComplianceLevel(CompilerOptions.VERSION_1_8);
13660 	this.formatterPrefs.parenthesis_positions_in_if_while_statement = DefaultCodeFormatterConstants.SEPARATE_LINES_IF_WRAPPED;
13661 	this.formatterPrefs.parenthesis_positions_in_method_invocation = DefaultCodeFormatterConstants.SEPARATE_LINES_IF_NOT_EMPTY;
13662 	String input = getCompilationUnit("Formatter", "", "test370540", "Example_in.java").getSource();
13663 	formatSource(input, getCompilationUnit("Formatter", "", "test370540", "Example_out09.java").getSource());
13664 }
13665 /**
13666  * https://bugs.eclipse.org/370540 - [Formatter] New settings for parentheses positions
13667  */
testBug370540j()13668 public void testBug370540j() throws JavaModelException {
13669 	setComplianceLevel(CompilerOptions.VERSION_1_8);
13670 	this.formatterPrefs.parenthesis_positions_in_try_clause = DefaultCodeFormatterConstants.SEPARATE_LINES;
13671 	this.formatterPrefs.parenthesis_positions_in_method_declaration = DefaultCodeFormatterConstants.PRESERVE_POSITIONS;
13672 	String input = getCompilationUnit("Formatter", "", "test370540", "Example_in.java").getSource();
13673 	formatSource(input, getCompilationUnit("Formatter", "", "test370540", "Example_out10.java").getSource());
13674 }
13675 /**
13676  * https://bugs.eclipse.org/370540 - [Formatter] New settings for parentheses positions
13677  */
testBug370540k()13678 public void testBug370540k() throws JavaModelException {
13679 	setComplianceLevel(CompilerOptions.VERSION_1_8);
13680 	this.formatterPrefs.parenthesis_positions_in_catch_clause = DefaultCodeFormatterConstants.SEPARATE_LINES;
13681 	this.formatterPrefs.parenthesis_positions_in_if_while_statement = DefaultCodeFormatterConstants.PRESERVE_POSITIONS;
13682 	String input = getCompilationUnit("Formatter", "", "test370540", "Example_in.java").getSource();
13683 	formatSource(input, getCompilationUnit("Formatter", "", "test370540", "Example_out11.java").getSource());
13684 }
13685 /**
13686  * https://bugs.eclipse.org/370540 - [Formatter] New settings for parentheses positions
13687  */
testBug370540l()13688 public void testBug370540l() throws JavaModelException {
13689 	setComplianceLevel(CompilerOptions.VERSION_1_8);
13690 	this.formatterPrefs.parenthesis_positions_in_for_statement = DefaultCodeFormatterConstants.SEPARATE_LINES_IF_WRAPPED;
13691 	this.formatterPrefs.parenthesis_positions_in_annotation = DefaultCodeFormatterConstants.SEPARATE_LINES_IF_NOT_EMPTY;
13692 	String input = getCompilationUnit("Formatter", "", "test370540", "Example_in.java").getSource();
13693 	formatSource(input, getCompilationUnit("Formatter", "", "test370540", "Example_out12.java").getSource());
13694 }
13695 /**
13696  * https://bugs.eclipse.org/370540 - [Formatter] New settings for parentheses positions
13697  */
testBug370540m()13698 public void testBug370540m() throws JavaModelException {
13699 	setComplianceLevel(CompilerOptions.VERSION_1_8);
13700 	this.formatterPrefs.parenthesis_positions_in_for_statement = DefaultCodeFormatterConstants.SEPARATE_LINES_IF_WRAPPED;
13701 	this.formatterPrefs.alignment_for_expressions_in_for_loop_header = Alignment.M_NEXT_PER_LINE_SPLIT + Alignment.M_FORCE;
13702 	String input = getCompilationUnit("Formatter", "", "test370540", "Example_in.java").getSource();
13703 	formatSource(input, getCompilationUnit("Formatter", "", "test370540", "Example_out13.java").getSource());
13704 }
13705 /**
13706  * https://bugs.eclipse.org/370540 - [Formatter] New settings for parentheses positions
13707  */
testBug370540n()13708 public void testBug370540n() throws JavaModelException {
13709 	setComplianceLevel(CompilerOptions.VERSION_1_8);
13710 	this.formatterPrefs.parenthesis_positions_in_switch_statement = DefaultCodeFormatterConstants.SEPARATE_LINES;
13711 	this.formatterPrefs.parenthesis_positions_in_annotation = DefaultCodeFormatterConstants.SEPARATE_LINES;
13712 	String input = getCompilationUnit("Formatter", "", "test370540", "Example_in.java").getSource();
13713 	formatSource(input, getCompilationUnit("Formatter", "", "test370540", "Example_out14.java").getSource());
13714 }
13715 /**
13716  * https://bugs.eclipse.org/370540 - [Formatter] New settings for parentheses positions
13717  */
testBug370540p()13718 public void testBug370540p() throws JavaModelException {
13719 	setComplianceLevel(CompilerOptions.VERSION_1_8);
13720 	this.formatterPrefs.parenthesis_positions_in_annotation = DefaultCodeFormatterConstants.SEPARATE_LINES;
13721 	this.formatterPrefs.parenthesis_positions_in_catch_clause = DefaultCodeFormatterConstants.SEPARATE_LINES;
13722 	this.formatterPrefs.parenthesis_positions_in_enum_constant_declaration = DefaultCodeFormatterConstants.SEPARATE_LINES;
13723 	this.formatterPrefs.parenthesis_positions_in_for_statement = DefaultCodeFormatterConstants.SEPARATE_LINES;
13724 	this.formatterPrefs.parenthesis_positions_in_if_while_statement = DefaultCodeFormatterConstants.SEPARATE_LINES;
13725 	this.formatterPrefs.parenthesis_positions_in_lambda_declaration = DefaultCodeFormatterConstants.SEPARATE_LINES;
13726 	this.formatterPrefs.parenthesis_positions_in_method_declaration = DefaultCodeFormatterConstants.SEPARATE_LINES;
13727 	this.formatterPrefs.parenthesis_positions_in_method_invocation = DefaultCodeFormatterConstants.SEPARATE_LINES;
13728 	this.formatterPrefs.parenthesis_positions_in_switch_statement = DefaultCodeFormatterConstants.SEPARATE_LINES;
13729 	this.formatterPrefs.parenthesis_positions_in_try_clause = DefaultCodeFormatterConstants.SEPARATE_LINES;
13730 	String input = getCompilationUnit("Formatter", "", "test370540", "Example_in.java").getSource();
13731 	formatSource(input, getCompilationUnit("Formatter", "", "test370540", "Example_out15.java").getSource());
13732 }
13733 /**
13734  * https://bugs.eclipse.org/370540 - [Formatter] New settings for parentheses positions
13735  */
testBug370540q()13736 public void testBug370540q() throws JavaModelException {
13737 	this.formatterPrefs.parenthesis_positions_in_for_statement = DefaultCodeFormatterConstants.SEPARATE_LINES;
13738 	String source =
13739 		"public class Test {\n" +
13740 		"	void foo() {\n" +
13741 		"		for (\n" +
13742 		"			String s : Arrays.asList(\"aa\")\n" +
13743 		"		) {\n" +
13744 		"		}\n" +
13745 		"	}\n" +
13746 		"}";
13747 	formatSource(source);
13748 }
13749 /**
13750  * https://bugs.eclipse.org/370540 - [Formatter] New settings for parentheses positions
13751  */
testBug370540r()13752 public void testBug370540r() throws JavaModelException {
13753 	this.formatterPrefs.parenthesis_positions_in_method_invocation = DefaultCodeFormatterConstants.SEPARATE_LINES;
13754 	String source =
13755 		"public class Test extends Exception {\n" +
13756 		"	Test instance = new Test(\n" +
13757 		"			1\n" +
13758 		"	);\n" +
13759 		"\n" +
13760 		"	Test(int a) {\n" +
13761 		"		this(\n" +
13762 		"				a, 0\n" +
13763 		"		);\n" +
13764 		"	}\n" +
13765 		"\n" +
13766 		"	Test(int a, int b) {\n" +
13767 		"		super(\n" +
13768 		"				a + \"=\" + b\n" +
13769 		"		);\n" +
13770 		"	}\n" +
13771 		"\n" +
13772 		"	public void printStackTrace() {\n" +
13773 		"		super.printStackTrace(\n" +
13774 		"		);\n" +
13775 		"	}\n" +
13776 		"}";
13777 	formatSource(source);
13778 }
13779 /**
13780  * https://bugs.eclipse.org/370540 - [Formatter] New settings for parentheses positions
13781  */
testBug370540s()13782 public void testBug370540s() throws JavaModelException {
13783 	this.formatterPrefs.parenthesis_positions_in_method_invocation = DefaultCodeFormatterConstants.SEPARATE_LINES_IF_WRAPPED;
13784 	String source =
13785 		"public class Test extends Exception {\n" +
13786 		"	void foo() {\n" +
13787 		"		new StringBuilder().append(\"aaaaaaaaa\" + \"bbbbbbbbbbbbbbb\" + \"cccccccccccccc\" + \"dddddddddd\")\n" +
13788 		"				.append(\"aaaaaaa\" + \"bbbbbbbbbbbbb\" + \"cccccccccccccc\" + \"ddddddddd\");\n" +
13789 		"	}\n" +
13790 		"}";
13791 	formatSource(source);
13792 }
13793 /**
13794  * https://bugs.eclipse.org/384959 - [formatter] Add line wrapping options for generics
13795  */
testBug384959a()13796 public void testBug384959a() throws JavaModelException {
13797 	setComplianceLevel(CompilerOptions.VERSION_1_8);
13798 	String input = getCompilationUnit("Formatter", "", "test384959", "A_in.java").getSource();
13799 	formatSource(input, getCompilationUnit("Formatter", "", "test384959", "A_out1.java").getSource());
13800 }
13801 /**
13802  * https://bugs.eclipse.org/384959 - [formatter] Add line wrapping options for generics
13803  */
testBug384959b()13804 public void testBug384959b() throws JavaModelException {
13805 	setComplianceLevel(CompilerOptions.VERSION_1_8);
13806 	this.formatterPrefs.alignment_for_parameterized_type_references = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
13807 	String input = getCompilationUnit("Formatter", "", "test384959", "A_in.java").getSource();
13808 	formatSource(input, getCompilationUnit("Formatter", "", "test384959", "A_out2.java").getSource());
13809 }
13810 /**
13811  * https://bugs.eclipse.org/384959 - [formatter] Add line wrapping options for generics
13812  */
testBug384959c()13813 public void testBug384959c() throws JavaModelException {
13814 	setComplianceLevel(CompilerOptions.VERSION_1_8);
13815 	this.formatterPrefs.alignment_for_type_arguments = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
13816 	String input = getCompilationUnit("Formatter", "", "test384959", "A_in.java").getSource();
13817 	formatSource(input, getCompilationUnit("Formatter", "", "test384959", "A_out3.java").getSource());
13818 }
13819 /**
13820  * https://bugs.eclipse.org/384959 - [formatter] Add line wrapping options for generics
13821  */
testBug384959d()13822 public void testBug384959d() throws JavaModelException {
13823 	setComplianceLevel(CompilerOptions.VERSION_1_8);
13824 	this.formatterPrefs.alignment_for_type_parameters = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
13825 	String input = getCompilationUnit("Formatter", "", "test384959", "A_in.java").getSource();
13826 	formatSource(input, getCompilationUnit("Formatter", "", "test384959", "A_out4.java").getSource());
13827 }
13828 /**
13829  * https://bugs.eclipse.org/384959 - [formatter] Add line wrapping options for generics
13830  */
testBug384959e()13831 public void testBug384959e() throws JavaModelException {
13832 	setComplianceLevel(CompilerOptions.VERSION_1_8);
13833 	int policy = Alignment.M_NEXT_SHIFTED_SPLIT + Alignment.M_FORCE;
13834 	this.formatterPrefs.alignment_for_parameterized_type_references = policy;
13835 	this.formatterPrefs.alignment_for_type_arguments = policy;
13836 	this.formatterPrefs.alignment_for_type_parameters = policy;
13837 	String input = getCompilationUnit("Formatter", "", "test384959", "A_in.java").getSource();
13838 	formatSource(input, getCompilationUnit("Formatter", "", "test384959", "A_out5.java").getSource());
13839 }
13840 /**
13841  * https://bugs.eclipse.org/384959 - [formatter] Add line wrapping options for generics
13842  */
testBug384959f()13843 public void testBug384959f() throws JavaModelException {
13844 	setComplianceLevel(CompilerOptions.VERSION_1_8);
13845 	this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
13846 	int policy = Alignment.M_NEXT_PER_LINE_SPLIT + Alignment.M_INDENT_ON_COLUMN + Alignment.M_FORCE;
13847 	this.formatterPrefs.alignment_for_parameterized_type_references = policy;
13848 	this.formatterPrefs.alignment_for_type_arguments = policy;
13849 	this.formatterPrefs.alignment_for_type_parameters = policy;
13850 	String input = getCompilationUnit("Formatter", "", "test384959", "A_in.java").getSource();
13851 	formatSource(input, getCompilationUnit("Formatter", "", "test384959", "A_out6.java").getSource());
13852 }
13853 /**
13854  * https://bugs.eclipse.org/384959 - [formatter] Add line wrapping options for generics
13855  */
testBug384959g()13856 public void testBug384959g() throws JavaModelException {
13857 	setComplianceLevel(CompilerOptions.VERSION_1_8);
13858 	this.formatterPrefs.alignment_for_type_parameters = Alignment.M_COMPACT_SPLIT;
13859 	String source =
13860 		"public interface IteratedDescribeLinkList<\n" +
13861 		"		T extends IteratedDescribeLinkList<T, E, A, B, C, D, F, G, H, I, X, Y, Z, J, K>, E extends IteratedDescribeLink,\n" +
13862 		"		A extends Iterated, B extends Iterated, C extends IteratedList<C, A, F, H, Y, J>,\n" +
13863 		"		D extends IteratedList<D, B, G, I, Z, K>, F extends MasteredList<F, H, C, A, J, Y>,\n" +
13864 		"		G extends MasteredList<G, I, D, B, K, Z>, H extends Mastered, I extends Mastered, X extends T, Y extends C,\n" +
13865 		"		Z extends D, J extends F, K extends G> extends ObjectToObjectLinkList<T, E, A, B, C, D, X, Y, Z> {\n" +
13866 		"}";
13867 	formatSource(source);
13868 }
13869 /**
13870  * https://bugs.eclipse.org/488642 - [formatter] IOOBE with block comment inside anonymous class
13871  */
testBug488642a()13872 public void testBug488642a() {
13873 	this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
13874 	String source =
13875 		"public class Test {\n" +
13876 		"	Object o = new Object() {\n" +
13877 		"		int a = 0;\n" +
13878 		"		/*\n" +
13879 		"		 * comment\n" +
13880 		"		 */\n" +
13881 		"		int b = 9; /*\n" +
13882 		"		            * comment\n" +
13883 		"		            */\n" +
13884 		"		String ssssssss = \"aaaaaaaaaaaaaaaaaaaaaaaa\" //\n" +
13885 		"		        + \"ddddddddddddddddddddddd\" /*\n" +
13886 		"		                                     * comment\n" +
13887 		"		                                     */;\n" +
13888 		"	};\n" +
13889 		"}";
13890 	formatSource(source);
13891 }
13892 /**
13893  * https://bugs.eclipse.org/488642 - [formatter] IOOBE with block comment inside anonymous class
13894  */
testBug488642b()13895 public void testBug488642b() {
13896 	this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
13897 	this.formatterPrefs.align_type_members_on_columns = true;
13898 	String source =
13899 		"public class Test {\n" +
13900 		"	Object o = new Object() {\n" +
13901 		"		int		a			= 0;\n" +
13902 		"		/*\n" +
13903 		"		 * comment\n" +
13904 		"		 */\n" +
13905 		"		int		b			= 9;							/*\n" +
13906 		"		                                                     * comment\n" +
13907 		"		                                                     */\n" +
13908 		"		String	ssssssss	= \"aaaaaaaaaaaaaaaaaaaaaaaa\"	//\n" +
13909 		"		        + \"ddddddddddddddddddddddd\" /*\n" +
13910 		"		                                     * comment\n" +
13911 		"		                                     */;\n" +
13912 		"	};\n" +
13913 		"}";
13914 	formatSource(source);
13915 }
13916 /**
13917  * https://bugs.eclipse.org/493296 - Eclipse formatter hangs when formatting with formatter.join_wrapped_lines=true
13918  */
testBug493296()13919 public void testBug493296() throws JavaModelException {
13920 	setPageWidth80();
13921 	String input = getCompilationUnit("Formatter", "", "test493296", "A_in.java").getSource();
13922 	formatSource(input, getCompilationUnit("Formatter", "", "test493296", "A_out.java").getSource());
13923 }
13924 /**
13925  * https://bugs.eclipse.org/362260 - [formatter] New feature: count comment width from starting position
13926  */
testBug362260a()13927 public void testBug362260a() throws JavaModelException {
13928 	setPageWidth80();
13929 	setFormatLineCommentOnFirstColumn();
13930 	this.formatterPrefs.comment_line_length = 40;
13931 	this.formatterPrefs.comment_format_header = true;
13932 	this.formatterPrefs.comment_count_line_length_from_starting_position = true;
13933 	String input = getCompilationUnit("Formatter", "", "test362260", "A_in.java").getSource();
13934 	formatSource(input, getCompilationUnit("Formatter", "", "test362260", "A_out.java").getSource());
13935 }
13936 /**
13937  * https://bugs.eclipse.org/362260 - [formatter] New feature: count comment width from starting position
13938  */
testBug362260b()13939 public void testBug362260b() throws JavaModelException {
13940 	setPageWidth80();
13941 	this.formatterPrefs.comment_line_length = 40;
13942 	this.formatterPrefs.comment_format_header = true;
13943 	this.formatterPrefs.comment_count_line_length_from_starting_position = true;
13944 	String input = getCompilationUnit("Formatter", "", "test362260", "B_in.java").getSource();
13945 	formatSource(input, getCompilationUnit("Formatter", "", "test362260", "B_out.java").getSource());
13946 }
13947 /**
13948  * https://bugs.eclipse.org/362260 - [formatter] New feature: count comment width from starting position
13949  */
testBug362260c()13950 public void testBug362260c() throws JavaModelException {
13951 	setPageWidth80();
13952 	this.formatterPrefs.comment_line_length = 40;
13953 	this.formatterPrefs.comment_format_header = true;
13954 	this.formatterPrefs.comment_count_line_length_from_starting_position = true;
13955 	this.formatterPrefs.comment_new_lines_at_block_boundaries = false;
13956 	String input = getCompilationUnit("Formatter", "", "test362260", "C_in.java").getSource();
13957 	formatSource(input, getCompilationUnit("Formatter", "", "test362260", "C_out.java").getSource());
13958 }
13959 /**
13960  * https://bugs.eclipse.org/362260 - [formatter] New feature: count comment width from starting position
13961  */
testBug362260d()13962 public void testBug362260d() throws JavaModelException {
13963 	setPageWidth80();
13964 	this.formatterPrefs.comment_line_length = 40;
13965 	this.formatterPrefs.comment_format_header = true;
13966 	this.formatterPrefs.comment_count_line_length_from_starting_position = true;
13967 	String input = getCompilationUnit("Formatter", "", "test362260", "D_in.java").getSource();
13968 	formatSource(input, getCompilationUnit("Formatter", "", "test362260", "D_out.java").getSource());
13969 }
13970 /**
13971  * https://bugs.eclipse.org/362260 - [formatter] New feature: count comment width from starting position
13972  */
testBug362260e()13973 public void testBug362260e() throws JavaModelException {
13974 	setPageWidth80();
13975 	this.formatterPrefs.comment_line_length = 40;
13976 	this.formatterPrefs.comment_format_header = true;
13977 	this.formatterPrefs.comment_count_line_length_from_starting_position = true;
13978 	this.formatterPrefs.comment_new_lines_at_javadoc_boundaries = false;
13979 	String input = getCompilationUnit("Formatter", "", "test362260", "E_in.java").getSource();
13980 	formatSource(input, getCompilationUnit("Formatter", "", "test362260", "E_out.java").getSource());
13981 }
13982 /**
13983  * https://bugs.eclipse.org/362260 - [formatter] New feature: count comment width from starting position
13984  */
testBug362260f()13985 public void testBug362260f() throws JavaModelException {
13986 	setPageWidth80();
13987 	this.formatterPrefs.comment_line_length = 40;
13988 	this.formatterPrefs.comment_count_line_length_from_starting_position = true;
13989 	this.formatterPrefs.comment_preserve_white_space_between_code_and_line_comments = true;
13990 	String input = getCompilationUnit("Formatter", "", "test362260", "F_in.java").getSource();
13991 	formatSource(input, getCompilationUnit("Formatter", "", "test362260", "F_out.java").getSource());
13992 }
13993 /**
13994  * https://bugs.eclipse.org/362260 - [formatter] New feature: count comment width from starting position
13995  */
testBug362260g()13996 public void testBug362260g() throws JavaModelException {
13997 	setPageWidth80();
13998 	this.formatterPrefs.comment_line_length = 40;
13999 	this.formatterPrefs.comment_format_header = true;
14000 	this.formatterPrefs.comment_count_line_length_from_starting_position = true;
14001 	String input = getCompilationUnit("Formatter", "", "test362260", "G_in.java").getSource();
14002 	formatSource(input, getCompilationUnit("Formatter", "", "test362260", "G_out.java").getSource());
14003 }
14004 /**
14005  * https://bugs.eclipse.org/506430 - [1.9] Formatter support for module-info.java
14006  */
testBug506430a()14007 public void testBug506430a() throws JavaModelException {
14008 	setComplianceLevel(CompilerOptions.VERSION_9);
14009 	setPageWidth80();
14010 	String input = getCompilationUnit("Formatter", "", "test506430", "A_in.java").getSource();
14011 	formatSource(input, getCompilationUnit("Formatter", "", "test506430", "A_out.java") .getSource(),
14012 			CodeFormatter.K_MODULE_INFO | CodeFormatter.F_INCLUDE_COMMENTS);
14013 }
14014 /**
14015  * https://bugs.eclipse.org/506430 - [1.9] Formatter support for module-info.java
14016  */
testBug506430b()14017 public void testBug506430b() throws JavaModelException {
14018 	setComplianceLevel(CompilerOptions.VERSION_9);
14019 	setPageWidth80();
14020 	this.formatterPrefs.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
14021 	this.formatterPrefs.blank_lines_before_new_chunk = 2;
14022 	this.formatterPrefs.blank_lines_before_first_class_body_declaration = 3;
14023 	this.formatterPrefs.blank_lines_before_field = 1;
14024 	this.formatterPrefs.indent_body_declarations_compare_to_type_header = false;
14025 	this.formatterPrefs.insert_space_before_comma_in_multiple_field_declarations = true;
14026 	this.formatterPrefs.alignment_for_module_statements = Alignment.M_NEXT_PER_LINE_SPLIT;
14027 	this.formatterPrefs.insert_new_line_at_end_of_file_if_missing = true;
14028 	String input = getCompilationUnit("Formatter", "", "test506430", "B_in.java").getSource();
14029 	formatSource(input, getCompilationUnit("Formatter", "", "test506430", "B_out.java") .getSource(),
14030 			CodeFormatter.K_MODULE_INFO | CodeFormatter.F_INCLUDE_COMMENTS);
14031 }
14032 /**
14033  * https://bugs.eclipse.org/506430 - [1.9] Formatter support for module-info.java
14034  */
testBug506430c()14035 public void testBug506430c() throws JavaModelException {
14036 	setComplianceLevel(CompilerOptions.VERSION_9);
14037 	setPageWidth80();
14038 	String input = getCompilationUnit("Formatter", "", "test506430", "A_in.java").getSource();
14039 	formatSource(input, getCompilationUnit("Formatter", "", "test506430", "A_out.java") .getSource(),
14040 			CodeFormatter.K_UNKNOWN | CodeFormatter.F_INCLUDE_COMMENTS);
14041 }
14042 
14043 /**
14044  * https://bugs.eclipse.org/518235 - [1.8][formatter] Receiver parameter breaks whitespace rule
14045  */
testBug518235()14046 public void testBug518235() throws JavaModelException {
14047 	String source =
14048 		"public class Base<T> {\n" +
14049 		"	class Base2 {\n" +
14050 		"		Base2(Base<T> Base.this) {\n" +
14051 		"		}\n" +
14052 		"	}\n" +
14053 		"\n" +
14054 		"	T foo(@Deprecated Base<T> this, final Base<T> bar1, final Base<T> bar2) {\n" +
14055 		"	}\n" +
14056 		"}";
14057 	formatSource(source);
14058 }
14059 
14060 /**
14061  * https://bugs.eclipse.org/128653 - [formatter] Improve tag description indentation in javadoc
14062  */
testBug128653a()14063 public void testBug128653a() throws JavaModelException {
14064 	this.formatterPrefs.comment_indent_root_tags = false;
14065 	this.formatterPrefs.comment_align_tags_names_descriptions = false;
14066 	this.formatterPrefs.comment_align_tags_descriptions_grouped = false;
14067 	this.formatterPrefs.comment_indent_parameter_description = false;
14068 	this.formatterPrefs.comment_insert_new_line_for_parameter = false;
14069 	String input = getCompilationUnit("Formatter", "", "test128653", "in.java").getSource();
14070 	formatSource(input, getCompilationUnit("Formatter", "", "test128653", "A_out.java").getSource());
14071 }
14072 /**
14073  * https://bugs.eclipse.org/128653 - [formatter] Improve tag description indentation in javadoc
14074  */
testBug128653b()14075 public void testBug128653b() throws JavaModelException {
14076 	this.formatterPrefs.comment_indent_root_tags = true;
14077 	this.formatterPrefs.comment_align_tags_names_descriptions = false;
14078 	this.formatterPrefs.comment_align_tags_descriptions_grouped = false;
14079 	this.formatterPrefs.comment_indent_parameter_description = false;
14080 	this.formatterPrefs.comment_insert_new_line_for_parameter = false;
14081 	String input = getCompilationUnit("Formatter", "", "test128653", "in.java").getSource();
14082 	formatSource(input, getCompilationUnit("Formatter", "", "test128653", "B_out.java").getSource());
14083 }
14084 /**
14085  * https://bugs.eclipse.org/128653 - [formatter] Improve tag description indentation in javadoc
14086  */
testBug128653c()14087 public void testBug128653c() throws JavaModelException {
14088 	this.formatterPrefs.comment_indent_root_tags = false;
14089 	this.formatterPrefs.comment_align_tags_names_descriptions = true;
14090 	this.formatterPrefs.comment_align_tags_descriptions_grouped = false;
14091 	this.formatterPrefs.comment_indent_parameter_description = false;
14092 	this.formatterPrefs.comment_insert_new_line_for_parameter = false;
14093 	String input = getCompilationUnit("Formatter", "", "test128653", "in.java").getSource();
14094 	formatSource(input, getCompilationUnit("Formatter", "", "test128653", "C_out.java").getSource());
14095 }
14096 /**
14097  * https://bugs.eclipse.org/128653 - [formatter] Improve tag description indentation in javadoc
14098  */
testBug128653d()14099 public void testBug128653d() throws JavaModelException {
14100 	this.formatterPrefs.comment_indent_root_tags = false;
14101 	this.formatterPrefs.comment_align_tags_names_descriptions = false;
14102 	this.formatterPrefs.comment_align_tags_descriptions_grouped = true;
14103 	this.formatterPrefs.comment_indent_parameter_description = false;
14104 	this.formatterPrefs.comment_insert_new_line_for_parameter = false;
14105 	String input = getCompilationUnit("Formatter", "", "test128653", "in.java").getSource();
14106 	formatSource(input, getCompilationUnit("Formatter", "", "test128653", "D_out.java").getSource());
14107 }
14108 /**
14109  * https://bugs.eclipse.org/128653 - [formatter] Improve tag description indentation in javadoc
14110  */
testBug128653e()14111 public void testBug128653e() throws JavaModelException {
14112 	this.formatterPrefs.comment_indent_root_tags = false;
14113 	this.formatterPrefs.comment_align_tags_names_descriptions = true;
14114 	this.formatterPrefs.comment_align_tags_descriptions_grouped = false;
14115 	this.formatterPrefs.comment_indent_parameter_description = true;
14116 	this.formatterPrefs.comment_insert_new_line_for_parameter = false;
14117 	String input = getCompilationUnit("Formatter", "", "test128653", "in.java").getSource();
14118 	formatSource(input, getCompilationUnit("Formatter", "", "test128653", "E_out.java").getSource());
14119 }
14120 /**
14121  * https://bugs.eclipse.org/128653 - [formatter] Improve tag description indentation in javadoc
14122  */
testBug128653f()14123 public void testBug128653f() throws JavaModelException {
14124 	this.formatterPrefs.comment_indent_root_tags = false;
14125 	this.formatterPrefs.comment_align_tags_names_descriptions = true;
14126 	this.formatterPrefs.comment_align_tags_descriptions_grouped = false;
14127 	this.formatterPrefs.comment_indent_parameter_description = false;
14128 	this.formatterPrefs.comment_insert_new_line_for_parameter = true;
14129 	String input = getCompilationUnit("Formatter", "", "test128653", "in.java").getSource();
14130 	formatSource(input, getCompilationUnit("Formatter", "", "test128653", "F_out.java").getSource());
14131 }
14132 /**
14133  * https://bugs.eclipse.org/128653 - [formatter] Improve tag description indentation in javadoc
14134  */
testBug128653g()14135 public void testBug128653g() throws JavaModelException {
14136 	this.formatterPrefs.comment_indent_root_tags = false;
14137 	this.formatterPrefs.comment_align_tags_names_descriptions = false;
14138 	this.formatterPrefs.comment_align_tags_descriptions_grouped = true;
14139 	this.formatterPrefs.comment_indent_parameter_description = true;
14140 	this.formatterPrefs.comment_insert_new_line_for_parameter = true;
14141 	String input = getCompilationUnit("Formatter", "", "test128653", "in.java").getSource();
14142 	formatSource(input, getCompilationUnit("Formatter", "", "test128653", "G_out.java").getSource());
14143 }
14144 /**
14145  * https://bugs.eclipse.org/128653 - [formatter] Improve tag description indentation in javadoc
14146  */
testBug128653h()14147 public void testBug128653h() throws JavaModelException {
14148 	this.formatterPrefs.comment_indent_root_tags = false;
14149 	this.formatterPrefs.comment_align_tags_names_descriptions = false;
14150 	this.formatterPrefs.comment_align_tags_descriptions_grouped = false;
14151 	this.formatterPrefs.comment_indent_parameter_description = true;
14152 	this.formatterPrefs.comment_insert_new_line_for_parameter = true;
14153 	String input = getCompilationUnit("Formatter", "", "test128653", "in.java").getSource();
14154 	formatSource(input, getCompilationUnit("Formatter", "", "test128653", "H_out.java").getSource());
14155 }
14156 /**
14157  * https://bugs.eclipse.org/128653 - [formatter] Improve tag description indentation in javadoc
14158  */
testBug128653i()14159 public void testBug128653i() throws JavaModelException {
14160 	this.formatterPrefs.comment_indent_root_tags = true;
14161 	this.formatterPrefs.comment_align_tags_names_descriptions = false;
14162 	this.formatterPrefs.comment_align_tags_descriptions_grouped = false;
14163 	this.formatterPrefs.comment_indent_parameter_description = true;
14164 	this.formatterPrefs.comment_insert_new_line_for_parameter = false;
14165 	String input = getCompilationUnit("Formatter", "", "test128653", "in.java").getSource();
14166 	formatSource(input, getCompilationUnit("Formatter", "", "test128653", "I_out.java").getSource());
14167 }
14168 
14169 /**
14170  * https://bugs.eclipse.org/104910 - [formatter] add "keep simple for/while on one line" option
14171  */
testBug104910a()14172 public void testBug104910a() throws JavaModelException {
14173 	this.formatterPrefs.keep_simple_for_body_on_same_line = true;
14174 	String input = getCompilationUnit("Formatter", "", "test104910", "in.java").getSource();
14175 	formatSource(input, getCompilationUnit("Formatter", "", "test104910", "A_out.java").getSource());
14176 }
14177 /**
14178  * https://bugs.eclipse.org/104910 - [formatter] add "keep simple for/while on one line" option
14179  */
testBug104910b()14180 public void testBug104910b() throws JavaModelException {
14181 	this.formatterPrefs.keep_simple_while_body_on_same_line = true;
14182 	String input = getCompilationUnit("Formatter", "", "test104910", "in.java").getSource();
14183 	formatSource(input, getCompilationUnit("Formatter", "", "test104910", "B_out.java").getSource());
14184 }
14185 /**
14186  * https://bugs.eclipse.org/104910 - [formatter] add "keep simple for/while on one line" option
14187  */
testBug104910c()14188 public void testBug104910c() throws JavaModelException {
14189 	this.formatterPrefs.keep_simple_do_while_body_on_same_line = true;
14190 	String input = getCompilationUnit("Formatter", "", "test104910", "in.java").getSource();
14191 	formatSource(input, getCompilationUnit("Formatter", "", "test104910", "C_out.java").getSource());
14192 }
14193 /**
14194  * https://bugs.eclipse.org/104910 - [formatter] add "keep simple for/while on one line" option
14195  */
testBug104910d()14196 public void testBug104910d() throws JavaModelException {
14197 	this.formatterPrefs.keep_simple_for_body_on_same_line = true;
14198 	this.formatterPrefs.keep_simple_while_body_on_same_line = true;
14199 	this.formatterPrefs.keep_simple_do_while_body_on_same_line = true;
14200 	this.formatterPrefs.keep_simple_if_on_one_line = true;
14201 	this.formatterPrefs.alignment_for_compact_if = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
14202 	this.formatterPrefs.alignment_for_compact_loop = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
14203 	this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
14204 	String input = getCompilationUnit("Formatter", "", "test104910", "in.java").getSource();
14205 	formatSource(input, getCompilationUnit("Formatter", "", "test104910", "D_out.java").getSource());
14206 }
14207 /**
14208  * https://bugs.eclipse.org/104910 - [formatter] add "keep simple for/while on one line" option
14209  */
testBug104910e()14210 public void testBug104910e() throws JavaModelException {
14211 	this.formatterPrefs.keep_simple_for_body_on_same_line = true;
14212 	this.formatterPrefs.keep_simple_while_body_on_same_line = true;
14213 	this.formatterPrefs.keep_simple_do_while_body_on_same_line = true;
14214 	this.formatterPrefs.keep_simple_if_on_one_line = true;
14215 	this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
14216 	this.formatterPrefs.page_width = 55;
14217 	String input = getCompilationUnit("Formatter", "", "test104910", "in.java").getSource();
14218 	formatSource(input, getCompilationUnit("Formatter", "", "test104910", "E_out.java").getSource());
14219 }
14220 /**
14221  * https://bugs.eclipse.org/104910 - [formatter] add "keep simple for/while on one line" option
14222  */
testBug104910f()14223 public void testBug104910f() throws JavaModelException {
14224 	this.formatterPrefs.keep_simple_for_body_on_same_line = true;
14225 	this.formatterPrefs.keep_simple_while_body_on_same_line = true;
14226 	this.formatterPrefs.keep_simple_do_while_body_on_same_line = true;
14227 	this.formatterPrefs.keep_simple_if_on_one_line = true;
14228 	this.formatterPrefs.alignment_for_compact_if = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE + Alignment.M_INDENT_ON_COLUMN;
14229 	this.formatterPrefs.alignment_for_compact_loop = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE + Alignment.M_INDENT_ON_COLUMN;
14230 	this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
14231 	String input = getCompilationUnit("Formatter", "", "test104910", "in.java").getSource();
14232 	formatSource(input, getCompilationUnit("Formatter", "", "test104910", "F_out.java").getSource());
14233 }
14234 /**
14235  * https://bugs.eclipse.org/104910 - [formatter] add "keep simple for/while on one line" option
14236  */
testBug104910g()14237 public void testBug104910g() throws JavaModelException {
14238 	this.formatterPrefs.keep_simple_for_body_on_same_line = true;
14239 	this.formatterPrefs.keep_simple_while_body_on_same_line = true;
14240 	this.formatterPrefs.keep_simple_do_while_body_on_same_line = true;
14241 	this.formatterPrefs.keep_simple_if_on_one_line = true;
14242 	this.formatterPrefs.alignment_for_compact_if = Alignment.M_NO_ALIGNMENT;
14243 	this.formatterPrefs.page_width = 40;
14244 	String input = getCompilationUnit("Formatter", "", "test104910", "in.java").getSource();
14245 	formatSource(input, getCompilationUnit("Formatter", "", "test104910", "G_out.java").getSource());
14246 }
14247 
14248 /**
14249  * https://bugs.eclipse.org/530756 - [formatter] Align fields in columns: add option to use spaces
14250  */
testBug530756a()14251 public void testBug530756a() throws JavaModelException {
14252 	this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.TAB;
14253 	this.formatterPrefs.align_type_members_on_columns = true;
14254 	String input = getCompilationUnit("Formatter", "", "test530756", "in.java").getSource();
14255 	formatSource(input, getCompilationUnit("Formatter", "", "test530756", "A_out.java").getSource());
14256 }
14257 /**
14258  * https://bugs.eclipse.org/530756 - [formatter] Align fields in columns: add option to use spaces
14259  */
testBug530756b()14260 public void testBug530756b() throws JavaModelException {
14261 	this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.TAB;
14262 	this.formatterPrefs.align_type_members_on_columns = true;
14263 	this.formatterPrefs.align_with_spaces = true;
14264 	String input = getCompilationUnit("Formatter", "", "test530756", "in.java").getSource();
14265 	formatSource(input, getCompilationUnit("Formatter", "", "test530756", "B_out.java").getSource());
14266 }
14267 /**
14268  * https://bugs.eclipse.org/530756 - [formatter] Align fields in columns: add option to use spaces
14269  */
testBug530756c()14270 public void testBug530756c() throws JavaModelException {
14271 	this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.MIXED;
14272 	this.formatterPrefs.indentation_size = 6;
14273 	this.formatterPrefs.align_type_members_on_columns = true;
14274 	this.formatterPrefs.align_with_spaces = true;
14275 	String input = getCompilationUnit("Formatter", "", "test530756", "in.java").getSource();
14276 	formatSource(input, getCompilationUnit("Formatter", "", "test530756", "C_out.java").getSource());
14277 }
14278 /**
14279  * https://bugs.eclipse.org/530756 - [formatter] Align fields in columns: add option to use spaces
14280  */
testBug530756d()14281 public void testBug530756d() throws JavaModelException {
14282 	this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
14283 	this.formatterPrefs.align_type_members_on_columns = true;
14284 	this.formatterPrefs.align_with_spaces = true;
14285 	String input = getCompilationUnit("Formatter", "", "test530756", "in.java").getSource();
14286 	formatSource(input, getCompilationUnit("Formatter", "", "test530756", "D_out.java").getSource());
14287 }
14288 /**
14289  * https://bugs.eclipse.org/530756 - [formatter] Align fields in columns: add option to use spaces
14290  */
testBug530756e()14291 public void testBug530756e() throws JavaModelException {
14292 	this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
14293 	this.formatterPrefs.align_type_members_on_columns = true;
14294 	this.formatterPrefs.align_with_spaces = false;
14295 	String input = getCompilationUnit("Formatter", "", "test530756", "in.java").getSource();
14296 	formatSource(input, getCompilationUnit("Formatter", "", "test530756", "E_out.java").getSource());
14297 }
14298 
14299 /**
14300  * https://bugs.eclipse.org/131292 - [format] align assignments in columns
14301  */
testBug131292a()14302 public void testBug131292a() throws JavaModelException {
14303 	this.formatterPrefs.align_type_members_on_columns = true;
14304 	String input = getCompilationUnit("Formatter", "", "test131292", "in.java").getSource();
14305 	formatSource(input, getCompilationUnit("Formatter", "", "test131292", "A_out.java").getSource());
14306 }
14307 /**
14308  * https://bugs.eclipse.org/131292 - [format] align assignments in columns
14309  */
testBug131292b()14310 public void testBug131292b() throws JavaModelException {
14311 	this.formatterPrefs.align_variable_declarations_on_columns = true;
14312 	String input = getCompilationUnit("Formatter", "", "test131292", "in.java").getSource();
14313 	formatSource(input, getCompilationUnit("Formatter", "", "test131292", "B_out.java").getSource());
14314 }
14315 /**
14316  * https://bugs.eclipse.org/131292 - [format] align assignments in columns
14317  */
testBug131292c()14318 public void testBug131292c() throws JavaModelException {
14319 	this.formatterPrefs.align_assignment_statements_on_columns = true;
14320 	String input = getCompilationUnit("Formatter", "", "test131292", "in.java").getSource();
14321 	formatSource(input, getCompilationUnit("Formatter", "", "test131292", "C_out.java").getSource());
14322 }
14323 /**
14324  * https://bugs.eclipse.org/131292 - [format] align assignments in columns
14325  */
testBug131292d()14326 public void testBug131292d() throws JavaModelException {
14327 	this.formatterPrefs.align_type_members_on_columns = true;
14328 	this.formatterPrefs.align_variable_declarations_on_columns = true;
14329 	this.formatterPrefs.align_assignment_statements_on_columns = true;
14330 	this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
14331 	String input = getCompilationUnit("Formatter", "", "test131292", "in.java").getSource();
14332 	formatSource(input, getCompilationUnit("Formatter", "", "test131292", "D_out.java").getSource());
14333 }
14334 /**
14335  * https://bugs.eclipse.org/131292 - [format] align assignments in columns
14336  */
testBug131292e()14337 public void testBug131292e() throws JavaModelException {
14338 	this.formatterPrefs.align_type_members_on_columns = true;
14339 	this.formatterPrefs.align_variable_declarations_on_columns = true;
14340 	this.formatterPrefs.align_assignment_statements_on_columns = true;
14341 	this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.MIXED;
14342 	this.formatterPrefs.align_fields_grouping_blank_lines = 1;
14343 	String input = getCompilationUnit("Formatter", "", "test131292", "in.java").getSource();
14344 	formatSource(input, getCompilationUnit("Formatter", "", "test131292", "E_out.java").getSource());
14345 }
14346 /**
14347  * https://bugs.eclipse.org/131292 - [format] align assignments in columns
14348  */
testBug131292f()14349 public void testBug131292f() throws JavaModelException {
14350 	this.formatterPrefs.align_type_members_on_columns = true;
14351 	this.formatterPrefs.align_variable_declarations_on_columns = true;
14352 	this.formatterPrefs.align_assignment_statements_on_columns = true;
14353 	this.formatterPrefs.align_with_spaces = true;
14354 	this.formatterPrefs.align_fields_grouping_blank_lines = 2;
14355 	String input = getCompilationUnit("Formatter", "", "test131292", "in.java").getSource();
14356 	formatSource(input, getCompilationUnit("Formatter", "", "test131292", "F_out.java").getSource());
14357 }
14358 
14359 /**
14360  * https://bugs.eclipse.org/205973 - [formatter] Allow to keep simple methods on one line (for exemple simple getter or setter)
14361  */
testBug205973a()14362 public void testBug205973a() throws JavaModelException {
14363 	setComplianceLevel(CompilerOptions.VERSION_1_8);
14364 	this.formatterPrefs.keep_annotation_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
14365 	this.formatterPrefs.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
14366 	this.formatterPrefs.keep_if_then_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
14367 	this.formatterPrefs.keep_lambda_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
14368 	this.formatterPrefs.keep_loop_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
14369 	this.formatterPrefs.keep_code_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14370 	this.formatterPrefs.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14371 	this.formatterPrefs.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14372 	this.formatterPrefs.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14373 	this.formatterPrefs.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14374 	this.formatterPrefs.keep_simple_getter_setter_on_one_line = false;
14375 	this.formatterPrefs.keep_guardian_clause_on_one_line = false;
14376 	String input = getCompilationUnit("Formatter", "", "test205973", "in.java").getSource();
14377 	formatSource(input, getCompilationUnit("Formatter", "", "test205973", "A_out.java").getSource());
14378 }
14379 /**
14380  * https://bugs.eclipse.org/205973 - [formatter] Allow to keep simple methods on one line (for exemple simple getter or setter)
14381  */
testBug205973b()14382 public void testBug205973b() throws JavaModelException {
14383 	setComplianceLevel(CompilerOptions.VERSION_1_8);
14384 	this.formatterPrefs.keep_annotation_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14385 	this.formatterPrefs.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14386 	this.formatterPrefs.keep_if_then_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14387 	this.formatterPrefs.keep_lambda_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_SINGLE_ITEM;
14388 	this.formatterPrefs.keep_loop_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_SINGLE_ITEM;
14389 	this.formatterPrefs.keep_code_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14390 	this.formatterPrefs.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
14391 	this.formatterPrefs.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
14392 	this.formatterPrefs.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14393 	this.formatterPrefs.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14394 	this.formatterPrefs.keep_simple_getter_setter_on_one_line = true;
14395 	this.formatterPrefs.keep_guardian_clause_on_one_line = false;
14396 	String input = getCompilationUnit("Formatter", "", "test205973", "in.java").getSource();
14397 	formatSource(input, getCompilationUnit("Formatter", "", "test205973", "B_out.java").getSource());
14398 }
14399 /**
14400  * https://bugs.eclipse.org/205973 - [formatter] Allow to keep simple methods on one line (for exemple simple getter or setter)
14401  */
testBug205973c()14402 public void testBug205973c() throws JavaModelException {
14403 	setComplianceLevel(CompilerOptions.VERSION_1_8);
14404 	this.formatterPrefs.keep_annotation_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_SINGLE_ITEM;
14405 	this.formatterPrefs.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_SINGLE_ITEM;
14406 	this.formatterPrefs.keep_if_then_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14407 	this.formatterPrefs.keep_lambda_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14408 	this.formatterPrefs.keep_loop_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14409 	this.formatterPrefs.keep_code_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
14410 	this.formatterPrefs.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14411 	this.formatterPrefs.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_SINGLE_ITEM;
14412 	this.formatterPrefs.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
14413 	this.formatterPrefs.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
14414 	this.formatterPrefs.keep_simple_getter_setter_on_one_line = false;
14415 	this.formatterPrefs.keep_guardian_clause_on_one_line = true;
14416 	String input = getCompilationUnit("Formatter", "", "test205973", "in.java").getSource();
14417 	formatSource(input, getCompilationUnit("Formatter", "", "test205973", "C_out.java").getSource());
14418 }
14419 /**
14420  * https://bugs.eclipse.org/205973 - [formatter] Allow to keep simple methods on one line (for exemple simple getter or setter)
14421  */
testBug205973d()14422 public void testBug205973d() throws JavaModelException {
14423 	setComplianceLevel(CompilerOptions.VERSION_1_8);
14424 	this.formatterPrefs.keep_annotation_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14425 	this.formatterPrefs.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
14426 	this.formatterPrefs.keep_if_then_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14427 	this.formatterPrefs.keep_lambda_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_SINGLE_ITEM;
14428 	this.formatterPrefs.keep_loop_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14429 	this.formatterPrefs.keep_code_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
14430 	this.formatterPrefs.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_SINGLE_ITEM;
14431 	this.formatterPrefs.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14432 	this.formatterPrefs.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14433 	this.formatterPrefs.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_SINGLE_ITEM;
14434 	this.formatterPrefs.keep_simple_getter_setter_on_one_line = false;
14435 	this.formatterPrefs.keep_guardian_clause_on_one_line = false;
14436 	String input = getCompilationUnit("Formatter", "", "test205973", "in.java").getSource();
14437 	formatSource(input, getCompilationUnit("Formatter", "", "test205973", "D_out.java").getSource());
14438 }
14439 /**
14440  * https://bugs.eclipse.org/205973 - [formatter] Allow to keep simple methods on one line (for exemple simple getter or setter)
14441  */
testBug205973e()14442 public void testBug205973e() throws JavaModelException {
14443 	setComplianceLevel(CompilerOptions.VERSION_1_8);
14444 	this.formatterPrefs.keep_annotation_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
14445 	this.formatterPrefs.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14446 	this.formatterPrefs.keep_if_then_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
14447 	this.formatterPrefs.keep_lambda_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14448 	this.formatterPrefs.keep_loop_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
14449 	this.formatterPrefs.keep_code_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14450 	this.formatterPrefs.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
14451 	this.formatterPrefs.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14452 	this.formatterPrefs.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
14453 	this.formatterPrefs.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14454 	this.formatterPrefs.keep_simple_getter_setter_on_one_line = true;
14455 	this.formatterPrefs.keep_guardian_clause_on_one_line = true;
14456 	String input = getCompilationUnit("Formatter", "", "test205973", "in.java").getSource();
14457 	formatSource(input, getCompilationUnit("Formatter", "", "test205973", "E_out.java").getSource());
14458 }
14459 /**
14460  * https://bugs.eclipse.org/205973 - [formatter] Allow to keep simple methods on one line (for exemple simple getter or setter)
14461  */
testBug205973f()14462 public void testBug205973f() throws JavaModelException {
14463 	setComplianceLevel(CompilerOptions.VERSION_1_8);
14464 	this.formatterPrefs.keep_annotation_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14465 	this.formatterPrefs.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
14466 	this.formatterPrefs.keep_if_then_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
14467 	this.formatterPrefs.keep_lambda_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14468 	this.formatterPrefs.keep_loop_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_SINGLE_ITEM;
14469 	this.formatterPrefs.keep_code_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14470 	this.formatterPrefs.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
14471 	this.formatterPrefs.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
14472 	this.formatterPrefs.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14473 	this.formatterPrefs.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
14474 	this.formatterPrefs.keep_simple_getter_setter_on_one_line = false;
14475 	this.formatterPrefs.keep_guardian_clause_on_one_line = false;
14476 	String input = getCompilationUnit("Formatter", "", "test205973", "in.java").getSource();
14477 	formatSource(input, getCompilationUnit("Formatter", "", "test205973", "F_out.java").getSource());
14478 }
14479 /**
14480  * https://bugs.eclipse.org/205973 - [formatter] Allow to keep simple methods on one line (for exemple simple getter or setter)
14481  */
testBug205973g()14482 public void testBug205973g() throws JavaModelException {
14483 	setComplianceLevel(CompilerOptions.VERSION_1_8);
14484 	this.formatterPrefs.keep_annotation_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
14485 	this.formatterPrefs.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14486 	this.formatterPrefs.keep_if_then_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_SINGLE_ITEM;
14487 	this.formatterPrefs.keep_lambda_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
14488 	this.formatterPrefs.keep_loop_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14489 	this.formatterPrefs.keep_code_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
14490 	this.formatterPrefs.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14491 	this.formatterPrefs.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_SINGLE_ITEM;
14492 	this.formatterPrefs.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
14493 	this.formatterPrefs.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14494 	this.formatterPrefs.keep_simple_getter_setter_on_one_line = false;
14495 	this.formatterPrefs.keep_guardian_clause_on_one_line = false;
14496 	String input = getCompilationUnit("Formatter", "", "test205973", "in.java").getSource();
14497 	formatSource(input, getCompilationUnit("Formatter", "", "test205973", "G_out.java").getSource());
14498 }
14499 /**
14500  * https://bugs.eclipse.org/205973 - [formatter] Allow to keep simple methods on one line (for exemple simple getter or setter)
14501  */
testBug205973h()14502 public void testBug205973h() throws JavaModelException {
14503 	setComplianceLevel(CompilerOptions.VERSION_1_8);
14504 	this.formatterPrefs.keep_annotation_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_PRESERVE;
14505 	this.formatterPrefs.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_PRESERVE;
14506 	this.formatterPrefs.keep_if_then_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_PRESERVE;
14507 	this.formatterPrefs.keep_lambda_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_PRESERVE;
14508 	this.formatterPrefs.keep_loop_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_PRESERVE;
14509 	this.formatterPrefs.keep_code_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
14510 	this.formatterPrefs.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_PRESERVE;
14511 	this.formatterPrefs.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_PRESERVE;
14512 	this.formatterPrefs.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_PRESERVE;
14513 	this.formatterPrefs.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_PRESERVE;
14514 	this.formatterPrefs.keep_simple_getter_setter_on_one_line = false;
14515 	this.formatterPrefs.keep_guardian_clause_on_one_line = false;
14516 	this.formatterPrefs.align_type_members_on_columns = true;
14517 	this.formatterPrefs.align_variable_declarations_on_columns = true;
14518 	this.formatterPrefs.align_assignment_statements_on_columns = true;
14519 	String input = getCompilationUnit("Formatter", "", "test205973", "in.java").getSource();
14520 	formatSource(input, getCompilationUnit("Formatter", "", "test205973", "H_out.java").getSource());
14521 }
14522 /**
14523  * https://bugs.eclipse.org/205973 - [formatter] Allow to keep simple methods on one line (for exemple simple getter or setter)
14524  */
testBug205973i()14525 public void testBug205973i() throws JavaModelException {
14526 	setComplianceLevel(CompilerOptions.VERSION_1_8);
14527 	this.formatterPrefs.page_width = 50;
14528 	this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
14529 	this.formatterPrefs.keep_annotation_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
14530 	this.formatterPrefs.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
14531 	this.formatterPrefs.keep_if_then_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
14532 	this.formatterPrefs.keep_lambda_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
14533 	this.formatterPrefs.keep_loop_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
14534 	this.formatterPrefs.keep_code_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
14535 	this.formatterPrefs.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
14536 	this.formatterPrefs.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
14537 	this.formatterPrefs.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
14538 	this.formatterPrefs.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
14539 	this.formatterPrefs.keep_simple_getter_setter_on_one_line = false;
14540 	this.formatterPrefs.keep_guardian_clause_on_one_line = false;
14541 	String input = getCompilationUnit("Formatter", "", "test205973", "in.java").getSource();
14542 	formatSource(input, getCompilationUnit("Formatter", "", "test205973", "I_out.java").getSource());
14543 }
14544 /**
14545  * https://bugs.eclipse.org/205973 - [formatter] Allow to keep simple methods on one line (for exemple simple getter or setter)
14546  */
testBug205973j()14547 public void testBug205973j() throws JavaModelException {
14548 	setComplianceLevel(CompilerOptions.VERSION_1_8);
14549 	this.formatterPrefs.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
14550 	String input = getCompilationUnit("Formatter", "", "test205973", "J_in.java").getSource();
14551 	formatSource(input, getCompilationUnit("Formatter", "", "test205973", "J_out.java").getSource());
14552 }
14553 
14554 /**
14555  * https://bugs.eclipse.org/541133 - [formatter] javadoc: no indent of @return description
14556  */
testBug541133a()14557 public void testBug541133a() {
14558 	this.formatterPrefs.comment_align_tags_descriptions_grouped = false;
14559 	this.formatterPrefs.comment_indent_parameter_description = false;
14560 	this.formatterPrefs.comment_indent_tag_description = true;
14561 	String source =
14562 		"class C {\n" +
14563 		"	/**\n" +
14564 		"	 * @param bar param description should NOT get additional indentation when it's wrapped\n" +
14565 		"	 * @return return description should get additional indentation when it's wrapped\n" +
14566 		"	 */\n" +
14567 		"	String foo(String bar) {\n" +
14568 		"	}\n" +
14569 		"}";
14570 	formatSource(source,
14571 		"class C {\n" +
14572 		"	/**\n" +
14573 		"	 * @param bar param description should NOT get additional indentation when it's\n" +
14574 		"	 * wrapped\n" +
14575 		"	 * @return return description should get additional indentation when it's\n" +
14576 		"	 *     wrapped\n" +
14577 		"	 */\n" +
14578 		"	String foo(String bar) {\n" +
14579 		"	}\n" +
14580 		"}");
14581 }
14582 /**
14583  * https://bugs.eclipse.org/541133 - [formatter] javadoc: no indent of @return description
14584  */
testBug541133b()14585 public void testBug541133b() {
14586 	this.formatterPrefs.comment_indent_root_tags = true;
14587 	this.formatterPrefs.comment_indent_parameter_description = false;
14588 	this.formatterPrefs.comment_indent_tag_description = true;
14589 	String source =
14590 		"class C {\n" +
14591 		"	/**\n" +
14592 		"	 * @deprecated Do not use this class, it's only to test formatting on. One two three four five six seven eight nine ten\n" +
14593 		"	 */\n" +
14594 		"	void foo() {\n" +
14595 		"	}\n" +
14596 		"}";
14597 	formatSource(source,
14598 		"class C {\n" +
14599 		"	/**\n" +
14600 		"	 * @deprecated Do not use this class, it's only to test formatting on. One two\n" +
14601 		"	 *                 three four five six seven eight nine ten\n" +
14602 		"	 */\n" +
14603 		"	void foo() {\n" +
14604 		"	}\n" +
14605 		"}");
14606 }
14607 /**
14608  * https://bugs.eclipse.org/541133 - [formatter] javadoc: no indent of @return description
14609  */
testBug541133c()14610 public void testBug541133c() {
14611 	this.formatterPrefs.comment_indent_tag_description = true;
14612 	String source =
14613 		"/**\n" +
14614 		" * Mensagens SMTP tem o seguinte formato:\n" +
14615 		" * \n" +
14616 		" * <pre>\n" +
14617 		" * resposta de uma linha só:\n" +
14618 		" * </pre>\n" +
14619 		" * \n" +
14620 		" * {@link java.lang.String </code>a simple string<code>}.\n" +
14621 		" * \n" +
14622 		" * @deprecated Mensagens SMTP tem o seguinte formato:\n" +
14623 		" * \n" +
14624 		" *                 <pre>\n" +
14625 		" *                 resposta de uma linha só:\n" +
14626 		" *                 </pre>\n" +
14627 		" */";
14628 	formatSource(source);
14629 }
14630 /**
14631  * https://bugs.eclipse.org/541133 - [formatter] javadoc: no indent of @return description
14632  */
testBug541133d()14633 public void testBug541133d() {
14634 	String source =
14635 		"/**\n" +
14636 		" * @return something <pre>\n" +
14637 		" * class Runnable {\n" +
14638 		" * 	// Hello really bad Ganymede formatter !!!\n" +
14639 		" * 	// Shit happens when somebody tries to change a running system\n" +
14640 		" * }</pre> something\n" +
14641 		" */";
14642 	formatSource(source,
14643 		"/**\n" +
14644 		" * @return something\n" +
14645 		" * \n" +
14646 		" *         <pre>\n" +
14647 		" *         class Runnable {\n" +
14648 		" *         	// Hello really bad Ganymede formatter !!!\n" +
14649 		" *         	// Shit happens when somebody tries to change a running system\n" +
14650 		" *         }\n" +
14651 		" *         </pre>\n" +
14652 		" * \n" +
14653 		" *         something\n" +
14654 		" */");
14655 }
14656 
14657 /**
14658  * https://bugs.eclipse.org/543079 - [formatter] wrapping binary expressions: separate options for operator types
14659  */
testBug543079a()14660 public void testBug543079a() throws JavaModelException {
14661 	this.formatterPrefs.page_width = 80;
14662 	this.formatterPrefs.alignment_for_multiplicative_operator = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE + Alignment.M_INDENT_ON_COLUMN;
14663 	this.formatterPrefs.wrap_before_multiplicative_operator = false;
14664 	String input = getCompilationUnit("Formatter", "", "test543079", "in.java").getSource();
14665 	formatSource(input, getCompilationUnit("Formatter", "", "test543079", "A_out.java").getSource());
14666 }
14667 /**
14668  * https://bugs.eclipse.org/543079 - [formatter] wrapping binary expressions: separate options for operator types
14669  */
testBug543079b()14670 public void testBug543079b() throws JavaModelException {
14671 	this.formatterPrefs.page_width = 80;
14672 	this.formatterPrefs.alignment_for_additive_operator = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE + Alignment.M_INDENT_ON_COLUMN;
14673 	this.formatterPrefs.wrap_before_additive_operator = false;
14674 	String input = getCompilationUnit("Formatter", "", "test543079", "in.java").getSource();
14675 	formatSource(input, getCompilationUnit("Formatter", "", "test543079", "B_out.java").getSource());
14676 }
14677 /**
14678  * https://bugs.eclipse.org/543079 - [formatter] wrapping binary expressions: separate options for operator types
14679  */
testBug543079c()14680 public void testBug543079c() throws JavaModelException {
14681 	this.formatterPrefs.page_width = 80;
14682 	this.formatterPrefs.alignment_for_string_concatenation = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE + Alignment.M_INDENT_ON_COLUMN;
14683 	this.formatterPrefs.wrap_before_string_concatenation = false;
14684 	String input = getCompilationUnit("Formatter", "", "test543079", "in.java").getSource();
14685 	formatSource(input, getCompilationUnit("Formatter", "", "test543079", "C_out.java").getSource());
14686 }
14687 /**
14688  * https://bugs.eclipse.org/543079 - [formatter] wrapping binary expressions: separate options for operator types
14689  */
testBug543079d()14690 public void testBug543079d() throws JavaModelException {
14691 	this.formatterPrefs.page_width = 80;
14692 	this.formatterPrefs.alignment_for_shift_operator = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE + Alignment.M_INDENT_ON_COLUMN;
14693 	this.formatterPrefs.wrap_before_shift_operator = false;
14694 	String input = getCompilationUnit("Formatter", "", "test543079", "in.java").getSource();
14695 	formatSource(input, getCompilationUnit("Formatter", "", "test543079", "D_out.java").getSource());
14696 }
14697 /**
14698  * https://bugs.eclipse.org/543079 - [formatter] wrapping binary expressions: separate options for operator types
14699  */
testBug543079e()14700 public void testBug543079e() throws JavaModelException {
14701 	this.formatterPrefs.page_width = 80;
14702 	this.formatterPrefs.alignment_for_relational_operator = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE + Alignment.M_INDENT_ON_COLUMN;
14703 	this.formatterPrefs.wrap_before_relational_operator = false;
14704 	String input = getCompilationUnit("Formatter", "", "test543079", "in.java").getSource();
14705 	formatSource(input, getCompilationUnit("Formatter", "", "test543079", "E_out.java").getSource());
14706 }
14707 /**
14708  * https://bugs.eclipse.org/543079 - [formatter] wrapping binary expressions: separate options for operator types
14709  */
testBug543079f()14710 public void testBug543079f() throws JavaModelException {
14711 	this.formatterPrefs.page_width = 80;
14712 	this.formatterPrefs.alignment_for_bitwise_operator = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE + Alignment.M_INDENT_ON_COLUMN;
14713 	this.formatterPrefs.wrap_before_bitwise_operator = false;
14714 	String input = getCompilationUnit("Formatter", "", "test543079", "in.java").getSource();
14715 	formatSource(input, getCompilationUnit("Formatter", "", "test543079", "F_out.java").getSource());
14716 }
14717 /**
14718  * https://bugs.eclipse.org/543079 - [formatter] wrapping binary expressions: separate options for operator types
14719  */
testBug543079g()14720 public void testBug543079g() throws JavaModelException {
14721 	this.formatterPrefs.page_width = 80;
14722 	this.formatterPrefs.alignment_for_logical_operator = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE + Alignment.M_INDENT_ON_COLUMN;
14723 	this.formatterPrefs.wrap_before_logical_operator = false;
14724 	String input = getCompilationUnit("Formatter", "", "test543079", "in.java").getSource();
14725 	formatSource(input, getCompilationUnit("Formatter", "", "test543079", "G_out.java").getSource());
14726 }
14727 /**
14728  * https://bugs.eclipse.org/159565 - [formatter] Separate white space preferences for separate operators
14729  */
testBug159565a()14730 public void testBug159565a() throws JavaModelException {
14731 	this.formatterPrefs.insert_space_before_multiplicative_operator = false;
14732 	this.formatterPrefs.insert_space_before_bitwise_operator = false;
14733 	String input = getCompilationUnit("Formatter", "", "test159565", "in.java").getSource();
14734 	formatSource(input, getCompilationUnit("Formatter", "", "test159565", "A_out.java").getSource());
14735 }
14736 /**
14737  * https://bugs.eclipse.org/159565 - [formatter] Separate white space preferences for separate operators
14738  */
testBug159565b()14739 public void testBug159565b() throws JavaModelException {
14740 	this.formatterPrefs.insert_space_after_multiplicative_operator = false;
14741 	this.formatterPrefs.insert_space_after_additive_operator = false;
14742 	String input = getCompilationUnit("Formatter", "", "test159565", "in.java").getSource();
14743 	formatSource(input, getCompilationUnit("Formatter", "", "test159565", "B_out.java").getSource());
14744 }
14745 /**
14746  * https://bugs.eclipse.org/159565 - [formatter] Separate white space preferences for separate operators
14747  */
testBug159565c()14748 public void testBug159565c() throws JavaModelException {
14749 	this.formatterPrefs.insert_space_before_additive_operator = false;
14750 	this.formatterPrefs.insert_space_before_logical_operator = false;
14751 	String input = getCompilationUnit("Formatter", "", "test159565", "in.java").getSource();
14752 	formatSource(input, getCompilationUnit("Formatter", "", "test159565", "C_out.java").getSource());
14753 }
14754 /**
14755  * https://bugs.eclipse.org/159565 - [formatter] Separate white space preferences for separate operators
14756  */
testBug159565d()14757 public void testBug159565d() throws JavaModelException {
14758 	this.formatterPrefs.insert_space_before_string_concatenation = false;
14759 	this.formatterPrefs.insert_space_after_bitwise_operator = false;
14760 	String input = getCompilationUnit("Formatter", "", "test159565", "in.java").getSource();
14761 	formatSource(input, getCompilationUnit("Formatter", "", "test159565", "D_out.java").getSource());
14762 }
14763 /**
14764  * https://bugs.eclipse.org/159565 - [formatter] Separate white space preferences for separate operators
14765  */
testBug159565e()14766 public void testBug159565e() throws JavaModelException {
14767 	this.formatterPrefs.insert_space_after_string_concatenation = false;
14768 	this.formatterPrefs.insert_space_before_shift_operator = false;
14769 	String input = getCompilationUnit("Formatter", "", "test159565", "in.java").getSource();
14770 	formatSource(input, getCompilationUnit("Formatter", "", "test159565", "E_out.java").getSource());
14771 }
14772 /**
14773  * https://bugs.eclipse.org/159565 - [formatter] Separate white space preferences for separate operators
14774  */
testBug159565f()14775 public void testBug159565f() throws JavaModelException {
14776 	this.formatterPrefs.insert_space_after_shift_operator = false;
14777 	this.formatterPrefs.insert_space_after_relational_operator = false;
14778 	String input = getCompilationUnit("Formatter", "", "test159565", "in.java").getSource();
14779 	formatSource(input, getCompilationUnit("Formatter", "", "test159565", "F_out.java").getSource());
14780 }
14781 /**
14782  * https://bugs.eclipse.org/159565 - [formatter] Separate white space preferences for separate operators
14783  */
testBug159565g()14784 public void testBug159565g() throws JavaModelException {
14785 	this.formatterPrefs.insert_space_before_relational_operator = false;
14786 	this.formatterPrefs.insert_space_after_logical_operator = false;
14787 	String input = getCompilationUnit("Formatter", "", "test159565", "in.java").getSource();
14788 	formatSource(input, getCompilationUnit("Formatter", "", "test159565", "G_out.java").getSource());
14789 }
14790 /**
14791  * https://bugs.eclipse.org/541011 - [formatter] Option to wrap chained conditionals as one group
14792  */
testBug541011a()14793 public void testBug541011a() throws JavaModelException {
14794 	this.formatterPrefs.page_width = 80;
14795 	String input = getCompilationUnit("Formatter", "", "test541011", "in.java").getSource();
14796 	formatSource(input, getCompilationUnit("Formatter", "", "test541011", "A_out.java").getSource());
14797 }
14798 /**
14799  * https://bugs.eclipse.org/541011 - [formatter] Option to wrap chained conditionals as one group
14800  */
testBug541011b()14801 public void testBug541011b() throws JavaModelException {
14802 	this.formatterPrefs.page_width = 80;
14803 	this.formatterPrefs.alignment_for_conditional_expression_chain = Alignment.M_COMPACT_SPLIT;
14804 	String input = getCompilationUnit("Formatter", "", "test541011", "in.java").getSource();
14805 	formatSource(input, getCompilationUnit("Formatter", "", "test541011", "B_out.java").getSource());
14806 }
14807 /**
14808  * https://bugs.eclipse.org/541011 - [formatter] Option to wrap chained conditionals as one group
14809  */
testBug541011c()14810 public void testBug541011c() throws JavaModelException {
14811 	this.formatterPrefs.page_width = 80;
14812 	this.formatterPrefs.alignment_for_conditional_expression_chain = Alignment.M_ONE_PER_LINE_SPLIT;
14813 	String input = getCompilationUnit("Formatter", "", "test541011", "in.java").getSource();
14814 	formatSource(input, getCompilationUnit("Formatter", "", "test541011", "C_out.java").getSource());
14815 }
14816 /**
14817  * https://bugs.eclipse.org/541011 - [formatter] Option to wrap chained conditionals as one group
14818  */
testBug541011d()14819 public void testBug541011d() throws JavaModelException {
14820 	this.formatterPrefs.page_width = 80;
14821 	this.formatterPrefs.alignment_for_conditional_expression_chain = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
14822 	String input = getCompilationUnit("Formatter", "", "test541011", "in.java").getSource();
14823 	formatSource(input, getCompilationUnit("Formatter", "", "test541011", "D_out.java").getSource());
14824 }
14825 /**
14826  * https://bugs.eclipse.org/541011 - [formatter] Option to wrap chained conditionals as one group
14827  */
testBug541011e()14828 public void testBug541011e() throws JavaModelException {
14829 	this.formatterPrefs.page_width = 80;
14830 	this.formatterPrefs.alignment_for_conditional_expression_chain = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
14831 	this.formatterPrefs.alignment_for_conditional_expression = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
14832 	String input = getCompilationUnit("Formatter", "", "test541011", "in.java").getSource();
14833 	formatSource(input, getCompilationUnit("Formatter", "", "test541011", "E_out.java").getSource());
14834 }
14835 /**
14836  * https://bugs.eclipse.org/541011 - [formatter] Option to wrap chained conditionals as one group
14837  */
testBug541011f()14838 public void testBug541011f() throws JavaModelException {
14839 	this.formatterPrefs.page_width = 80;
14840 	this.formatterPrefs.alignment_for_conditional_expression_chain = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE + Alignment.M_INDENT_ON_COLUMN;
14841 	this.formatterPrefs.alignment_for_conditional_expression = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE + Alignment.M_INDENT_ON_COLUMN;
14842 	String input = getCompilationUnit("Formatter", "", "test541011", "in.java").getSource();
14843 	formatSource(input, getCompilationUnit("Formatter", "", "test541011", "F_out.java").getSource());
14844 }
14845 /**
14846  * https://bugs.eclipse.org/541011 - [formatter] Option to wrap chained conditionals as one group
14847  */
testBug541011g()14848 public void testBug541011g() throws JavaModelException {
14849 	this.formatterPrefs.page_width = 80;
14850 	this.formatterPrefs.alignment_for_conditional_expression = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE + Alignment.M_INDENT_ON_COLUMN;
14851 	String input = getCompilationUnit("Formatter", "", "test541011", "in.java").getSource();
14852 	formatSource(input, getCompilationUnit("Formatter", "", "test541011", "G_out.java").getSource());
14853 }
14854 /**
14855  * https://bugs.eclipse.org/543818 - [12] Formatter Support for Switch Expressions
14856  */
testBug543818a()14857 public void testBug543818a() throws JavaModelException {
14858 	setComplianceLevel(CompilerOptions.VERSION_14);
14859 	this.formatterPrefs.insert_space_before_comma_in_switch_case_expressions = true;
14860 	this.formatterPrefs.insert_space_before_colon_in_case = true;
14861 	this.formatterPrefs.indent_switchstatements_compare_to_switch = true;
14862 	String input = getCompilationUnit("Formatter", "", "test543818", "in.java").getSource();
14863 	formatSource(input, getCompilationUnit("Formatter", "", "test543818", "A_out.java").getSource());
14864 }
14865 /**
14866  * https://bugs.eclipse.org/543818 - [12] Formatter Support for Switch Expressions
14867  */
testBug543818b()14868 public void testBug543818b() throws JavaModelException {
14869 	setComplianceLevel(CompilerOptions.VERSION_14);
14870 	this.formatterPrefs.insert_space_after_comma_in_switch_case_expressions = false;
14871 	this.formatterPrefs.insert_space_before_closing_paren_in_switch = true;
14872 	this.formatterPrefs.indent_switchstatements_compare_to_cases = false;
14873 	String input = getCompilationUnit("Formatter", "", "test543818", "in.java").getSource();
14874 	formatSource(input, getCompilationUnit("Formatter", "", "test543818", "B_out.java").getSource());
14875 }
14876 /**
14877  * https://bugs.eclipse.org/543818 - [12] Formatter Support for Switch Expressions
14878  */
testBug543818c()14879 public void testBug543818c() throws JavaModelException {
14880 	setComplianceLevel(CompilerOptions.VERSION_14);
14881 	this.formatterPrefs.insert_space_before_arrow_in_switch_case = false;
14882 	this.formatterPrefs.insert_space_before_opening_paren_in_switch = false;
14883 	this.formatterPrefs.indent_breaks_compare_to_cases = false;
14884 	String input = getCompilationUnit("Formatter", "", "test543818", "in.java").getSource();
14885 	formatSource(input, getCompilationUnit("Formatter", "", "test543818", "C_out.java").getSource());
14886 }
14887 /**
14888  * https://bugs.eclipse.org/543818 - [12] Formatter Support for Switch Expressions
14889  */
testBug543818d()14890 public void testBug543818d() throws JavaModelException {
14891 	setComplianceLevel(CompilerOptions.VERSION_14);
14892 	this.formatterPrefs.insert_space_after_arrow_in_switch_case = false;
14893 	this.formatterPrefs.insert_space_after_opening_paren_in_switch = true;
14894 	this.formatterPrefs.insert_space_before_opening_brace_in_block = false;
14895 	this.formatterPrefs.brace_position_for_switch = DefaultCodeFormatterConstants.NEXT_LINE;
14896 	String input = getCompilationUnit("Formatter", "", "test543818", "in.java").getSource();
14897 	formatSource(input, getCompilationUnit("Formatter", "", "test543818", "D_out.java").getSource());
14898 }
14899 /**
14900  * https://bugs.eclipse.org/543818 - [12] Formatter Support for Switch Expressions
14901  */
testBug543818e()14902 public void testBug543818e() throws JavaModelException {
14903 	setComplianceLevel(CompilerOptions.VERSION_14);
14904 	this.formatterPrefs.insert_space_before_arrow_in_switch_default = false;
14905 	this.formatterPrefs.insert_space_before_colon_in_default = true;
14906 	this.formatterPrefs.parenthesis_positions_in_switch_statement = DefaultCodeFormatterConstants.SEPARATE_LINES;
14907 	String input = getCompilationUnit("Formatter", "", "test543818", "in.java").getSource();
14908 	formatSource(input, getCompilationUnit("Formatter", "", "test543818", "E_out.java").getSource());
14909 }
14910 /**
14911  * https://bugs.eclipse.org/543818 - [12] Formatter Support for Switch Expressions
14912  */
testBug543818f()14913 public void testBug543818f() throws JavaModelException {
14914 	setComplianceLevel(CompilerOptions.VERSION_14);
14915 	this.formatterPrefs.insert_space_after_arrow_in_switch_default = false;
14916 	this.formatterPrefs.insert_space_before_opening_brace_in_switch = false;
14917 	this.formatterPrefs.insert_space_before_opening_brace_in_block = false;
14918 	String input = getCompilationUnit("Formatter", "", "test543818", "in.java").getSource();
14919 	formatSource(input, getCompilationUnit("Formatter", "", "test543818", "F_out.java").getSource());
14920 }
14921 /**
14922  * https://bugs.eclipse.org/543818 - [12] Formatter Support for Switch Expressions
14923  */
testBug543818g()14924 public void testBug543818g() throws JavaModelException {
14925 	setComplianceLevel(CompilerOptions.VERSION_14);
14926 	String input = getCompilationUnit("Formatter", "", "test543818", "in.java").getSource();
14927 	formatSource(input, getCompilationUnit("Formatter", "", "test543818", "G_out.java").getSource());
14928 }
14929 /**
14930  * https://bugs.eclipse.org/549249 - [formatter] Extend Blank Lines settings to remove excess lines
14931  */
testBug549249a()14932 public void testBug549249a() throws JavaModelException {
14933 	this.formatterPrefs.number_of_empty_lines_to_preserve = 4;
14934 	this.formatterPrefs.blank_lines_after_imports = ~2;
14935 	String input = getCompilationUnit("Formatter", "", "test549249", "in.java").getSource();
14936 	formatSource(input, getCompilationUnit("Formatter", "", "test549249", "A_out.java").getSource());
14937 }
14938 /**
14939  * https://bugs.eclipse.org/549249 - [formatter] Extend Blank Lines settings to remove excess lines
14940  */
testBug549249b()14941 public void testBug549249b() throws JavaModelException {
14942 	this.formatterPrefs.number_of_empty_lines_to_preserve = 4;
14943 	this.formatterPrefs.blank_lines_after_package = ~1;
14944 	String input = getCompilationUnit("Formatter", "", "test549249", "in.java").getSource();
14945 	formatSource(input, getCompilationUnit("Formatter", "", "test549249", "B_out.java").getSource());
14946 }
14947 /**
14948  * https://bugs.eclipse.org/549249 - [formatter] Extend Blank Lines settings to remove excess lines
14949  */
testBug549249c()14950 public void testBug549249c() throws JavaModelException {
14951 	this.formatterPrefs.number_of_empty_lines_to_preserve = 4;
14952 	this.formatterPrefs.blank_lines_at_beginning_of_method_body = ~0;
14953 	String input = getCompilationUnit("Formatter", "", "test549249", "in.java").getSource();
14954 	formatSource(input, getCompilationUnit("Formatter", "", "test549249", "C_out.java").getSource());
14955 }
14956 /**
14957  * https://bugs.eclipse.org/549249 - [formatter] Extend Blank Lines settings to remove excess lines
14958  */
testBug549249d()14959 public void testBug549249d() throws JavaModelException {
14960 	this.formatterPrefs.number_of_empty_lines_to_preserve = 4;
14961 	this.formatterPrefs.blank_lines_before_field = ~3;
14962 	String input = getCompilationUnit("Formatter", "", "test549249", "in.java").getSource();
14963 	formatSource(input, getCompilationUnit("Formatter", "", "test549249", "D_out.java").getSource());
14964 }
14965 /**
14966  * https://bugs.eclipse.org/549249 - [formatter] Extend Blank Lines settings to remove excess lines
14967  */
testBug549249e()14968 public void testBug549249e() throws JavaModelException {
14969 	this.formatterPrefs.number_of_empty_lines_to_preserve = 4;
14970 	this.formatterPrefs.blank_lines_before_first_class_body_declaration = ~2;
14971 	String input = getCompilationUnit("Formatter", "", "test549249", "in.java").getSource();
14972 	formatSource(input, getCompilationUnit("Formatter", "", "test549249", "E_out.java").getSource());
14973 }
14974 /**
14975  * https://bugs.eclipse.org/549249 - [formatter] Extend Blank Lines settings to remove excess lines
14976  */
testBug549249f()14977 public void testBug549249f() throws JavaModelException {
14978 	this.formatterPrefs.number_of_empty_lines_to_preserve = 4;
14979 	this.formatterPrefs.blank_lines_before_imports = ~1;
14980 	String input = getCompilationUnit("Formatter", "", "test549249", "in.java").getSource();
14981 	formatSource(input, getCompilationUnit("Formatter", "", "test549249", "F_out.java").getSource());
14982 }
14983 /**
14984  * https://bugs.eclipse.org/549249 - [formatter] Extend Blank Lines settings to remove excess lines
14985  */
testBug549249g()14986 public void testBug549249g() throws JavaModelException {
14987 	this.formatterPrefs.number_of_empty_lines_to_preserve = 4;
14988 	this.formatterPrefs.blank_lines_before_member_type = ~0;
14989 	String input = getCompilationUnit("Formatter", "", "test549249", "in.java").getSource();
14990 	formatSource(input, getCompilationUnit("Formatter", "", "test549249", "G_out.java").getSource());
14991 }
14992 /**
14993  * https://bugs.eclipse.org/549249 - [formatter] Extend Blank Lines settings to remove excess lines
14994  */
testBug549249h()14995 public void testBug549249h() throws JavaModelException {
14996 	this.formatterPrefs.number_of_empty_lines_to_preserve = 4;
14997 	this.formatterPrefs.blank_lines_before_method = ~3;
14998 	String input = getCompilationUnit("Formatter", "", "test549249", "in.java").getSource();
14999 	formatSource(input, getCompilationUnit("Formatter", "", "test549249", "H_out.java").getSource());
15000 }
15001 /**
15002  * https://bugs.eclipse.org/549249 - [formatter] Extend Blank Lines settings to remove excess lines
15003  */
testBug549249i()15004 public void testBug549249i() throws JavaModelException {
15005 	this.formatterPrefs.number_of_empty_lines_to_preserve = 4;
15006 	this.formatterPrefs.blank_lines_before_new_chunk = ~2;
15007 	String input = getCompilationUnit("Formatter", "", "test549249", "in.java").getSource();
15008 	formatSource(input, getCompilationUnit("Formatter", "", "test549249", "I_out.java").getSource());
15009 }
15010 /**
15011  * https://bugs.eclipse.org/549249 - [formatter] Extend Blank Lines settings to remove excess lines
15012  */
testBug549249j()15013 public void testBug549249j() throws JavaModelException {
15014 	this.formatterPrefs.number_of_empty_lines_to_preserve = 4;
15015 	this.formatterPrefs.blank_lines_before_package = ~1;
15016 	String input = getCompilationUnit("Formatter", "", "test549249", "in.java").getSource();
15017 	formatSource(input, getCompilationUnit("Formatter", "", "test549249", "J_out.java").getSource());
15018 }
15019 /**
15020  * https://bugs.eclipse.org/549249 - [formatter] Extend Blank Lines settings to remove excess lines
15021  */
testBug549249k()15022 public void testBug549249k() throws JavaModelException {
15023 	this.formatterPrefs.number_of_empty_lines_to_preserve = 4;
15024 	this.formatterPrefs.blank_lines_between_import_groups = ~1;
15025 	String input = getCompilationUnit("Formatter", "", "test549249", "in.java").getSource();
15026 	formatSource(input, getCompilationUnit("Formatter", "", "test549249", "K_out.java").getSource());
15027 }
15028 /**
15029  * https://bugs.eclipse.org/549249 - [formatter] Extend Blank Lines settings to remove excess lines
15030  */
testBug549249l()15031 public void testBug549249l() throws JavaModelException {
15032 	this.formatterPrefs.number_of_empty_lines_to_preserve = 4;
15033 	this.formatterPrefs.blank_lines_between_type_declarations = ~3;
15034 	String input = getCompilationUnit("Formatter", "", "test549249", "in.java").getSource();
15035 	formatSource(input, getCompilationUnit("Formatter", "", "test549249", "L_out.java").getSource());
15036 }
15037 /**
15038  * https://bugs.eclipse.org/169131 - [formatter] Code formatter: blank lines after last declaration
15039  */
testBug169131a()15040 public void testBug169131a() throws JavaModelException {
15041 	setComplianceLevel(CompilerOptions.VERSION_1_8);
15042 	this.formatterPrefs.number_of_empty_lines_to_preserve = 3;
15043 	this.formatterPrefs.blank_lines_after_last_class_body_declaration = 2;
15044 	String input = getCompilationUnit("Formatter", "", "test169131", "in.java").getSource();
15045 	formatSource(input, getCompilationUnit("Formatter", "", "test169131", "A_out.java").getSource());
15046 }
15047 /**
15048  * https://bugs.eclipse.org/169131 - [formatter] Code formatter: blank lines after last declaration
15049  */
testBug169131b()15050 public void testBug169131b() throws JavaModelException {
15051 	setComplianceLevel(CompilerOptions.VERSION_1_8);
15052 	this.formatterPrefs.number_of_empty_lines_to_preserve = 3;
15053 	this.formatterPrefs.blank_lines_after_last_class_body_declaration = ~1;
15054 	String input = getCompilationUnit("Formatter", "", "test169131", "in.java").getSource();
15055 	formatSource(input, getCompilationUnit("Formatter", "", "test169131", "B_out.java").getSource());
15056 }
15057 /**
15058  * https://bugs.eclipse.org/169131 - [formatter] Code formatter: blank lines after last declaration
15059  */
testBug169131c()15060 public void testBug169131c() throws JavaModelException {
15061 	setComplianceLevel(CompilerOptions.VERSION_9);
15062 	this.formatterPrefs.blank_lines_after_last_class_body_declaration = 1;
15063 	String input =
15064 		"module aaaaaaaaaa.bbbbbbbbbb {\n" +
15065 		"	requires aaaaaaaaaa.cccccccccc; // a comment\n" +
15066 		"}";
15067 	formatSource(input,
15068 		"module aaaaaaaaaa.bbbbbbbbbb {\n" +
15069 		"	requires aaaaaaaaaa.cccccccccc; // a comment\n" +
15070 		"\n" +
15071 		"}",
15072 		CodeFormatter.K_MODULE_INFO | CodeFormatter.F_INCLUDE_COMMENTS);
15073 }
15074 /**
15075  * https://bugs.eclipse.org/169131 - [formatter] Code formatter: blank lines after last declaration
15076  */
testBug169131d()15077 public void testBug169131d() throws JavaModelException {
15078 	setComplianceLevel(CompilerOptions.VERSION_9);
15079 	this.formatterPrefs.blank_lines_after_last_class_body_declaration = ~0;
15080 	String input =
15081 		"module aaaaaaaaaa.bbbbbbbbbb {\n" +
15082 		"	requires aaaaaaaaaa.cccccccccc;\n" +
15083 		"\n" +
15084 		"}";
15085 	formatSource(input,
15086 		"module aaaaaaaaaa.bbbbbbbbbb {\n" +
15087 		"	requires aaaaaaaaaa.cccccccccc;\n" +
15088 		"}",
15089 		CodeFormatter.K_MODULE_INFO | CodeFormatter.F_INCLUDE_COMMENTS);
15090 }
15091 /**
15092  * https://bugs.eclipse.org/522089 - [formatter] Provide support for blank line before end of method
15093  */
testBug522089a()15094 public void testBug522089a() throws JavaModelException {
15095 	setComplianceLevel(CompilerOptions.VERSION_1_8);
15096 	this.formatterPrefs.number_of_empty_lines_to_preserve = 3;
15097 	this.formatterPrefs.blank_lines_at_end_of_method_body = 2;
15098 	this.formatterPrefs.blank_lines_before_new_chunk = 0;
15099 	String input = getCompilationUnit("Formatter", "", "test522089", "in.java").getSource();
15100 	formatSource(input, getCompilationUnit("Formatter", "", "test522089", "A_out.java").getSource());
15101 }
15102 /**
15103  * https://bugs.eclipse.org/522089 - [formatter] Provide support for blank line before end of method
15104  */
testBug522089b()15105 public void testBug522089b() throws JavaModelException {
15106 	setComplianceLevel(CompilerOptions.VERSION_1_8);
15107 	this.formatterPrefs.number_of_empty_lines_to_preserve = 3;
15108 	this.formatterPrefs.blank_lines_at_end_of_method_body = ~0;
15109 	this.formatterPrefs.blank_lines_before_new_chunk = 0;
15110 	String input = getCompilationUnit("Formatter", "", "test522089", "in.java").getSource();
15111 	formatSource(input, getCompilationUnit("Formatter", "", "test522089", "B_out.java").getSource());
15112 }
15113 /**
15114  * https://bugs.eclipse.org/549774 - [formatter] Change semantics of Blank lines before member declarations: 'before' -> 'between'
15115  */
testBug549774()15116 public void testBug549774() throws JavaModelException {
15117 	this.formatterPrefs.blank_lines_before_new_chunk = 1;
15118 	this.formatterPrefs.blank_lines_before_field = 2;
15119 	this.formatterPrefs.blank_lines_before_method = 3;
15120 	String input =
15121 		"class C {\n" +
15122 		"	int a;\n" +
15123 		"	String s;\n" +
15124 		"	void foo() {}\n" +
15125 		"	String bar(int a) {}\n" +
15126 		"}";
15127 	formatSource(input,
15128 		"class C {\n" +
15129 		"	int a;\n" +
15130 		"\n" +
15131 		"\n" +
15132 		"	String s;\n" +
15133 		"\n" +
15134 		"	void foo() {\n" +
15135 		"	}\n" +
15136 		"\n" +
15137 		"\n" +
15138 		"\n" +
15139 		"	String bar(int a) {\n" +
15140 		"	}\n" +
15141 		"}");
15142 }
15143 /**
15144  * https://bugs.eclipse.org/214283 - [formatter] Blank lines option should consider a virtual/interface method
15145  */
testBug214283a()15146 public void testBug214283a() throws JavaModelException {
15147 	this.formatterPrefs.blank_lines_before_abstract_method= 2;
15148 	this.formatterPrefs.blank_lines_before_method= 0;
15149 	String input = getCompilationUnit("Formatter", "", "test214283", "in.java").getSource();
15150 	formatSource(input, getCompilationUnit("Formatter", "", "test214283", "A_out.java").getSource());
15151 }
15152 /**
15153  * https://bugs.eclipse.org/214283 - [formatter] Blank lines option should consider a virtual/interface method
15154  */
testBug214283b()15155 public void testBug214283b() throws JavaModelException {
15156 	this.formatterPrefs.blank_lines_before_abstract_method= ~0;
15157 	this.formatterPrefs.blank_lines_before_method= 1;
15158 	String input = getCompilationUnit("Formatter", "", "test214283", "in.java").getSource();
15159 	formatSource(input, getCompilationUnit("Formatter", "", "test214283", "B_out.java").getSource());
15160 }
15161 /**
15162  * https://bugs.eclipse.org/214283 - [formatter] Blank lines option should consider a virtual/interface method
15163  */
testBug214283c()15164 public void testBug214283c() throws JavaModelException {
15165 	this.formatterPrefs.blank_lines_before_abstract_method= 0;
15166 	this.formatterPrefs.blank_lines_before_method= 2;
15167 	String input = getCompilationUnit("Formatter", "", "test214283", "in.java").getSource();
15168 	formatSource(input, getCompilationUnit("Formatter", "", "test214283", "C_out.java").getSource());
15169 }
15170 /**
15171  * https://bugs.eclipse.org/212867 - [formatter]: Remove blank lines after '{' and before '}'
15172  */
testBug212867a()15173 public void testBug212867a() throws JavaModelException {
15174 	this.formatterPrefs.blank_lines_at_beginning_of_code_block = 2;
15175 	this.formatterPrefs.blank_lines_at_end_of_code_block = 0;
15176 	formatSourceInWorkspace("test212867", "in.java", "A_out.java");
15177 }
15178 /**
15179  * https://bugs.eclipse.org/212867 - [formatter]: Remove blank lines after '{' and before '}'
15180  */
testBug212867b()15181 public void testBug212867b() throws JavaModelException {
15182 	this.formatterPrefs.blank_lines_at_beginning_of_code_block = 0;
15183 	this.formatterPrefs.blank_lines_at_end_of_code_block = 2;
15184 	formatSourceInWorkspace("test212867", "in.java", "B_out.java");
15185 }
15186 /**
15187  * https://bugs.eclipse.org/212867 - [formatter]: Remove blank lines after '{' and before '}'
15188  */
testBug212867c()15189 public void testBug212867c() throws JavaModelException {
15190 	this.formatterPrefs.blank_lines_at_beginning_of_code_block = 2;
15191 	this.formatterPrefs.blank_lines_at_end_of_code_block = 2;
15192 	formatSourceInWorkspace("test212867", "in.java", "C_out.java");
15193 }
15194 /**
15195  * https://bugs.eclipse.org/212867 - [formatter]: Remove blank lines after '{' and before '}'
15196  */
testBug212867d()15197 public void testBug212867d() throws JavaModelException {
15198 	this.formatterPrefs.blank_lines_at_beginning_of_code_block = ~0;
15199 	this.formatterPrefs.blank_lines_at_end_of_code_block = ~0;
15200 	formatSourceInWorkspace("test212867", "in.java", "D_out.java");
15201 }
15202 /**
15203  * https://bugs.eclipse.org/421492 - [formatter] Allow to add blank line(s) before a statement
15204  */
testBug421492a()15205 public void testBug421492a() throws JavaModelException {
15206 	this.formatterPrefs.blank_lines_before_code_block = 2;
15207 	this.formatterPrefs.blank_lines_after_code_block = 0;
15208 	formatSourceInWorkspace("test421492", "in.java", "A_out.java");
15209 }
15210 /**
15211  * https://bugs.eclipse.org/421492 - [formatter] Allow to add blank line(s) before a statement
15212  */
testBug421492b()15213 public void testBug421492b() throws JavaModelException {
15214 	this.formatterPrefs.blank_lines_before_code_block = 0;
15215 	this.formatterPrefs.blank_lines_after_code_block = 2;
15216 	formatSourceInWorkspace("test421492", "in.java", "B_out.java");
15217 }
15218 /**
15219  * https://bugs.eclipse.org/421492 - [formatter] Allow to add blank line(s) before a statement
15220  */
testBug421492c()15221 public void testBug421492c() throws JavaModelException {
15222 	this.formatterPrefs.blank_lines_before_code_block = 2;
15223 	this.formatterPrefs.blank_lines_after_code_block = 2;
15224 	formatSourceInWorkspace("test421492", "in.java", "C_out.java");
15225 }
15226 /**
15227  * https://bugs.eclipse.org/421492 - [formatter] Allow to add blank line(s) before a statement
15228  */
testBug421492d()15229 public void testBug421492d() throws JavaModelException {
15230 	this.formatterPrefs.blank_lines_before_code_block = ~0;
15231 	this.formatterPrefs.blank_lines_after_code_block = ~0;
15232 	formatSourceInWorkspace("test421492", "in.java", "D_out.java");
15233 }
15234 /**
15235  * https://bugs.eclipse.org/390720 - [formatter] Add setting for blank line between case blocks (after break) for switch statement
15236  */
testBug390720a()15237 public void testBug390720a() throws JavaModelException {
15238 	setComplianceLevel(CompilerOptions.VERSION_14);
15239 	this.formatterPrefs.blank_lines_between_statement_groups_in_switch = 2;
15240 	formatSourceInWorkspace("test390720", "in.java", "A_out.java");
15241 }
15242 /**
15243  * https://bugs.eclipse.org/390720 - [formatter] Add setting for blank line between case blocks (after break) for switch statement
15244  */
testBug390720b()15245 public void testBug390720b() throws JavaModelException {
15246 	setComplianceLevel(CompilerOptions.VERSION_14);
15247 	this.formatterPrefs.blank_lines_between_statement_groups_in_switch = ~0;
15248 	formatSourceInWorkspace("test390720", "in.java", "B_out.java");
15249 }
15250 /**
15251  * https://bugs.eclipse.org/549436 - [13] Formatter support for JEP 355 Text Block
15252  */
testBug549436a()15253 public void testBug549436a() throws JavaModelException {
15254 	setComplianceLevel(CompilerOptions.VERSION_14);
15255 	setPageWidth80();
15256 	this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
15257 	this.formatterPrefs.use_tabs_only_for_leading_indentations = false;
15258 	this.formatterPrefs.indent_empty_lines = false;
15259 	this.formatterPrefs.text_block_indentation = Alignment.M_INDENT_PRESERVE;
15260 	this.formatterPrefs.continuation_indentation = 2;
15261 	formatSourceInWorkspace("test549436", "in.java", "A_out.java");
15262 }
15263 /**
15264  * https://bugs.eclipse.org/549436 - [13] Formatter support for JEP 355 Text Block
15265  */
testBug549436b()15266 public void testBug549436b() throws JavaModelException {
15267 	setComplianceLevel(CompilerOptions.VERSION_14);
15268 	setPageWidth80();
15269 	this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
15270 	this.formatterPrefs.use_tabs_only_for_leading_indentations = false;
15271 	this.formatterPrefs.indent_empty_lines = false;
15272 	this.formatterPrefs.text_block_indentation = Alignment.M_INDENT_BY_ONE;
15273 	this.formatterPrefs.continuation_indentation = 2;
15274 	formatSourceInWorkspace("test549436", "in.java", "B_out.java");
15275 }
15276 /**
15277  * https://bugs.eclipse.org/549436 - [13] Formatter support for JEP 355 Text Block
15278  */
testBug549436c()15279 public void testBug549436c() throws JavaModelException {
15280 	setComplianceLevel(CompilerOptions.VERSION_14);
15281 	setPageWidth80();
15282 	this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
15283 	this.formatterPrefs.use_tabs_only_for_leading_indentations = false;
15284 	this.formatterPrefs.indent_empty_lines = false;
15285 	this.formatterPrefs.text_block_indentation = Alignment.M_INDENT_DEFAULT;
15286 	this.formatterPrefs.continuation_indentation = 2;
15287 	formatSourceInWorkspace("test549436", "in.java", "C_out.java");
15288 }
15289 /**
15290  * https://bugs.eclipse.org/549436 - [13] Formatter support for JEP 355 Text Block
15291  */
testBug549436d()15292 public void testBug549436d() throws JavaModelException {
15293 	setComplianceLevel(CompilerOptions.VERSION_14);
15294 	setPageWidth80();
15295 	this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
15296 	this.formatterPrefs.use_tabs_only_for_leading_indentations = false;
15297 	this.formatterPrefs.indent_empty_lines = false;
15298 	this.formatterPrefs.text_block_indentation = Alignment.M_INDENT_DEFAULT;
15299 	this.formatterPrefs.continuation_indentation = 3;
15300 	formatSourceInWorkspace("test549436", "in.java", "D_out.java");
15301 }
15302 /**
15303  * https://bugs.eclipse.org/549436 - [13] Formatter support for JEP 355 Text Block
15304  */
testBug549436e()15305 public void testBug549436e() throws JavaModelException {
15306 	setComplianceLevel(CompilerOptions.VERSION_14);
15307 	setPageWidth80();
15308 	this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.SPACE;
15309 	this.formatterPrefs.use_tabs_only_for_leading_indentations = false;
15310 	this.formatterPrefs.indent_empty_lines = false;
15311 	this.formatterPrefs.text_block_indentation = Alignment.M_INDENT_ON_COLUMN;
15312 	this.formatterPrefs.continuation_indentation = 2;
15313 	formatSourceInWorkspace("test549436", "in.java", "E_out.java");
15314 }
15315 /**
15316  * https://bugs.eclipse.org/549436 - [13] Formatter support for JEP 355 Text Block
15317  */
testBug549436f()15318 public void testBug549436f() throws JavaModelException {
15319 	setComplianceLevel(CompilerOptions.VERSION_14);
15320 	setPageWidth80();
15321 	this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.TAB;
15322 	this.formatterPrefs.use_tabs_only_for_leading_indentations = false;
15323 	this.formatterPrefs.indent_empty_lines = false;
15324 	this.formatterPrefs.text_block_indentation = Alignment.M_INDENT_BY_ONE;
15325 	this.formatterPrefs.continuation_indentation = 2;
15326 	formatSourceInWorkspace("test549436", "in.java", "F_out.java");
15327 }
15328 /**
15329  * https://bugs.eclipse.org/549436 - [13] Formatter support for JEP 355 Text Block
15330  */
testBug549436g()15331 public void testBug549436g() throws JavaModelException {
15332 	setComplianceLevel(CompilerOptions.VERSION_14);
15333 	setPageWidth80();
15334 	this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.TAB;
15335 	this.formatterPrefs.use_tabs_only_for_leading_indentations = false;
15336 	this.formatterPrefs.indent_empty_lines = true;
15337 	this.formatterPrefs.text_block_indentation = Alignment.M_INDENT_DEFAULT;
15338 	this.formatterPrefs.continuation_indentation = 2;
15339 	formatSourceInWorkspace("test549436", "in.java", "G_out.java");
15340 }
15341 /**
15342  * https://bugs.eclipse.org/549436 - [13] Formatter support for JEP 355 Text Block
15343  */
testBug549436h()15344 public void testBug549436h() throws JavaModelException {
15345 	setComplianceLevel(CompilerOptions.VERSION_14);
15346 	setPageWidth80();
15347 	this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.TAB;
15348 	this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
15349 	this.formatterPrefs.indent_empty_lines = false;
15350 	this.formatterPrefs.text_block_indentation = Alignment.M_INDENT_DEFAULT;
15351 	this.formatterPrefs.continuation_indentation = 3;
15352 	formatSourceInWorkspace("test549436", "in.java", "H_out.java");
15353 }
15354 /**
15355  * https://bugs.eclipse.org/549436 - [13] Formatter support for JEP 355 Text Block
15356  */
testBug549436i()15357 public void testBug549436i() throws JavaModelException {
15358 	setComplianceLevel(CompilerOptions.VERSION_14);
15359 	setPageWidth80();
15360 	this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.TAB;
15361 	this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
15362 	this.formatterPrefs.indent_empty_lines = true;
15363 	this.formatterPrefs.text_block_indentation = Alignment.M_INDENT_ON_COLUMN;
15364 	this.formatterPrefs.continuation_indentation = 2;
15365 	formatSourceInWorkspace("test549436", "in.java", "I_out.java");
15366 }
15367 /**
15368  * https://bugs.eclipse.org/549436 - [13] Formatter support for JEP 355 Text Block
15369  */
testBug549436j()15370 public void testBug549436j() throws JavaModelException {
15371 	setComplianceLevel(CompilerOptions.VERSION_14);
15372 	setPageWidth80();
15373 	this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.MIXED;
15374 	this.formatterPrefs.use_tabs_only_for_leading_indentations = false;
15375 	this.formatterPrefs.indent_empty_lines = false;
15376 	this.formatterPrefs.text_block_indentation = Alignment.M_INDENT_ON_COLUMN;
15377 	this.formatterPrefs.continuation_indentation = 2;
15378 	formatSourceInWorkspace("test549436", "in.java", "J_out.java");
15379 }
15380 /**
15381  * https://bugs.eclipse.org/549436 - [13] Formatter support for JEP 355 Text Block
15382  */
testBug549436k()15383 public void testBug549436k() throws JavaModelException {
15384 	setComplianceLevel(CompilerOptions.VERSION_14);
15385 	setPageWidth80();
15386 	this.formatterPrefs.tab_char = DefaultCodeFormatterOptions.TAB;
15387 	this.formatterPrefs.use_tabs_only_for_leading_indentations = false;
15388 	this.formatterPrefs.indent_empty_lines = false;
15389 	this.formatterPrefs.text_block_indentation = Alignment.M_INDENT_ON_COLUMN;
15390 	this.formatterPrefs.continuation_indentation = 2;
15391 	formatSourceInWorkspace("test549436", "in.java", "K_out.java");
15392 }
15393 /**
15394  * https://bugs.eclipse.org/54627 - [formatter] Blank lines between Javadoc tags
15395  */
testBug54627a()15396 public void testBug54627a() throws JavaModelException {
15397 	this.formatterPrefs.comment_insert_empty_line_between_different_tags = true;
15398 	String input =
15399 		"public class Test {\n" +
15400 		"	/**\n" +
15401 		"	 * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.\n" +
15402 		"	 * @param a Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n" +
15403 		"	 * @param b Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n" +
15404 		"	 * @param c Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n" +
15405 		"	 * @throws IOException Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium.\n" +
15406 		"	 * @throws SQLException Totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.\n" +
15407 		"	 * @return Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.\n" +
15408 		"	 */\n" +
15409 		"	public String f(int a, int b, int c) throws IOException, SQLException {\n" +
15410 		"		return \"\";\n" +
15411 		"	}\n" +
15412 		"}";
15413 	formatSource(input,
15414 		"public class Test {\n" +
15415 		"	/**\n" +
15416 		"	 * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\n" +
15417 		"	 * tempor incididunt ut labore et dolore magna aliqua. Neque porro quisquam est,\n" +
15418 		"	 * qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia\n" +
15419 		"	 * non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam\n" +
15420 		"	 * quaerat voluptatem.\n" +
15421 		"	 * \n" +
15422 		"	 * @param a Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris\n" +
15423 		"	 *          nisi ut aliquip ex ea commodo consequat.\n" +
15424 		"	 * @param b Duis aute irure dolor in reprehenderit in voluptate velit esse\n" +
15425 		"	 *          cillum dolore eu fugiat nulla pariatur.\n" +
15426 		"	 * @param c Excepteur sint occaecat cupidatat non proident, sunt in culpa qui\n" +
15427 		"	 *          officia deserunt mollit anim id est laborum.\n" +
15428 		"	 * \n" +
15429 		"	 * @throws IOException  Sed ut perspiciatis unde omnis iste natus error sit\n" +
15430 		"	 *                      voluptatem accusantium doloremque laudantium.\n" +
15431 		"	 * @throws SQLException Totam rem aperiam, eaque ipsa quae ab illo inventore\n" +
15432 		"	 *                      veritatis et quasi architecto beatae vitae dicta sunt\n" +
15433 		"	 *                      explicabo.\n" +
15434 		"	 * \n" +
15435 		"	 * @return Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut\n" +
15436 		"	 *         fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem\n" +
15437 		"	 *         sequi nesciunt.\n" +
15438 		"	 */\n" +
15439 		"	public String f(int a, int b, int c) throws IOException, SQLException {\n" +
15440 		"		return \"\";\n" +
15441 		"	}\n" +
15442 		"}");
15443 }
15444 /**
15445  * https://bugs.eclipse.org/54627 - [formatter] Blank lines between Javadoc tags
15446  */
testBug54627b()15447 public void testBug54627b() throws JavaModelException {
15448 	this.formatterPrefs.comment_insert_empty_line_between_different_tags = true;
15449 	String input =
15450 		"public class Test {\n" +
15451 		"	\n" +
15452 		"	/**\n" +
15453 		"	 * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.\n" +
15454 		"	 * @param a Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n" +
15455 		"	 * @param b Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n" +
15456 		"	 * @return Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.\n" +
15457 		"	 * @@org.example.transaction.interceptor.RuleBasedTransactionAttribute()\n" +
15458 		"	 * @@org.example.transaction.interceptor.RollbackRuleAttribute(Exception.class)\n" +
15459 		"	 * @@org.example.transaction.interceptor.NoRollbackRuleAttribute(\"ServletException\")\n" +
15460 		"	 */\n" +
15461 		"	public String f(int a, int b, int c) {\n" +
15462 		"		return \"\";\n" +
15463 		"	}\n" +
15464 		"}";
15465 	formatSource(input,
15466 		"public class Test {\n" +
15467 		"\n" +
15468 		"	/**\n" +
15469 		"	 * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\n" +
15470 		"	 * tempor incididunt ut labore et dolore magna aliqua. Neque porro quisquam est,\n" +
15471 		"	 * qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia\n" +
15472 		"	 * non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam\n" +
15473 		"	 * quaerat voluptatem.\n" +
15474 		"	 * \n" +
15475 		"	 * @param a Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris\n" +
15476 		"	 *          nisi ut aliquip ex ea commodo consequat.\n" +
15477 		"	 * @param b Duis aute irure dolor in reprehenderit in voluptate velit esse\n" +
15478 		"	 *          cillum dolore eu fugiat nulla pariatur.\n" +
15479 		"	 * \n" +
15480 		"	 * @return Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut\n" +
15481 		"	 *         fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem\n" +
15482 		"	 *         sequi nesciunt.\n" +
15483 		"	 * \n" +
15484 		"	 * @@org.example.transaction.interceptor.RuleBasedTransactionAttribute()\n" +
15485 		"	 * @@org.example.transaction.interceptor.RollbackRuleAttribute(Exception.class)\n" +
15486 		"	 * @@org.example.transaction.interceptor.NoRollbackRuleAttribute(\"ServletException\")\n" +
15487 		"	 */\n" +
15488 		"	public String f(int a, int b, int c) {\n" +
15489 		"		return \"\";\n" +
15490 		"	}\n" +
15491 		"}");
15492 }
15493 /**
15494  * https://bugs.eclipse.org/547261 - [formatter] Separate option for space after not (!) operator
15495  */
testBug547261()15496 public void testBug547261() throws JavaModelException {
15497 	this.formatterPrefs.insert_space_after_not_operator = true;
15498 	String input = "class C {boolean b=!a&&!(c||d)&&(f!=-5);}";
15499 	formatSource(input,
15500 		"class C {\n" +
15501 		"	boolean b = ! a && ! (c || d) && (f != -5);\n" +
15502 		"}");
15503 }
15504 /**
15505  * https://bugs.eclipse.org/553155 - [14] Records - Formatter Support
15506  */
testBug553155a()15507 public void testBug553155a() throws JavaModelException {
15508 	setComplianceLevel(CompilerOptions.VERSION_14);
15509 	formatSourceInWorkspace("test553155", "in.java", "A_out.java");
15510 }
15511 /**
15512  * https://bugs.eclipse.org/553155 - [14] Records - Formatter Support
15513  */
testBug553155b()15514 public void testBug553155b() throws JavaModelException {
15515 	setComplianceLevel(CompilerOptions.VERSION_14);
15516 	this.formatterPrefs.indent_body_declarations_compare_to_record_header = false;
15517 	formatSourceInWorkspace("test553155", "in.java", "B_out.java");
15518 }
15519 /**
15520  * https://bugs.eclipse.org/553155 - [14] Records - Formatter Support
15521  */
testBug553155c()15522 public void testBug553155c() throws JavaModelException {
15523 	setComplianceLevel(CompilerOptions.VERSION_14);
15524 	this.formatterPrefs.brace_position_for_record_declaration = DefaultCodeFormatterConstants.NEXT_LINE;
15525 	formatSourceInWorkspace("test553155", "in.java", "C_out.java");
15526 }
15527 /**
15528  * https://bugs.eclipse.org/553155 - [14] Records - Formatter Support
15529  */
testBug553155d()15530 public void testBug553155d() throws JavaModelException {
15531 	setComplianceLevel(CompilerOptions.VERSION_14);
15532 	this.formatterPrefs.brace_position_for_record_constructor = DefaultCodeFormatterConstants.NEXT_LINE;
15533 	formatSourceInWorkspace("test553155", "in.java", "D_out.java");
15534 }
15535 /**
15536  * https://bugs.eclipse.org/553155 - [14] Records - Formatter Support
15537  */
testBug553155e()15538 public void testBug553155e() throws JavaModelException {
15539 	setComplianceLevel(CompilerOptions.VERSION_14);
15540 	this.formatterPrefs.parenthesis_positions_in_record_declaration = DefaultCodeFormatterConstants.SEPARATE_LINES;
15541 	formatSourceInWorkspace("test553155", "in.java", "E_out.java");
15542 }
15543 /**
15544  * https://bugs.eclipse.org/553155 - [14] Records - Formatter Support
15545  */
testBug553155f()15546 public void testBug553155f() throws JavaModelException {
15547 	setComplianceLevel(CompilerOptions.VERSION_14);
15548 	this.formatterPrefs.insert_space_after_comma_in_record_components = false;
15549 	formatSourceInWorkspace("test553155", "in.java", "F_out.java");
15550 }
15551 /**
15552  * https://bugs.eclipse.org/553155 - [14] Records - Formatter Support
15553  */
testBug553155g()15554 public void testBug553155g() throws JavaModelException {
15555 	setComplianceLevel(CompilerOptions.VERSION_14);
15556 	this.formatterPrefs.insert_space_after_opening_paren_in_record_declaration = true;
15557 	formatSourceInWorkspace("test553155", "in.java", "G_out.java");
15558 }
15559 /**
15560  * https://bugs.eclipse.org/553155 - [14] Records - Formatter Support
15561  */
testBug553155h()15562 public void testBug553155h() throws JavaModelException {
15563 	setComplianceLevel(CompilerOptions.VERSION_14);
15564 	this.formatterPrefs.insert_space_before_closing_paren_in_record_declaration = true;
15565 	formatSourceInWorkspace("test553155", "in.java", "H_out.java");
15566 }
15567 /**
15568  * https://bugs.eclipse.org/553155 - [14] Records - Formatter Support
15569  */
testBug553155i()15570 public void testBug553155i() throws JavaModelException {
15571 	setComplianceLevel(CompilerOptions.VERSION_14);
15572 	this.formatterPrefs.insert_space_before_comma_in_record_components = true;
15573 	formatSourceInWorkspace("test553155", "in.java", "I_out.java");
15574 }
15575 /**
15576  * https://bugs.eclipse.org/553155 - [14] Records - Formatter Support
15577  */
testBug553155j()15578 public void testBug553155j() throws JavaModelException {
15579 	setComplianceLevel(CompilerOptions.VERSION_14);
15580 	this.formatterPrefs.insert_space_before_opening_brace_in_record_constructor = false;
15581 	formatSourceInWorkspace("test553155", "in.java", "J_out.java");
15582 }
15583 /**
15584  * https://bugs.eclipse.org/553155 - [14] Records - Formatter Support
15585  */
testBug553155k()15586 public void testBug553155k() throws JavaModelException {
15587 	setComplianceLevel(CompilerOptions.VERSION_14);
15588 	this.formatterPrefs.insert_space_before_opening_brace_in_record_declaration = false;
15589 	formatSourceInWorkspace("test553155", "in.java", "K_out.java");
15590 }
15591 /**
15592  * https://bugs.eclipse.org/553155 - [14] Records - Formatter Support
15593  */
testBug553155l()15594 public void testBug553155l() throws JavaModelException {
15595 	setComplianceLevel(CompilerOptions.VERSION_14);
15596 	this.formatterPrefs.insert_space_before_opening_paren_in_record_declaration = true;
15597 	formatSourceInWorkspace("test553155", "in.java", "L_out.java");
15598 }
15599 /**
15600  * https://bugs.eclipse.org/553155 - [14] Records - Formatter Support
15601  */
testBug553155m()15602 public void testBug553155m() throws JavaModelException {
15603 	setComplianceLevel(CompilerOptions.VERSION_14);
15604 	this.formatterPrefs.alignment_for_record_components = Alignment.M_ONE_PER_LINE_SPLIT + + Alignment.M_FORCE;
15605 	formatSourceInWorkspace("test553155", "in.java", "M_out.java");
15606 }
15607 /**
15608  * https://bugs.eclipse.org/553155 - [14] Records - Formatter Support
15609  */
testBug553155n()15610 public void testBug553155n() throws JavaModelException {
15611 	setComplianceLevel(CompilerOptions.VERSION_14);
15612 	this.formatterPrefs.alignment_for_superinterfaces_in_record_declaration = Alignment.M_ONE_PER_LINE_SPLIT + + Alignment.M_FORCE;
15613 	formatSourceInWorkspace("test553155", "in.java", "N_out.java");
15614 }
15615 /**
15616  * https://bugs.eclipse.org/553155 - [14] Records - Formatter Support
15617  */
testBug553155o()15618 public void testBug553155o() throws JavaModelException {
15619 	setComplianceLevel(CompilerOptions.VERSION_14);
15620 	this.formatterPrefs.keep_record_constructor_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
15621 	String source = "record Range(int lo, int hi) {public Range {foo();}}";
15622 	formatSource(source,
15623 		"record Range(int lo, int hi) {\n" +
15624 		"	public Range { foo(); }\n" +
15625 		"}");
15626 }
15627 /**
15628  * https://bugs.eclipse.org/553155 - [14] Records - Formatter Support
15629  */
testBug553155p()15630 public void testBug553155p() throws JavaModelException {
15631 	setComplianceLevel(CompilerOptions.VERSION_14);
15632 	this.formatterPrefs.keep_record_constructor_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
15633 	this.formatterPrefs.keep_record_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
15634 	String source = "record Range(int lo, int hi) {public Range {foo();}}";
15635 	formatSource(source,
15636 		"record Range(int lo, int hi) { public Range { foo(); } }");
15637 }
15638 }
15639