Update jdt.core to I20181121-1800

Change-Id: I1fd2f91f49053c04a793d2c49437d9b2e647eada
diff --git a/org.eclipse.jdt.core.tests.model/.classpath b/org.eclipse.jdt.core.tests.model/.classpath
index 0035118..7c258d5 100644
--- a/org.eclipse.jdt.core.tests.model/.classpath
+++ b/org.eclipse.jdt.core.tests.model/.classpath
@@ -1,6 +1,10 @@
 <classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src">
+		<attributes>
+			<attribute name="test" value="true"/>
+		</attributes>
+	</classpathentry>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java
index 4590978..6523f0e 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java
@@ -5723,7 +5723,7 @@
  */
 public void testBug298844a() {
 	setFormatLineCommentOnFirstColumn();
-	this.formatterPrefs.insert_new_line_in_empty_method_body = false;
+	this.formatterPrefs.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
 	String source = 
 		"public class X01 {\n" + 
 		"public X01() {\n" + 
@@ -5739,7 +5739,7 @@
 	);
 }
 public void testBug298844b() {
-	this.formatterPrefs.insert_new_line_in_empty_method_body = false;
+	this.formatterPrefs.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
 	String source = 
 		"public class X02 {\n" + 
 		"public void foo() {\n" + 
@@ -11767,7 +11767,7 @@
  * https://bugs.eclipse.org/475793 - [formatter] Incorrect whitespace after lambda block
  */
 public void testBug475793() {
-	this.formatterPrefs.insert_new_line_in_empty_block = false;
+	this.formatterPrefs.keep_lambda_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
 	String source =
 		"public class C {\r\n" + 
 		"	public void f() {\r\n" + 
@@ -11786,7 +11786,7 @@
  * https://bugs.eclipse.org/475746 - [formatter] insert-space rules sometimes ignored with anonymous subclass or when Annotations present
  */
 public void testBug475746() {
-	this.formatterPrefs.insert_new_line_in_empty_block = false;
+	this.formatterPrefs.keep_lambda_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
 	this.formatterPrefs.insert_space_after_opening_paren_in_method_invocation = true;
 	this.formatterPrefs.insert_space_before_closing_paren_in_method_invocation = true;
 	this.formatterPrefs.insert_space_after_opening_paren_in_method_declaration = true;
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java
index bd7bb18..f027f9b 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java
@@ -645,7 +645,7 @@
 	public void test041() {
 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
-		preferences.insert_new_line_in_empty_type_declaration = false;
+		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
 		runTest(codeFormatter, "test041", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
 	}
@@ -653,7 +653,7 @@
 	public void test042() {
 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
 		preferences.number_of_empty_lines_to_preserve = 0;
-		preferences.insert_new_line_in_empty_type_declaration = false;
+		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
 		preferences.insert_space_before_opening_brace_in_block = true;
 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
 		runTest(codeFormatter, "test042", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
@@ -662,7 +662,7 @@
 	public void test043() {
 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
-		preferences.insert_new_line_in_empty_type_declaration = false;
+		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
 		runTest(codeFormatter, "test043", "A.java");//$NON-NLS-1$ //$NON-NLS-2$
 	}
@@ -1940,10 +1940,10 @@
 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
 		preferences.number_of_empty_lines_to_preserve = 0;
 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
-		preferences.insert_new_line_in_empty_anonymous_type_declaration = false;
-		preferences.insert_new_line_in_empty_type_declaration = false;
-		preferences.insert_new_line_in_empty_method_body = false;
-		preferences.insert_new_line_in_empty_block = false;
+		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_code_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
 		runTest(codeFormatter, "test173", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
 	}
@@ -1954,10 +1954,10 @@
 	public void test174() {
 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
-		preferences.insert_new_line_in_empty_anonymous_type_declaration = false;
-		preferences.insert_new_line_in_empty_type_declaration = false;
-		preferences.insert_new_line_in_empty_method_body = false;
-		preferences.insert_new_line_in_empty_block = false;
+		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_code_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
 		runTest(codeFormatter, "test174", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
 	}
@@ -1969,10 +1969,9 @@
 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
 		preferences.number_of_empty_lines_to_preserve = 0;
 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
-		preferences.insert_new_line_in_empty_anonymous_type_declaration = false;
-		preferences.insert_new_line_in_empty_type_declaration = false;
-		preferences.insert_new_line_in_empty_method_body = false;
-		preferences.insert_new_line_in_empty_block = true;
+		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
 		runTest(codeFormatter, "test175", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
 	}
@@ -1983,10 +1982,9 @@
 	public void test176() {
 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
-		preferences.insert_new_line_in_empty_anonymous_type_declaration = false;
-		preferences.insert_new_line_in_empty_type_declaration = false;
-		preferences.insert_new_line_in_empty_method_body = true;
-		preferences.insert_new_line_in_empty_block = false;
+		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
 		runTest(codeFormatter, "test176", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
 	}
@@ -1997,10 +1995,9 @@
 	public void test177() {
 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
-		preferences.insert_new_line_in_empty_anonymous_type_declaration = false;
-		preferences.insert_new_line_in_empty_type_declaration = false;
-		preferences.insert_new_line_in_empty_method_body = false;
-		preferences.insert_new_line_in_empty_block = false;
+		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
 		runTest(codeFormatter, "test177", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
 	}
@@ -2011,10 +2008,9 @@
 	public void test178() {
 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
-		preferences.insert_new_line_in_empty_anonymous_type_declaration = false;
-		preferences.insert_new_line_in_empty_type_declaration = true;
-		preferences.insert_new_line_in_empty_method_body = false;
-		preferences.insert_new_line_in_empty_block = false;
+		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
 		runTest(codeFormatter, "test178", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
 	}
@@ -2025,10 +2021,9 @@
 	public void test179() {
 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
-		preferences.insert_new_line_in_empty_anonymous_type_declaration = true;
-		preferences.insert_new_line_in_empty_type_declaration = true;
-		preferences.insert_new_line_in_empty_method_body = false;
-		preferences.insert_new_line_in_empty_block = false;
+		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
 		runTest(codeFormatter, "test179", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
 	}
@@ -2039,10 +2034,9 @@
 	public void test180() {
 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
-		preferences.insert_new_line_in_empty_anonymous_type_declaration = false;
-		preferences.insert_new_line_in_empty_type_declaration = false;
-		preferences.insert_new_line_in_empty_method_body = false;
-		preferences.insert_new_line_in_empty_block = false;
+		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
 		runTest(codeFormatter, "test180", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
 	}
@@ -4293,10 +4287,9 @@
 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
 		preferences.number_of_empty_lines_to_preserve = 0;
 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
-		preferences.insert_new_line_in_empty_anonymous_type_declaration = false;
-		preferences.insert_new_line_in_empty_type_declaration = false;
-		preferences.insert_new_line_in_empty_method_body = false;
-		preferences.insert_new_line_in_empty_block = false;
+		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
 		runTest(codeFormatter, "test319", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
 	}
@@ -4305,10 +4298,9 @@
 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
 		preferences.number_of_empty_lines_to_preserve = 0;
 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
-		preferences.insert_new_line_in_empty_anonymous_type_declaration = false;
-		preferences.insert_new_line_in_empty_type_declaration = false;
-		preferences.insert_new_line_in_empty_method_body = false;
-		preferences.insert_new_line_in_empty_block = false;
+		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
 		runTest(codeFormatter, "test320", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
 	}
@@ -4317,10 +4309,9 @@
 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
 		preferences.number_of_empty_lines_to_preserve = 0;
 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
-		preferences.insert_new_line_in_empty_anonymous_type_declaration = false;
-		preferences.insert_new_line_in_empty_type_declaration = false;
-		preferences.insert_new_line_in_empty_method_body = false;
-		preferences.insert_new_line_in_empty_block = false;
+		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
 		runTest(codeFormatter, "test321", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
 	}
@@ -4329,10 +4320,9 @@
 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
 		preferences.number_of_empty_lines_to_preserve = 0;
 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
-		preferences.insert_new_line_in_empty_anonymous_type_declaration = false;
-		preferences.insert_new_line_in_empty_type_declaration = false;
-		preferences.insert_new_line_in_empty_method_body = false;
-		preferences.insert_new_line_in_empty_block = true;
+		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
 		runTest(codeFormatter, "test322", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
 	}
@@ -4341,10 +4331,10 @@
 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getEclipse21Settings());
 		preferences.number_of_empty_lines_to_preserve = 0;
 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
-		preferences.insert_new_line_in_empty_anonymous_type_declaration = false;
-		preferences.insert_new_line_in_empty_type_declaration = false;
-		preferences.insert_new_line_in_empty_method_body = false;
-		preferences.insert_new_line_in_empty_block = false;
+		preferences.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_code_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
 		runTest(codeFormatter, "test323", "A.java", CodeFormatter.K_CLASS_BODY_DECLARATIONS);//$NON-NLS-1$ //$NON-NLS-2$
 	}
@@ -4614,7 +4604,7 @@
 		preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
 		preferences.blank_lines_before_method = 1;
 		preferences.blank_lines_before_first_class_body_declaration = 1;
-		preferences.insert_new_line_in_empty_method_body = false;
+		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
 		runTest(codeFormatter, "test347", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
 	}
@@ -4631,7 +4621,7 @@
 		preferences.tab_char = DefaultCodeFormatterOptions.SPACE;
 		preferences.blank_lines_before_method = 1;
 		preferences.blank_lines_before_first_class_body_declaration = 1;
-		preferences.insert_new_line_in_empty_method_body = false;
+		preferences.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
 		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
 		runTest(codeFormatter, "test348", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
 	}
@@ -7273,9 +7263,9 @@
 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
-		preferences.insert_new_line_in_empty_type_declaration = true;
-		preferences.insert_new_line_in_empty_enum_constant = false;
-		preferences.insert_new_line_in_empty_enum_declaration = false;
+		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+		preferences.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
         preferences.tab_size = 4;
 		Hashtable javaCoreOptions = JavaCore.getOptions();
 		try {
@@ -7303,9 +7293,9 @@
 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
-		preferences.insert_new_line_in_empty_type_declaration = true;
-		preferences.insert_new_line_in_empty_enum_constant = false;
-		preferences.insert_new_line_in_empty_enum_declaration = true;
+		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+		preferences.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
         preferences.tab_size = 4;
 		Hashtable javaCoreOptions = JavaCore.getOptions();
 		try {
@@ -7333,9 +7323,9 @@
 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
-		preferences.insert_new_line_in_empty_type_declaration = true;
-		preferences.insert_new_line_in_empty_enum_constant = true;
-		preferences.insert_new_line_in_empty_enum_declaration = false;
+		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+		preferences.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+		preferences.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
         preferences.tab_size = 4;
 		Hashtable javaCoreOptions = JavaCore.getOptions();
 		try {
@@ -7363,9 +7353,9 @@
 		Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings();
 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
 		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
-		preferences.insert_new_line_in_empty_type_declaration = true;
-		preferences.insert_new_line_in_empty_enum_constant = true;
-		preferences.insert_new_line_in_empty_enum_declaration = true;
+		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+		preferences.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+		preferences.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
         preferences.tab_size = 4;
 		Hashtable javaCoreOptions = JavaCore.getOptions();
 		try {
@@ -8970,8 +8960,8 @@
 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
 		preferences.indent_body_declarations_compare_to_annotation_declaration_header = false;
 		preferences.indent_body_declarations_compare_to_type_header = true;
-		preferences.insert_new_line_in_empty_annotation_declaration = false;
-		preferences.insert_new_line_in_empty_type_declaration = true;
+		preferences.keep_annotation_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
 		Hashtable javaCoreOptions = JavaCore.getOptions();
 		try {
 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
@@ -8996,8 +8986,8 @@
 		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
 		preferences.indent_body_declarations_compare_to_annotation_declaration_header = true;
 		preferences.indent_body_declarations_compare_to_type_header = false;
-		preferences.insert_new_line_in_empty_annotation_declaration = true;
-		preferences.insert_new_line_in_empty_type_declaration = false;
+		preferences.keep_annotation_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+		preferences.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
 		Hashtable javaCoreOptions = JavaCore.getOptions();
 		try {
 			Hashtable newJavaCoreOptions = JavaCore.getOptions();
@@ -14372,4 +14362,199 @@
 	String input = getCompilationUnit("Formatter", "", "test131292", "in.java").getSource();
 	formatSource(input, getCompilationUnit("Formatter", "", "test131292", "F_out.java").getSource());
 }
+
+/**
+ * https://bugs.eclipse.org/205973 - [formatter] Allow to keep simple methods on one line (for exemple simple getter or setter)
+ */
+public void testBug205973a() throws JavaModelException {
+	setComplianceLevel(CompilerOptions.VERSION_1_8);
+	this.formatterPrefs.keep_annotation_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+	this.formatterPrefs.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+	this.formatterPrefs.keep_if_then_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+	this.formatterPrefs.keep_lambda_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+	this.formatterPrefs.keep_loop_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+	this.formatterPrefs.keep_code_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_simple_getter_setter_on_one_line = false;
+	this.formatterPrefs.keep_guardian_clause_on_one_line = false;
+	String input = getCompilationUnit("Formatter", "", "test205973", "in.java").getSource();
+	formatSource(input, getCompilationUnit("Formatter", "", "test205973", "A_out.java").getSource());
+}
+/**
+ * https://bugs.eclipse.org/205973 - [formatter] Allow to keep simple methods on one line (for exemple simple getter or setter)
+ */
+public void testBug205973b() throws JavaModelException {
+	setComplianceLevel(CompilerOptions.VERSION_1_8);
+	this.formatterPrefs.keep_annotation_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_if_then_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_lambda_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_SINGLE_ITEM;
+	this.formatterPrefs.keep_loop_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_SINGLE_ITEM;
+	this.formatterPrefs.keep_code_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+	this.formatterPrefs.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+	this.formatterPrefs.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_simple_getter_setter_on_one_line = true;
+	this.formatterPrefs.keep_guardian_clause_on_one_line = false;
+	String input = getCompilationUnit("Formatter", "", "test205973", "in.java").getSource();
+	formatSource(input, getCompilationUnit("Formatter", "", "test205973", "B_out.java").getSource());
+}
+/**
+ * https://bugs.eclipse.org/205973 - [formatter] Allow to keep simple methods on one line (for exemple simple getter or setter)
+ */
+public void testBug205973c() throws JavaModelException {
+	setComplianceLevel(CompilerOptions.VERSION_1_8);
+	this.formatterPrefs.keep_annotation_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_SINGLE_ITEM;
+	this.formatterPrefs.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_SINGLE_ITEM;
+	this.formatterPrefs.keep_if_then_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_lambda_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_loop_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_code_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+	this.formatterPrefs.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_SINGLE_ITEM;
+	this.formatterPrefs.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+	this.formatterPrefs.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+	this.formatterPrefs.keep_simple_getter_setter_on_one_line = false;
+	this.formatterPrefs.keep_guardian_clause_on_one_line = true;
+	String input = getCompilationUnit("Formatter", "", "test205973", "in.java").getSource();
+	formatSource(input, getCompilationUnit("Formatter", "", "test205973", "C_out.java").getSource());
+}
+/**
+ * https://bugs.eclipse.org/205973 - [formatter] Allow to keep simple methods on one line (for exemple simple getter or setter)
+ */
+public void testBug205973d() throws JavaModelException {
+	setComplianceLevel(CompilerOptions.VERSION_1_8);
+	this.formatterPrefs.keep_annotation_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
+	this.formatterPrefs.keep_if_then_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_lambda_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_SINGLE_ITEM;
+	this.formatterPrefs.keep_loop_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_code_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+	this.formatterPrefs.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_SINGLE_ITEM;
+	this.formatterPrefs.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_SINGLE_ITEM;
+	this.formatterPrefs.keep_simple_getter_setter_on_one_line = false;
+	this.formatterPrefs.keep_guardian_clause_on_one_line = false;
+	String input = getCompilationUnit("Formatter", "", "test205973", "in.java").getSource();
+	formatSource(input, getCompilationUnit("Formatter", "", "test205973", "D_out.java").getSource());
+}
+/**
+ * https://bugs.eclipse.org/205973 - [formatter] Allow to keep simple methods on one line (for exemple simple getter or setter)
+ */
+public void testBug205973e() throws JavaModelException {
+	setComplianceLevel(CompilerOptions.VERSION_1_8);
+	this.formatterPrefs.keep_annotation_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
+	this.formatterPrefs.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_if_then_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+	this.formatterPrefs.keep_lambda_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_loop_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
+	this.formatterPrefs.keep_code_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
+	this.formatterPrefs.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+	this.formatterPrefs.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_simple_getter_setter_on_one_line = true;
+	this.formatterPrefs.keep_guardian_clause_on_one_line = true;
+	String input = getCompilationUnit("Formatter", "", "test205973", "in.java").getSource();
+	formatSource(input, getCompilationUnit("Formatter", "", "test205973", "E_out.java").getSource());
+}
+/**
+ * https://bugs.eclipse.org/205973 - [formatter] Allow to keep simple methods on one line (for exemple simple getter or setter)
+ */
+public void testBug205973f() throws JavaModelException {
+	setComplianceLevel(CompilerOptions.VERSION_1_8);
+	this.formatterPrefs.keep_annotation_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+	this.formatterPrefs.keep_if_then_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
+	this.formatterPrefs.keep_lambda_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_loop_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_SINGLE_ITEM;
+	this.formatterPrefs.keep_code_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
+	this.formatterPrefs.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
+	this.formatterPrefs.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
+	this.formatterPrefs.keep_simple_getter_setter_on_one_line = false;
+	this.formatterPrefs.keep_guardian_clause_on_one_line = false;
+	String input = getCompilationUnit("Formatter", "", "test205973", "in.java").getSource();
+	formatSource(input, getCompilationUnit("Formatter", "", "test205973", "F_out.java").getSource());
+}
+/**
+ * https://bugs.eclipse.org/205973 - [formatter] Allow to keep simple methods on one line (for exemple simple getter or setter)
+ */
+public void testBug205973g() throws JavaModelException {
+	setComplianceLevel(CompilerOptions.VERSION_1_8);
+	this.formatterPrefs.keep_annotation_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+	this.formatterPrefs.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_if_then_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_SINGLE_ITEM;
+	this.formatterPrefs.keep_lambda_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
+	this.formatterPrefs.keep_loop_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_code_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+	this.formatterPrefs.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_SINGLE_ITEM;
+	this.formatterPrefs.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
+	this.formatterPrefs.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_simple_getter_setter_on_one_line = false;
+	this.formatterPrefs.keep_guardian_clause_on_one_line = false;
+	String input = getCompilationUnit("Formatter", "", "test205973", "in.java").getSource();
+	formatSource(input, getCompilationUnit("Formatter", "", "test205973", "G_out.java").getSource());
+}
+/**
+ * https://bugs.eclipse.org/205973 - [formatter] Allow to keep simple methods on one line (for exemple simple getter or setter)
+ */
+public void testBug205973h() throws JavaModelException {
+	setComplianceLevel(CompilerOptions.VERSION_1_8);
+	this.formatterPrefs.keep_annotation_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_PRESERVE;
+	this.formatterPrefs.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_PRESERVE;
+	this.formatterPrefs.keep_if_then_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_PRESERVE;
+	this.formatterPrefs.keep_lambda_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_PRESERVE;
+	this.formatterPrefs.keep_loop_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_PRESERVE;
+	this.formatterPrefs.keep_code_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_NEVER;
+	this.formatterPrefs.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_PRESERVE;
+	this.formatterPrefs.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_PRESERVE;
+	this.formatterPrefs.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_PRESERVE;
+	this.formatterPrefs.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_PRESERVE;
+	this.formatterPrefs.keep_simple_getter_setter_on_one_line = false;
+	this.formatterPrefs.keep_guardian_clause_on_one_line = false;
+	this.formatterPrefs.align_type_members_on_columns = true;
+	this.formatterPrefs.align_variable_declarations_on_columns = true;
+	this.formatterPrefs.align_assignment_statements_on_columns = true;
+	String input = getCompilationUnit("Formatter", "", "test205973", "in.java").getSource();
+	formatSource(input, getCompilationUnit("Formatter", "", "test205973", "H_out.java").getSource());
+}
+/**
+ * https://bugs.eclipse.org/205973 - [formatter] Allow to keep simple methods on one line (for exemple simple getter or setter)
+ */
+public void testBug205973i() throws JavaModelException {
+	setComplianceLevel(CompilerOptions.VERSION_1_8);
+	this.formatterPrefs.page_width = 50;
+	this.formatterPrefs.use_tabs_only_for_leading_indentations = true;
+	this.formatterPrefs.keep_annotation_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
+	this.formatterPrefs.keep_anonymous_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
+	this.formatterPrefs.keep_if_then_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
+	this.formatterPrefs.keep_lambda_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
+	this.formatterPrefs.keep_loop_body_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
+	this.formatterPrefs.keep_code_block_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_IF_EMPTY;
+	this.formatterPrefs.keep_enum_constant_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
+	this.formatterPrefs.keep_enum_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
+	this.formatterPrefs.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
+	this.formatterPrefs.keep_type_declaration_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
+	this.formatterPrefs.keep_simple_getter_setter_on_one_line = false;
+	this.formatterPrefs.keep_guardian_clause_on_one_line = false;
+	String input = getCompilationUnit("Formatter", "", "test205973", "in.java").getSource();
+	formatSource(input, getCompilationUnit("Formatter", "", "test205973", "I_out.java").getSource());
+}
+/**
+ * https://bugs.eclipse.org/205973 - [formatter] Allow to keep simple methods on one line (for exemple simple getter or setter)
+ */
+public void testBug205973j() throws JavaModelException {
+	setComplianceLevel(CompilerOptions.VERSION_1_8);
+	this.formatterPrefs.keep_method_body_on_one_line = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;
+	String input = getCompilationUnit("Formatter", "", "test205973", "J_in.java").getSource();
+	formatSource(input, getCompilationUnit("Formatter", "", "test205973", "J_out.java").getSource());
+}
 }
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java
index a0b495c..7aee8c4 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java
@@ -3491,6 +3491,16 @@
 				IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
 				null);
 		} catch (CoreException e) {
+			logError("exception occurred while waiting on indexing", e);
+		}
+	}
+
+	private static void logError(String errorMessage, CoreException e) {
+		Plugin plugin = JavaCore.getPlugin();
+		if (plugin != null) {
+			ILog log = plugin.getLog();
+			Status status = new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, errorMessage, e);
+			log.log(status);
 		}
 	}
 }
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachSourceTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachSourceTests.java
index 1be91df..a7d9e60 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachSourceTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachSourceTests.java
@@ -25,6 +25,7 @@
 import org.eclipse.core.filesystem.URIUtil;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IMarker;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IProjectDescription;
 import org.eclipse.core.resources.IResource;
@@ -37,6 +38,7 @@
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.jdt.core.IBuffer;
 import org.eclipse.jdt.core.IClassFile;
+import org.eclipse.jdt.core.IClasspathEntry;
 import org.eclipse.jdt.core.ICompilationUnit;
 import org.eclipse.jdt.core.IJavaElement;
 import org.eclipse.jdt.core.IJavaProject;
@@ -1902,12 +1904,18 @@
 		return;
 	}
 	try {
-		createJava9Project("Test", new String[]{"src"});
+		IJavaProject prj = createJava9Project("Test", new String[]{"src"});
 		String moduleSrc =
 			"module test {\n" +
 			"	requires oracle.net;\n" +
 			"}\n";
 		createFile("/Test/src/module-info.java", moduleSrc);
+		prj.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
+		IMarker[] markers = prj.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+		if (markers.length == 1 && markers[0].toString().contains("oracle.net cannot be resolved to a module")) {
+			System.out.println("Skipping "+getClass().getName()+".testModule2() because module oracle.net is unavailable");
+			return; // oracle.net is missing from openjdk builds
+		}
 		ICompilationUnit unit = getCompilationUnit("/Test/src/module-info.java");
 		int start = moduleSrc.indexOf("oracle.net");
 		int length = "oracle.net".length();
@@ -1926,4 +1934,55 @@
 		deleteProject("Test");
 	}
 }
+public void testModule2b() throws CoreException, IOException {
+	if (!isJRE9) {
+		System.err.println(this.getClass().getName()+'.'+getName()+" needs a Java 9 JRE - skipped");
+		return;
+	}
+	try {
+		// create project with incomplete source attachment:
+		String javaHome = System.getProperty("java.home") + File.separator;
+		Path bootModPath = new Path(javaHome +"/lib/jrt-fs.jar");
+		createSourceZip(
+				new String[] {
+					"java.base/module-info.java",
+					"module java.base {}\n",
+					"java.se.ee/module-info.java",
+					"module java.se.ee {}\n"
+				},
+				getWorkspacePath()+"/Test/src.zip");
+		Path sourceAttachment = new Path("/Test/src.zip");
+		IClasspathEntry jrtEntry;
+		jrtEntry = JavaCore.newLibraryEntry(bootModPath, sourceAttachment, null, null, null, false);
+		IJavaProject project = this.createJavaProject("Test", new String[] {"src"}, new String[0],
+				new String[0], "bin", "9");
+		IClasspathEntry[] old = project.getRawClasspath();
+		IClasspathEntry[] newPath = new IClasspathEntry[old.length +1];
+		System.arraycopy(old, 0, newPath, 0, old.length);
+		newPath[old.length] = jrtEntry;
+		project.setRawClasspath(newPath, null);
+		//
+		String moduleSrc =
+			"module test {\n" +
+			"	requires java.desktop;\n" +
+			"}\n";
+		createFile("/Test/src/module-info.java", moduleSrc);
+		ICompilationUnit unit = getCompilationUnit("/Test/src/module-info.java");
+		int start = moduleSrc.indexOf("java.desktop");
+		int length = "java.desktop".length();
+		IJavaElement[] elements = unit.codeSelect(start, length);
+		assertEquals("expected #elements", 1, elements.length);
+
+		IModuleDescription javaDesktop = (IModuleDescription) elements[0];
+		IModularClassFile cf = (IModularClassFile) javaDesktop.getClassFile();
+		assertSourceEquals(
+			"Unexpected source for class file java.desktop/module-info.class",
+			null,
+			cf.getSource());
+		ISourceRange javadocRange = javaDesktop.getJavadocRange();
+		assertEquals("javadoc from source", null, javadocRange);
+	} finally {
+		deleteProject("Test");
+	}
+}
 }
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/Bug376673Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/Bug376673Test.java
new file mode 100644
index 0000000..010f0de
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/Bug376673Test.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2018 Simeon Andreev and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ *     Simeon Andreev - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jdt.core.tests.model;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jdt.core.IJavaProject;
+
+import junit.framework.Test;
+
+public class Bug376673Test extends ModifyingResourceTests {
+
+	public Bug376673Test(String name) {
+		super(name);
+		this.endChar = "";
+	}
+
+	public static Test suite() {
+		return buildModelTestSuite(Bug376673Test.class);
+	}
+
+	/**
+     * An extra test for bug 413114 in the context of bug 376673.
+     * We want to know whether we can compile with when using a class from a jar as created in
+     * {@link org.eclipse.jdt.core.tests.model.JavaSearchBugsTests2#testBug376673e()}.
+	 */
+	public void testBug376673() throws Exception {
+		try {
+			if ("macosx".equals(System.getProperty("osgi.os"))) {
+				return;
+			}
+			IJavaProject p = createJavaProject("P", new String[] { "src" }, new String[] { "/P/lib376673.jar", "JCL17_LIB" }, "bin", "1.7");
+
+			org.eclipse.jdt.core.tests.util.Util.createJar(
+					new String[] { "p\uD842\uDF9F/i\uD842\uDF9F/Test.java",
+							"package p\uD842\uDF9F.i\uD842\uDF9F;\n" + "public class Test{}\n" },
+					p.getProject().getLocation().append("lib376673.jar").toOSString(), "1.7");
+
+			createFolder("/P/src/pkg");
+			String[] classFileContent = new String[] {
+					"package pkg;",
+					"class UseJarClass {",
+					"	public p\uD842\uDF9F.i\uD842\uDF9F.Test test;",
+					"}",
+			};
+			IFile file = createFile("/P/src/pkg/UseJarClass.java", String.join(System.lineSeparator(), classFileContent), "UTF-8");
+			file.setCharset("UTF-8", null);
+			refresh(p);
+			waitForAutoBuild();
+			waitUntilIndexesReady();
+			IMarker[] markers = p.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+			List<String> errors = new ArrayList<>();
+			StringBuilder markersToString = new StringBuilder();
+			for (IMarker marker : markers) {
+				
+				Integer severity = (Integer) marker.getAttribute(IMarker.SEVERITY);
+				String message = (String) marker.getAttribute(IMarker.MESSAGE);
+				if (severity.intValue() == IMarker.SEVERITY_ERROR) {
+					errors.add(message);
+				}
+				
+				markersToString.append("Marker with severity: ");
+				markersToString.append(severity);
+				markersToString.append(", and message: ");
+				markersToString.append(message);
+				markersToString.append(", at location: ");
+				markersToString.append(marker.getAttribute(IMarker.LOCATION));
+				markersToString.append(", at line: ");
+				markersToString.append(marker.getAttribute(IMarker.LINE_NUMBER));
+			}
+			assertEquals("expected no markers on test project, all markers are:" + System.lineSeparator() + markersToString,
+					Collections.emptyList(), errors);
+		} finally {
+			deleteProject("P");
+		}
+	}
+}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaCoreOptionsTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaCoreOptionsTests.java
index 8240228..e5d2894 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaCoreOptionsTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaCoreOptionsTests.java
@@ -120,6 +120,10 @@
 	assertTrue(JavaCore.compareJavaVersions("9", "1.8") > 0);
 	assertTrue(JavaCore.compareJavaVersions("9.0.1", "9.1.2") == 0);
 	assertTrue(JavaCore.compareJavaVersions("9", "9.1.2") == 0);
+	String latest = JavaCore.latestSupportedJavaVersion();
+	String latestPlus = "" + (Integer.parseInt(latest) + 1);
+	assertTrue(JavaCore.compareJavaVersions(latest, latestPlus) == 0);
+	
 }
 }
 
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests2.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests2.java
index d08d5a1..a4fe9ca 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests2.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests2.java
Binary files differ
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java
index 0e8f645..3c7e20f 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java
@@ -41,6 +41,7 @@
 import org.eclipse.jdt.core.IPackageFragmentRoot;
 import org.eclipse.jdt.core.IProblemRequestor;
 import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
 import org.eclipse.jdt.core.WorkingCopyOwner;
 import org.eclipse.jdt.core.dom.AST;
 import org.eclipse.jdt.core.dom.CompilationUnit;
@@ -94,6 +95,16 @@
 		deleteProject("P1");
 	}
 	
+	IClasspathAttribute[] moduleAttribute() {
+		return new IClasspathAttribute[] { JavaCore.newClasspathAttribute(IClasspathAttribute.MODULE, "true") };
+	}
+	void addModularProjectEntry(IJavaProject project, IJavaProject depProject) throws JavaModelException {
+		addClasspathEntry(project, JavaCore.newProjectEntry(depProject.getPath(), null, false, moduleAttribute(), false));
+	}
+	void addModularLibraryEntry(IJavaProject project, String libraryPath) throws JavaModelException {
+		addLibraryEntry(project, new Path(libraryPath), null, null, null, null, moduleAttribute(), false);	
+	}
+
 	// Test that the java.base found as a module package fragment root in the project 
 	public void test001() throws CoreException {
 		if (!isJRE9) return;
@@ -1837,8 +1848,8 @@
 			deleteProject("com.greetings");
 		}
 	}
-	// Changes to implicit dependencies should be reflected
-	public void test_ModuleSourcePath_implicitdeps2() throws CoreException {
+	// Changes to implicit dependencies should be reflected // FIXME: container JavaCore.MODULE_PATH_CONTAINER_ID is unreliable
+	public void _test_ModuleSourcePath_implicitdeps2() throws CoreException {
 		if (!isJRE9) return;
 		try {
 			String[] sources = new String[] {
@@ -6279,21 +6290,28 @@
 		if (!isJRE9) return;
 		ClasspathJrt.resetCaches();
 		try {
-			IJavaProject javaProject = createJava9Project("mod1", new String[] {"src"});
+			// jdk.rmic is not be visible to code in an unnamed module, but using requires we can see the module.
+			// only, there's nothing exported from it (which is why JEP 261 hides it from unnamed), so we --add-reads:
+			IClasspathAttribute[] attrs = new IClasspathAttribute[] {
+				JavaCore.newClasspathAttribute(IClasspathAttribute.ADD_EXPORTS, "jdk.rmic/sun.rmi.rmic=mod1")
+			};
+			IJavaProject javaProject = createJava9ProjectWithJREAttributes("mod1", new String[] {"src"}, attrs);
 
 			String srcMod =
-				"@SuppressWarnings(\"removal\")\n" + // javax.xml.ws.annotation is deprecated for removal
 				"module mod1 {\n" + 
 				"	exports com.mod1.pack1;\n" + 
-				"	requires java.xml.ws.annotation;\n" + 
+				"	requires jdk.rmic;\n" + 
 				"}";
 			createFile("/mod1/src/module-info.java", 
 				srcMod);
 			createFolder("/mod1/src/com/mod1/pack1");
 			String srcX =
 				"package com.mod1.pack1;\n" +
-				"@javax.annotation.Generated(\"com.acme.generator.CodeGen\")\n" +
+				"import sun.rmi.rmic.Main;\n" +
 				"public class Dummy {\n" +
+				"	String test() {\n" +
+				"		return Main.getString(\"in\");\n" +
+				"	}\n" +
 				"}";
 			createFile("/mod1/src/com/mod1/pack1/Dummy.java", srcX);
 
@@ -6318,6 +6336,92 @@
 		}
 	}
 
+	public void testBug526054b() throws Exception {
+		if (!isJRE9) return;
+		ClasspathJrt.resetCaches();
+		try {
+			// one project can see jdk.rmic/sun.rmi.rmic
+			IClasspathAttribute[] attrs = new IClasspathAttribute[] {
+				JavaCore.newClasspathAttribute(IClasspathAttribute.ADD_EXPORTS, "jdk.rmic/sun.rmi.rmic=mod1")
+			};
+			createJava9ProjectWithJREAttributes("mod1", new String[] {"src"}, attrs);
+
+			String srcMod1 =
+				"module mod1 {\n" + 
+				"	exports com.mod1.pack1;\n" + 
+				"	requires jdk.rmic;\n" + 
+				"}";
+			createFile("/mod1/src/module-info.java", 
+				srcMod1);
+			createFolder("/mod1/src/com/mod1/pack1");
+			String srcX1 =
+				"package com.mod1.pack1;\n" +
+				"import sun.rmi.rmic.Constants;\n" + // this should never be complained against due to above add-exports.
+				"public class Dummy implements Constants {\n" +
+				"}";
+			createFile("/mod1/src/com/mod1/pack1/Dummy.java", srcX1);
+			
+			// second project cannot see jdk.rmic/sun.rmi.rmic:
+			createJava9Project("mod2", new String[] {"src"});
+
+			String srcMod2 =
+				"module mod2 {\n" + 
+				"	exports com.mod2.pack1;\n" + 
+				"	requires jdk.rmic;\n" + 
+				"}";
+			createFile("/mod2/src/module-info.java", 
+				srcMod2);
+			createFolder("/mod2/src/com/mod2/pack1");
+			String srcX2 =
+				"package com.mod2.pack1;\n" +
+				"import sun.rmi.rmic.Main;\n" +
+				"public class Dummy {\n" +
+				"	String test() {\n" +
+				"		return Main.getString(\"in\");\n" +
+				"	}\n" +
+				"}";
+			createFile("/mod2/src/com/mod2/pack1/Dummy.java", srcX2);
+
+			// check first:
+			this.problemRequestor.initialize(srcX1.toCharArray());
+			getWorkingCopy("/mod1/src/com/mod1/pack1/Dummy.java", srcX1, true);
+			assertProblems("Dummy in mod1 should have no problems",
+					"----------\n" + 
+					"----------\n",
+					this.problemRequestor);
+
+			// check second:
+			this.problemRequestor.initialize(srcX2.toCharArray());
+			getWorkingCopy("/mod2/src/com/mod2/pack1/Dummy.java", srcX2, true);
+			assertProblems("Dummy in mod2 should have problems",
+					"----------\n" + 
+					"1. ERROR in /mod2/src/com/mod2/pack1/Dummy.java (at line 2)\n" + 
+					"	import sun.rmi.rmic.Main;\n" + 
+					"	       ^^^^^^^^^^^^^^^^^\n" + 
+					"The type sun.rmi.rmic.Main is not accessible\n" + 
+					"----------\n" + 
+					"2. ERROR in /mod2/src/com/mod2/pack1/Dummy.java (at line 5)\n" + 
+					"	return Main.getString(\"in\");\n" + 
+					"	       ^^^^\n" + 
+					"Main cannot be resolved\n" + 
+					"----------\n",
+					this.problemRequestor);
+
+			// check both in a combined build
+			getWorkspace().build(IncrementalProjectBuilder.CLEAN_BUILD, null);
+			getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+			IMarker[] markers = getWorkspace().getRoot().findMarkers(null, true, IResource.DEPTH_INFINITE);
+			sortMarkers(markers);
+			assertMarkers("Unexpected markers",
+					"The type sun.rmi.rmic.Main is not accessible\n" + 
+					"Main cannot be resolved",
+					markers);
+		} finally {
+			deleteProject("mod1");
+			deleteProject("mod2");
+		}
+	}
+
 	public void testBug525918() throws CoreException {
 		if (!isJRE9) return;
 		try {
@@ -7018,6 +7122,194 @@
 			JavaCore.setOptions(options);
 		}
 	}
+	// missing linked jar must not cause NPE
+	public void testBug540904() throws CoreException, IOException {
+		if (!isJRE9) return;
+		try {
+			String[] src = new String[] { 
+					"src/test/Test.java",
+					"package test;\n" +
+					"public class Test {\n" +
+					"}"
+			};
+			IJavaProject p2 = setupModuleProject("Bug540904", src, new IClasspathEntry[] {  });
+			IFile file = getFile("/Bug540904/link.jar");
+			file.createLink(new Path("MISSING/missing.jar"), IResource.ALLOW_MISSING_LOCAL, null);
+			addLibraryEntry(p2, file.getFullPath(), false);
+			getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+			IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+			assertMarkers("Unexpected markers", "", markers);
+		} finally {
+			this.deleteProject("Bug540904");
+		}
+	}
+	public void testBug540788() throws Exception {
+		if (!isJRE9) return;
+		try {
+			// project common:
+			IJavaProject common = createJava9Project("Bug540788.common", new String[] { "src/main/java" });
+			createSourceFiles(common,
+					new String[] {
+						"src/main/java/module-info.java",
+						"module org.sheepy.common {\n" + 
+						"	requires transitive org.eclipse.emf.common;\n" + 
+						"	requires transitive org.eclipse.emf.ecore;\n" + 
+						"}\n"
+					});
+			IFolder libs = createFolder("/Bug540788.common/libs");
+			String emfCommonPath = libs.getLocation()+"/org.eclipse.emf.common.jar";
+			Util.createJar(
+					new String[] {
+							"src/org/eclipse/emf/common/Foo.java",
+							"package org.eclipse.emf.common;\n" +
+							"public interface Foo {\n" +
+							"}",
+					},
+					null,
+					new HashMap<>(),
+					null,
+					emfCommonPath);
+			addModularLibraryEntry(common, emfCommonPath);
+			String ecorePath = libs.getLocation()+"/org.eclipse.emf.ecore.jar";
+			Util.createJar(
+					new String[] {
+						"src/org/eclipse/emf/ecore/EObject.java",
+						"package org.eclipse.emf.ecore;\n" +
+						"public interface EObject {\n" +
+						"}",
+					},
+					null,
+					new HashMap<>(),
+					null,
+					ecorePath);
+			addModularLibraryEntry(common, ecorePath);
+			// project vulkan:
+			IJavaProject vulkan = createJava9Project("Bug540788.vulkan", new String[] { "src/main/java" });
+			createSourceFiles(vulkan,
+					new String[] {
+						"src/main/java/module-info.java",
+						"module org.sheepy.vulkan {\n" + 
+						"	requires transitive org.sheepy.common;\n" + 
+						"	exports org.sheepy.vulkan.model.resource;\n" + 
+						"}\n",
+						"src/main/java/org/sheepy/vulkan/model/resource/Resource.java",
+						"package org.sheepy.vulkan.model.resource;\n" + 
+						"import org.eclipse.emf.ecore.EObject;\n" + 
+						"public interface Resource extends EObject {\n" + 
+						"}\n",
+						"src/main/java/org/sheepy/vulkan/model/resource/VulkanBuffer.java",
+						"package org.sheepy.vulkan.model.resource;\n" + 
+						"public interface VulkanBuffer extends Resource {\n" + 
+						"}\n",
+					});
+			addModularProjectEntry(vulkan, common);
+			addModularLibraryEntry(vulkan, emfCommonPath);
+			addModularLibraryEntry(vulkan, ecorePath);
+			// project vulkan.demo
+			IJavaProject vulkan_demo = createJava9Project("Bug540788.vulkan.demo", new String[] { "src/main/java" });
+			createSourceFiles(vulkan_demo,
+					new String[] {
+						"src/main/java/module-info.java",
+						"module org.sheepy.vulkan.demo {\n" + 
+						"	exports org.sheepy.vulkan.demo.model;\n" + 
+						"	requires org.sheepy.vulkan;\n" + 
+						"}\n",
+						"src/main/java/org/sheepy/vulkan/demo/model/UniformBuffer.java",
+						"package org.sheepy.vulkan.demo.model;\n" + 
+						"import org.sheepy.vulkan.model.resource.VulkanBuffer;\n" + 
+						"public interface UniformBuffer extends VulkanBuffer {\n" + 
+						"}\n",
+					});
+			addModularProjectEntry(vulkan_demo, vulkan);
+			addModularProjectEntry(vulkan_demo, common);
+			addModularLibraryEntry(vulkan_demo, emfCommonPath);
+			addModularLibraryEntry(vulkan_demo, ecorePath);
+			
+			getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+			IMarker[] markers = vulkan_demo.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+			assertMarkers("Unexpected markers", "", markers);
+		} finally {
+			deleteProject("Bug540788.common");
+			deleteProject("Bug540788.vulkan");
+			deleteProject("Bug540788.vulkan.demo");
+		}
+	}
+	public void testBug541015() throws Exception {
+		try {
+			IJavaProject m1 = createJava9Project("m1", new String[] { "src" });
+			createSourceFiles(m1,
+					new String[] {
+						"src/module-info.java",
+						"module m1 { exports org.p1; }\n",
+						"src/org/p1/T1.java",
+						"package org.p1;\n" +
+						"public class T1 {}\n"
+					});
+			IJavaProject m2 = createJava9Project("m2", new String[] { "src" });
+			createSourceFiles(m2,
+					new String[] {
+						"src/module-info.java",
+						"module m2 { exports org.p1; }\n",
+						"src/org/p1/T1.java",
+						"package org.p1;\n" +
+						"public class T1 {}\n"
+					});
+			IJavaProject m3 = createJava9Project("m3", new String[] { "src" });
+			createSourceFiles(m3,
+					new String[] {
+						"src/module-info.java",
+						"module m3 { exports org.p1; }\n",
+						"src/org/p1/T1.java",
+						"package org.p1;\n" +
+						"public class T1 {}\n"
+					});
+			IJavaProject unnamed = createJava9Project("unnamed", new String[] { "src" });
+			String testSource = "package test;\n" +
+			"import org.p1.T1;\n" +
+			"public class Test {\n" +
+			"	T1 t1;\n" +
+			"}\n";
+			createSourceFiles(unnamed,
+					new String[] {
+						"src/test/Test.java",
+						testSource
+					});
+			addModularProjectEntry(unnamed, m1);
+			addModularProjectEntry(unnamed, m2);
+			addModularProjectEntry(unnamed, m3);
+			
+			getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+			IMarker[] markers = unnamed.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+			sortMarkers(markers);
+			assertMarkers("Unexpected markers",
+					"The import org.p1.T1 cannot be resolved\n" + 
+					"T1 cannot be resolved to a type",
+					markers);
+			
+			char[] sourceChars = testSource.toCharArray();
+			this.problemRequestor.initialize(sourceChars);
+			getCompilationUnit("/unnamed/src/test/Test.java").getWorkingCopy(this.wcOwner, null);
+			assertProblems(
+					"Unexpected problems",
+					"----------\n" + 
+					"1. ERROR in /unnamed/src/test/Test.java (at line 2)\n" + 
+					"	import org.p1.T1;\n" + 
+					"	       ^^^^^^^^^\n" + 
+					"The import org.p1.T1 cannot be resolved\n" + 
+					"----------\n" + 
+					"2. ERROR in /unnamed/src/test/Test.java (at line 4)\n" + 
+					"	T1 t1;\n" + 
+					"	^^\n" + 
+					"T1 cannot be resolved to a type\n" + 
+					"----------\n",
+					this.problemRequestor);
+		} finally {
+			deleteProject("m1");
+			deleteProject("m2");
+			deleteProject("m3");
+			deleteProject("unnamed");
+		}
+	}
 	protected void assertNoErrors() throws CoreException {
 		for (IProject p : getWorkspace().getRoot().getProjects()) {
 			int maxSeverity = p.findMaxProblemSeverity(null, true, IResource.DEPTH_INFINITE);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java
index 4560776..55168e7 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java
@@ -5939,5 +5939,59 @@
 			deleteProject(project18);
 	}
 }
+public void testBug534865() throws CoreException, IOException {
+	IJavaProject project18 = null;
+	try {
+		project18 = createJavaProject("Reconciler18", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin");
+		setUpProjectCompliance(project18, "1.8");
+		project18.setOption(JavaCore.COMPILER_ANNOTATION_NULL_ANALYSIS, JavaCore.ENABLED);
+		createFolder("/Reconciler18/src/org/eclipse/jdt/annotation");
+		createFile(
+			"/Reconciler18/src/org/eclipse/jdt/annotation/Nullable.java",
+			"package org.eclipse.jdt.annotation;\n" +
+					"import static java.lang.annotation.ElementType.TYPE_USE;\n" + 
+					"\n" + 
+					"import java.lang.annotation.Documented;\n" + 
+					"import java.lang.annotation.Retention;\n" + 
+					"import java.lang.annotation.RetentionPolicy;\n" + 
+					"import java.lang.annotation.Target;\n" +
+					"@Documented\n" + 
+					"@Retention(RetentionPolicy.CLASS)\n" + 
+					"@Target({ TYPE_USE })\n" + 
+					"public @interface Nullable {\n" + 
+					"	// marker annotation with no members\n" + 
+					"}\n"
+		);
+		String source = 
+				"package org.eclipse.jdt.annotation;\n" +
+				"import static java.lang.annotation.ElementType.TYPE_USE;\n" + 
+				"\n" + 
+				"import java.lang.annotation.Documented;\n" + 
+				"import java.lang.annotation.Retention;\n" + 
+				"import java.lang.annotation.RetentionPolicy;\n" + 
+				"import java.lang.annotation.Target;\n" +
+				"@Documented\n" + 
+				"@Retention(RetentionPolicy.CLASS)\n" + 
+				"@Target({ TYPE_USE })\n" + 
+				"public @interface NonNull {\n" + 
+				"	// marker annotation with no members\n" + 
+				"}\n";
 
+		createFile(
+			"/Reconciler18/src/org/eclipse/jdt/annotation/NonNull.java",
+			source
+		);
+		this.workingCopies = new ICompilationUnit[1];
+		this.problemRequestor.initialize(source.toCharArray());
+		this.workingCopies[0] = getCompilationUnit("/Reconciler18/src/org/eclipse/jdt/annotation/NonNull.java").getWorkingCopy(this.wcOwner, null);
+		assertProblems(
+			"Unexpected problems",
+			"----------\n" + 
+			"----------\n"
+		);
+	} finally {
+		if (project18 != null)
+			deleteProject(project18);
+	}
+}
 }
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests9.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests9.java
index 92d8969..919c45e 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests9.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests9.java
@@ -16,8 +16,15 @@
 
 
 import java.io.IOException;
+import java.util.Hashtable;
 
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
 import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IClasspathAttribute;
+import org.eclipse.jdt.core.IClasspathEntry;
 import org.eclipse.jdt.core.ICompilationUnit;
 import org.eclipse.jdt.core.IJavaProject;
 import org.eclipse.jdt.core.IProblemRequestor;
@@ -393,4 +400,54 @@
 		deleteProject("P1");
 	}
 }
+public void testBug540541() throws CoreException, IOException {
+	if (!isJRE9) return;
+	IJavaProject project1 = null;
+	IJavaProject project2 = null;
+	Hashtable<String, String> options = JavaCore.getOptions();
+	try {
+		project1 = createJava9Project("java.base", "9");
+		createFile("/java.base/src/module-info.java",
+					"module java.base {\n" +
+					"	exports java.lang;\n" +
+					"}");
+		createFolder("/java.base/src/java/lang");
+		createFile("/java.base/src/java/lang/Object.java",
+					"package java.lang;\n" +
+					"public class Object {\n" +
+					"}\n");
+		
+		project1.setRawClasspath(new IClasspathEntry[] {JavaCore.newSourceEntry(new Path("/java.base/src"))}, null);
+		project1.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
+		IMarker[] markers = project1.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+		assertMarkers("Unexpected markers on java.base", "", markers);
+		
+		project2 = createJava9Project("client", "9");
+		IClasspathAttribute[] attributes = new IClasspathAttribute[] { JavaCore.newClasspathAttribute("module", "true") };
+		IClasspathEntry projectEntry = JavaCore.newProjectEntry(project1.getPath(), null, false, attributes, false);
+		project2.setRawClasspath(new IClasspathEntry[] {projectEntry, JavaCore.newSourceEntry(new Path("/client/src"))}, null);
+		createFolder("/client/src/p");
+		createFile("/client/src/p/X.java",
+					"package p;\n" +
+					"public class X {\n" +
+					"}\n");
+		this.workingCopy = getCompilationUnit("client/src/p/X.java").getWorkingCopy(this.wcOwner, null);
+		this.problemRequestor.initialize(this.workingCopy.getSource().toCharArray());
+		this.workingCopy.reconcile(AST_INTERNAL_JLS11, true, this.wcOwner, null);
+		assertProblems("Expecting no problems",
+						"----------\n" + 
+						"----------\n",
+						this.problemRequestor);
+		
+		markers = project2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+		assertMarkers("Unexpected markers on client", "", markers);
+	} finally {
+		if (project1 != null)
+			deleteProject(project1);
+		if (project2 != null)
+			deleteProject(project2);
+		JavaCore.setOptions(options);
+	}
+}
+
 }
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests9.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests9.java
index 9e76945..b5ff9eb 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests9.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests9.java
@@ -268,13 +268,11 @@
 			int length = selection.length();
 			
 			waitUntilIndexesReady();
-			// once indexes are ready, there's no second try and since
-			// SelectionOnQualifiedTypeReference ("test.ITest") cannot be resolved, 
-			// we don't recognize the selection:
+			// even after indexes are built we meanwhile (after bug 540541) find the selected type
 			IJavaElement[] elements = this.wc.codeSelect(start, length);
 			assertElementsEqual(
 				"Unexpected elements",
-				"",
+				"ITest [in ITest.java [in test [in src [in Resolve]]]]",
 				elements
 			);
 		} finally {
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RunJavaSearchTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RunJavaSearchTests.java
index 3695005..1333386 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RunJavaSearchTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RunJavaSearchTests.java
@@ -71,6 +71,7 @@
 		allClasses.add(JavaSearchScopeTests.class);
 		allClasses.add(MatchingRegionsTest.class);
 		allClasses.add(JavaIndexTests.class);
+		allClasses.add(Bug376673Test.class);
 
 		// Reset forgotten subsets of tests
 		TestCase.TESTS_PREFIX = null;
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/A_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/A_out.java
new file mode 100644
index 0000000..89aa366
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/A_out.java
@@ -0,0 +1,160 @@
+class Example {
+	public void example() {
+		for (int i = 0; i < 10; i++) {}
+		int a = 10;
+		while (a-- > 0) {
+			System.out.println(a);
+		}
+		do {
+			a += 2;
+			System.out.println(a);
+		} while (a < 50);
+	}
+}
+
+class Example {
+	public String example(int a) {
+		if (a < 0) {
+			throw new IllegalArgumentException();
+		}
+		if (a == 0) {
+			return null;
+		}
+		if (false) {}
+		if (a % 3 == 0) {
+			System.out.println("fizz");
+		}
+		if (a % 5 == 0) {
+			System.out.println("buzz");
+			return "";
+		}
+		return Integer.toString(a);
+	}
+}
+
+class Example {
+	Runnable emptyLambda = () -> {};
+	Runnable emptyLambda2 = () -> {};
+	Runnable tinyLambda = () -> {
+		doSomething();
+	};
+	Runnable smallLambda = () -> {
+		doFirstThing();
+		doSecondThing();
+	};
+}
+
+class Example {
+	static {
+	}
+
+	void foo() {
+		if (true) {
+		} else {
+		}
+		synchronized (this) {
+		}
+		try {
+		} finally {
+		}
+
+		labeled: {
+		}
+	}
+}
+
+public class Example {
+	private int something;
+
+	public int getSomething() {
+		return something;
+	}
+
+	public void setSomehing(int something) {
+		this.something = something;
+	}
+
+	public void doNoting() {
+	}
+
+	public void doOneThing() {
+		System.out.println();
+	}
+
+	public void doMoreThings() {
+		something = 4;
+		doOneThing();
+		doOneThing();
+	}
+}
+
+public class EmptyClass {
+}
+
+public class TinyClass {
+	int a;
+}
+
+public class SmallClass {
+	int a;
+	String b;
+}
+
+public class AnonymousClasses {
+	EmptyClass emptyAnonymous = new EmptyClass() {};
+	TinyClass tinyAnonymous = new TinyClass() {
+		String b;
+	};
+	Object o = new SmallClass() {
+		int a;
+
+		int getA() {
+			return a;
+		}
+	};
+}
+
+public enum EmptyEnum {
+}
+
+public enum TinyEnum {
+	A;
+}
+
+public enum SmallEnum {
+	VALUE(0);
+	SmallEnum(int val) {
+	};
+}
+
+public enum EnumConstants {
+	EMPTY {
+	},
+	TINY {
+		int getVal() {
+			return 2;
+		}
+	},
+	SMALL {
+		int val = 3;
+
+		int getVal() {
+			return 3;
+		}
+	};
+	int getVal() {
+		return 1;
+	}
+}
+
+public @interface EmptyInterface {}
+
+public @interface TinyInterface {
+	void run();
+}
+
+public @interface SmallInteface {
+	int toA();
+
+	String toB();
+}
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/B_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/B_out.java
new file mode 100644
index 0000000..4c112b8
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/B_out.java
@@ -0,0 +1,145 @@
+class Example {
+	public void example() {
+		for (int i = 0; i < 10; i++) {}
+		int a = 10;
+		while (a-- > 0) { System.out.println(a); }
+		do {
+			a += 2;
+			System.out.println(a);
+		} while (a < 50);
+	}
+}
+
+class Example {
+	public String example(int a) {
+		if (a < 0) {
+			throw new IllegalArgumentException();
+		}
+		if (a == 0) {
+			return null;
+		}
+		if (false) {
+		}
+		if (a % 3 == 0) {
+			System.out.println("fizz");
+		}
+		if (a % 5 == 0) {
+			System.out.println("buzz");
+			return "";
+		}
+		return Integer.toString(a);
+	}
+}
+
+class Example {
+	Runnable emptyLambda = () -> {};
+	Runnable emptyLambda2 = () -> {};
+	Runnable tinyLambda = () -> { doSomething(); };
+	Runnable smallLambda = () -> {
+		doFirstThing();
+		doSecondThing();
+	};
+}
+
+class Example {
+	static {
+	}
+
+	void foo() {
+		if (true) {
+		} else {
+		}
+		synchronized (this) {
+		}
+		try {
+		} finally {
+		}
+
+		labeled: {
+		}
+	}
+}
+
+public class Example {
+	private int something;
+
+	public int getSomething() { return something; }
+
+	public void setSomehing(int something) { this.something = something; }
+
+	public void doNoting() {
+	}
+
+	public void doOneThing() {
+		System.out.println();
+	}
+
+	public void doMoreThings() {
+		something = 4;
+		doOneThing();
+		doOneThing();
+	}
+}
+
+public class EmptyClass {
+}
+
+public class TinyClass {
+	int a;
+}
+
+public class SmallClass {
+	int a;
+	String b;
+}
+
+public class AnonymousClasses {
+	EmptyClass emptyAnonymous = new EmptyClass() {
+	};
+	TinyClass tinyAnonymous = new TinyClass() {
+		String b;
+	};
+	Object o = new SmallClass() {
+		int a;
+
+		int getA() { return a; }
+	};
+}
+
+public enum EmptyEnum {}
+
+public enum TinyEnum {
+	A;
+}
+
+public enum SmallEnum {
+	VALUE(0);
+	SmallEnum(int val) {
+	};
+}
+
+public enum EnumConstants {
+	EMPTY {},
+	TINY {
+		int getVal() { return 2; }
+	},
+	SMALL {
+		int val = 3;
+
+		int getVal() { return 3; }
+	};
+	int getVal() { return 1; }
+}
+
+public @interface EmptyInterface {
+}
+
+public @interface TinyInterface {
+	void run();
+}
+
+public @interface SmallInteface {
+	int toA();
+
+	String toB();
+}
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/C_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/C_out.java
new file mode 100644
index 0000000..ec05534
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/C_out.java
@@ -0,0 +1,143 @@
+class Example {
+	public void example() {
+		for (int i = 0; i < 10; i++) {
+		}
+		int a = 10;
+		while (a-- > 0) {
+			System.out.println(a);
+		}
+		do {
+			a += 2;
+			System.out.println(a);
+		} while (a < 50);
+	}
+}
+
+class Example {
+	public String example(int a) {
+		if (a < 0) { throw new IllegalArgumentException(); }
+		if (a == 0) { return null; }
+		if (false) {
+		}
+		if (a % 3 == 0) {
+			System.out.println("fizz");
+		}
+		if (a % 5 == 0) {
+			System.out.println("buzz");
+			return "";
+		}
+		return Integer.toString(a);
+	}
+}
+
+class Example {
+	Runnable emptyLambda = () -> {
+	};
+	Runnable emptyLambda2 = () -> {
+	};
+	Runnable tinyLambda = () -> {
+		doSomething();
+	};
+	Runnable smallLambda = () -> {
+		doFirstThing();
+		doSecondThing();
+	};
+}
+
+class Example {
+	static {}
+
+	void foo() {
+		if (true) {} else {}
+		synchronized (this) {}
+		try {} finally {}
+
+		labeled: {}
+	}
+}
+
+public class Example {
+	private int something;
+
+	public int getSomething() {
+		return something;
+	}
+
+	public void setSomehing(int something) {
+		this.something = something;
+	}
+
+	public void doNoting() {}
+
+	public void doOneThing() {
+		System.out.println();
+	}
+
+	public void doMoreThings() {
+		something = 4;
+		doOneThing();
+		doOneThing();
+	}
+}
+
+public class EmptyClass {}
+
+public class TinyClass {
+	int a;
+}
+
+public class SmallClass {
+	int a;
+	String b;
+}
+
+public class AnonymousClasses {
+	EmptyClass emptyAnonymous = new EmptyClass() {};
+	TinyClass tinyAnonymous = new TinyClass() { String b; };
+	Object o = new SmallClass() {
+		int a;
+
+		int getA() {
+			return a;
+		}
+	};
+}
+
+public enum EmptyEnum {}
+
+public enum TinyEnum { A; }
+
+public enum SmallEnum {
+	VALUE(0);
+	SmallEnum(int val) {};
+}
+
+public enum EnumConstants {
+	EMPTY {
+	},
+	TINY {
+		int getVal() {
+			return 2;
+		}
+	},
+	SMALL {
+		int val = 3;
+
+		int getVal() {
+			return 3;
+		}
+	};
+	int getVal() {
+		return 1;
+	}
+}
+
+public @interface EmptyInterface {}
+
+public @interface TinyInterface { void run(); }
+
+public @interface SmallInteface {
+	int toA();
+
+	String toB();
+}
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/D_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/D_out.java
new file mode 100644
index 0000000..a1e2cca
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/D_out.java
@@ -0,0 +1,148 @@
+class Example {
+	public void example() {
+		for (int i = 0; i < 10; i++) {
+		}
+		int a = 10;
+		while (a-- > 0) {
+			System.out.println(a);
+		}
+		do {
+			a += 2;
+			System.out.println(a);
+		} while (a < 50);
+	}
+}
+
+class Example {
+	public String example(int a) {
+		if (a < 0) {
+			throw new IllegalArgumentException();
+		}
+		if (a == 0) {
+			return null;
+		}
+		if (false) {
+		}
+		if (a % 3 == 0) {
+			System.out.println("fizz");
+		}
+		if (a % 5 == 0) {
+			System.out.println("buzz");
+			return "";
+		}
+		return Integer.toString(a);
+	}
+}
+
+class Example {
+	Runnable emptyLambda = () -> {};
+	Runnable emptyLambda2 = () -> {};
+	Runnable tinyLambda = () -> { doSomething(); };
+	Runnable smallLambda = () -> {
+		doFirstThing();
+		doSecondThing();
+	};
+}
+
+class Example {
+	static {}
+
+	void foo() {
+		if (true) {} else {}
+		synchronized (this) {}
+		try {} finally {}
+
+		labeled: {}
+	}
+}
+
+public class Example {
+	private int something;
+
+	public int getSomething() {
+		return something;
+	}
+
+	public void setSomehing(int something) {
+		this.something = something;
+	}
+
+	public void doNoting() {
+	}
+
+	public void doOneThing() {
+		System.out.println();
+	}
+
+	public void doMoreThings() {
+		something = 4;
+		doOneThing();
+		doOneThing();
+	}
+}
+
+public class EmptyClass {}
+
+public class TinyClass { int a; }
+
+public class SmallClass {
+	int a;
+	String b;
+}
+
+public class AnonymousClasses {
+	EmptyClass emptyAnonymous = new EmptyClass() {};
+	TinyClass tinyAnonymous = new TinyClass() { String b; };
+	Object o = new SmallClass() {
+		int a;
+
+		int getA() {
+			return a;
+		}
+	};
+}
+
+public enum EmptyEnum {
+}
+
+public enum TinyEnum {
+	A;
+}
+
+public enum SmallEnum {
+	VALUE(0);
+	SmallEnum(int val) {
+	};
+}
+
+public enum EnumConstants {
+	EMPTY {},
+	TINY {
+		int getVal() {
+			return 2;
+		}
+	},
+	SMALL {
+		int val = 3;
+
+		int getVal() {
+			return 3;
+		}
+	};
+	int getVal() {
+		return 1;
+	}
+}
+
+public @interface EmptyInterface {
+}
+
+public @interface TinyInterface {
+	void run();
+}
+
+public @interface SmallInteface {
+	int toA();
+
+	String toB();
+}
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/E_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/E_out.java
new file mode 100644
index 0000000..60cf56f
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/E_out.java
@@ -0,0 +1,127 @@
+class Example {
+	public void example() {
+		for (int i = 0; i < 10; i++) {}
+		int a = 10;
+		while (a-- > 0) { System.out.println(a); }
+		do { a += 2; System.out.println(a); } while (a < 50);
+	}
+}
+
+class Example {
+	public String example(int a) {
+		if (a < 0) { throw new IllegalArgumentException(); }
+		if (a == 0) { return null; }
+		if (false) {}
+		if (a % 3 == 0) {
+			System.out.println("fizz");
+		}
+		if (a % 5 == 0) {
+			System.out.println("buzz");
+			return "";
+		}
+		return Integer.toString(a);
+	}
+}
+
+class Example {
+	Runnable emptyLambda = () -> {
+	};
+	Runnable emptyLambda2 = () -> {
+	};
+	Runnable tinyLambda = () -> {
+		doSomething();
+	};
+	Runnable smallLambda = () -> {
+		doFirstThing();
+		doSecondThing();
+	};
+}
+
+class Example {
+	static {
+	}
+
+	void foo() {
+		if (true) {
+		} else {
+		}
+		synchronized (this) {
+		}
+		try {
+		} finally {
+		}
+
+		labeled: {
+		}
+	}
+}
+
+public class Example {
+	private int something;
+
+	public int getSomething() { return something; }
+
+	public void setSomehing(int something) { this.something = something; }
+
+	public void doNoting() {}
+
+	public void doOneThing() {
+		System.out.println();
+	}
+
+	public void doMoreThings() {
+		something = 4;
+		doOneThing();
+		doOneThing();
+	}
+}
+
+public class EmptyClass {
+}
+
+public class TinyClass {
+	int a;
+}
+
+public class SmallClass {
+	int a;
+	String b;
+}
+
+public class AnonymousClasses {
+	EmptyClass emptyAnonymous = new EmptyClass() {
+	};
+	TinyClass tinyAnonymous = new TinyClass() {
+		String b;
+	};
+	Object o = new SmallClass() {
+		int a;
+
+		int getA() { return a; }
+	};
+}
+
+public enum EmptyEnum {
+}
+
+public enum TinyEnum {
+	A;
+}
+
+public enum SmallEnum {
+	VALUE(0);
+	SmallEnum(int val) {};
+}
+
+public enum EnumConstants {
+	EMPTY {},
+	TINY { int getVal() { return 2; } },
+	SMALL { int val = 3; int getVal() { return 3; } };
+	int getVal() { return 1; }
+}
+
+public @interface EmptyInterface {}
+
+public @interface TinyInterface { void run(); }
+
+public @interface SmallInteface { int toA(); String toB(); }
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/F_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/F_out.java
new file mode 100644
index 0000000..012f0e3
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/F_out.java
@@ -0,0 +1,142 @@
+class Example {
+	public void example() {
+		for (int i = 0; i < 10; i++) {}
+		int a = 10;
+		while (a-- > 0) { System.out.println(a); }
+		do {
+			a += 2;
+			System.out.println(a);
+		} while (a < 50);
+	}
+}
+
+class Example {
+	public String example(int a) {
+		if (a < 0) { throw new IllegalArgumentException(); }
+		if (a == 0) { return null; }
+		if (false) {}
+		if (a % 3 == 0) { System.out.println("fizz"); }
+		if (a % 5 == 0) { System.out.println("buzz"); return ""; }
+		return Integer.toString(a);
+	}
+}
+
+class Example {
+	Runnable emptyLambda = () -> {
+	};
+	Runnable emptyLambda2 = () -> {
+	};
+	Runnable tinyLambda = () -> {
+		doSomething();
+	};
+	Runnable smallLambda = () -> {
+		doFirstThing();
+		doSecondThing();
+	};
+}
+
+class Example {
+	static {
+	}
+
+	void foo() {
+		if (true) {
+		} else {
+		}
+		synchronized (this) {
+		}
+		try {
+		} finally {
+		}
+
+		labeled: {
+		}
+	}
+}
+
+public class Example {
+	private int something;
+
+	public int getSomething() {
+		return something;
+	}
+
+	public void setSomehing(int something) {
+		this.something = something;
+	}
+
+	public void doNoting() {
+	}
+
+	public void doOneThing() {
+		System.out.println();
+	}
+
+	public void doMoreThings() {
+		something = 4;
+		doOneThing();
+		doOneThing();
+	}
+}
+
+public class EmptyClass {}
+
+public class TinyClass { int a; }
+
+public class SmallClass { int a; String b; }
+
+public class AnonymousClasses {
+	EmptyClass emptyAnonymous = new EmptyClass() {};
+	TinyClass tinyAnonymous = new TinyClass() {
+		String b;
+	};
+	Object o = new SmallClass() {
+		int a;
+
+		int getA() {
+			return a;
+		}
+	};
+}
+
+public enum EmptyEnum {}
+
+public enum TinyEnum { A; }
+
+public enum SmallEnum {
+	VALUE(0);
+	SmallEnum(int val) {
+	};
+}
+
+public enum EnumConstants {
+	EMPTY {},
+	TINY {
+		int getVal() {
+			return 2;
+		}
+	},
+	SMALL {
+		int val = 3;
+
+		int getVal() {
+			return 3;
+		}
+	};
+	int getVal() {
+		return 1;
+	}
+}
+
+public @interface EmptyInterface {
+}
+
+public @interface TinyInterface {
+	void run();
+}
+
+public @interface SmallInteface {
+	int toA();
+
+	String toB();
+}
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/G_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/G_out.java
new file mode 100644
index 0000000..fc1e78c
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/G_out.java
@@ -0,0 +1,121 @@
+class Example {
+	public void example() {
+		for (int i = 0; i < 10; i++) {
+		}
+		int a = 10;
+		while (a-- > 0) {
+			System.out.println(a);
+		}
+		do {
+			a += 2;
+			System.out.println(a);
+		} while (a < 50);
+	}
+}
+
+class Example {
+	public String example(int a) {
+		if (a < 0) { throw new IllegalArgumentException(); }
+		if (a == 0) { return null; }
+		if (false) {}
+		if (a % 3 == 0) { System.out.println("fizz"); }
+		if (a % 5 == 0) {
+			System.out.println("buzz");
+			return "";
+		}
+		return Integer.toString(a);
+	}
+}
+
+class Example {
+	Runnable emptyLambda = () -> {};
+	Runnable emptyLambda2 = () -> {};
+	Runnable tinyLambda = () -> { doSomething(); };
+	Runnable smallLambda = () -> { doFirstThing(); doSecondThing(); };
+}
+
+class Example {
+	static {}
+
+	void foo() {
+		if (true) {} else {}
+		synchronized (this) {}
+		try {} finally {}
+
+		labeled: {}
+	}
+}
+
+public class Example {
+	private int something;
+
+	public int getSomething() { return something; }
+
+	public void setSomehing(int something) { this.something = something; }
+
+	public void doNoting() {}
+
+	public void doOneThing() { System.out.println(); }
+
+	public void doMoreThings() { something = 4; doOneThing(); doOneThing(); }
+}
+
+public class EmptyClass {
+}
+
+public class TinyClass {
+	int a;
+}
+
+public class SmallClass {
+	int a;
+	String b;
+}
+
+public class AnonymousClasses {
+	EmptyClass emptyAnonymous = new EmptyClass() {
+	};
+	TinyClass tinyAnonymous = new TinyClass() {
+		String b;
+	};
+	Object o = new SmallClass() {
+		int a;
+
+		int getA() { return a; }
+	};
+}
+
+public enum EmptyEnum {}
+
+public enum TinyEnum { A; }
+
+public enum SmallEnum {
+	VALUE(0);
+	SmallEnum(int val) {};
+}
+
+public enum EnumConstants {
+	EMPTY {
+	},
+	TINY {
+		int getVal() { return 2; }
+	},
+	SMALL {
+		int val = 3;
+
+		int getVal() { return 3; }
+	};
+	int getVal() { return 1; }
+}
+
+public @interface EmptyInterface {}
+
+public @interface TinyInterface {
+	void run();
+}
+
+public @interface SmallInteface {
+	int toA();
+
+	String toB();
+}
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/H_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/H_out.java
new file mode 100644
index 0000000..9eba7cd
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/H_out.java
@@ -0,0 +1,109 @@
+class Example {
+	public void example() {
+		for (int i = 0; i < 10; i++) {
+		}
+		int a = 10;
+		while (a-- > 0) { System.out.println(a); }
+		do {
+			a += 2;
+			System.out.println(a);
+		} while (a < 50);
+	}
+}
+
+class Example {
+	public String example(int a) {
+		if (a < 0) {
+			throw new IllegalArgumentException();
+		}
+		if (a == 0) { return null; }
+		if (false) {}
+		if (a % 3 == 0) {
+			System.out.println("fizz");
+		}
+		if (a % 5 == 0) { System.out.println("buzz"); return ""; }
+		return Integer.toString(a);
+	}
+}
+
+class Example {
+	Runnable	emptyLambda		= () -> {};
+	Runnable	emptyLambda2	= () -> {
+								};
+	Runnable	tinyLambda		= () -> { doSomething(); };
+	Runnable	smallLambda		= () -> { doFirstThing(); doSecondThing(); };
+}
+
+class Example {
+	static {
+	}
+
+	void foo() {
+		if (true) {
+		} else {
+		}
+		synchronized (this) {
+		}
+		try {
+		} finally {
+		}
+
+		labeled: {
+		}
+	}
+}
+
+public class Example {
+	private int something;
+
+	public int getSomething() { return something; }
+
+	public void setSomehing(int something) { this.something = something; }
+
+	public void doNoting() {}
+
+	public void doOneThing() {
+		System.out.println();
+	}
+
+	public void doMoreThings() { something = 4; doOneThing(); doOneThing(); }
+}
+
+public class EmptyClass {}
+
+public class TinyClass {
+	int a;
+}
+
+public class SmallClass { int a; String b; }
+
+public class AnonymousClasses {
+	EmptyClass	emptyAnonymous	= new EmptyClass() {
+								};
+	TinyClass	tinyAnonymous	= new TinyClass() { String b; };
+	Object		o				= new SmallClass() { int a; int getA() { return a; } };
+}
+
+public enum EmptyEnum {}
+
+public enum TinyEnum {
+	A;
+}
+
+public enum SmallEnum { VALUE(0); SmallEnum(int val) {}; }
+
+public enum EnumConstants {
+	EMPTY {
+	},
+	TINY { int getVal() { return 2; } },
+	SMALL { int val = 3; int getVal() { return 3; } };
+	int getVal() { return 1; }
+}
+
+public @interface EmptyInterface {}
+
+public @interface TinyInterface {
+	void run();
+}
+
+public @interface SmallInteface { int toA(); String toB(); }
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/I_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/I_out.java
new file mode 100644
index 0000000..82d5839
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/I_out.java
@@ -0,0 +1,125 @@
+class Example {
+	public void example() {
+		for (int i = 0; i < 10; i++) {}
+		int a = 10;
+		while (a-- > 0) { System.out.println(a); }
+		do {
+			a += 2;
+			System.out.println(a);
+		} while (a < 50);
+	}
+}
+
+class Example {
+	public String example(int a) {
+		if (a < 0) {
+			throw new IllegalArgumentException();
+		}
+		if (a == 0) { return null; }
+		if (false) {}
+		if (a % 3 == 0) {
+			System.out.println("fizz");
+		}
+		if (a % 5 == 0) {
+			System.out.println("buzz");
+			return "";
+		}
+		return Integer.toString(a);
+	}
+}
+
+class Example {
+	Runnable emptyLambda = () -> {};
+	Runnable emptyLambda2 = () -> {};
+	Runnable tinyLambda = () -> {
+	    doSomething();
+	};
+	Runnable smallLambda = () -> {
+	    doFirstThing();
+	    doSecondThing();
+	};
+}
+
+class Example {
+	static {}
+
+	void foo() {
+		if (true) {} else {}
+		synchronized (this) {}
+		try {} finally {}
+
+		labeled: {}
+	}
+}
+
+public class Example {
+	private int something;
+
+	public int getSomething() {
+		return something;
+	}
+
+	public void setSomehing(int something) {
+		this.something = something;
+	}
+
+	public void doNoting() {}
+
+	public void doOneThing() {
+		System.out.println();
+	}
+
+	public void doMoreThings() {
+		something = 4;
+		doOneThing();
+		doOneThing();
+	}
+}
+
+public class EmptyClass {}
+
+public class TinyClass { int a; }
+
+public class SmallClass { int a; String b; }
+
+public class AnonymousClasses {
+	EmptyClass emptyAnonymous = new EmptyClass() {};
+	TinyClass tinyAnonymous = new TinyClass() {
+		String b;
+	};
+	Object o = new SmallClass() {
+		int a;
+
+		int getA() { return a; }
+	};
+}
+
+public enum EmptyEnum {}
+
+public enum TinyEnum { A; }
+
+public enum SmallEnum {
+	VALUE(0);
+	SmallEnum(int val) {};
+}
+
+public enum EnumConstants {
+	EMPTY {},
+	TINY { int getVal() { return 2; } },
+	SMALL {
+		int val = 3;
+
+		int getVal() { return 3; }
+	};
+	int getVal() { return 1; }
+}
+
+public @interface EmptyInterface {}
+
+public @interface TinyInterface { void run(); }
+
+public @interface SmallInteface {
+	int toA();
+
+	String toB();
+}
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/J_in.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/J_in.java
new file mode 100644
index 0000000..41d96d0
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/J_in.java
@@ -0,0 +1,30 @@
+class Example {
+	
+	void method1() {
+		int a;
+	}
+	
+	void method2() {
+		
+		int a;
+		
+		
+	}
+	
+	void method3() {
+		int a; //
+	}
+	
+	void method4() {
+		int a; /* */
+	}
+	
+	void method5() {
+		/* */ int a;
+	}
+	
+	void method6() { int a; /* */ } /* */
+	
+	void method7() { /* */ int a; } /* */
+	
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/J_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/J_out.java
new file mode 100644
index 0000000..2a7ae61
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/J_out.java
@@ -0,0 +1,27 @@
+class Example {
+
+	void method1() { int a; }
+
+	void method2() {
+
+		int a;
+
+	}
+
+	void method3() {
+		int a; //
+	}
+
+	void method4() {
+		int a; /* */
+	}
+
+	void method5() {
+		/* */ int a;
+	}
+
+	void method6() { int a; /* */ } /* */
+
+	void method7() { /* */ int a; } /* */
+
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/in.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/in.java
new file mode 100644
index 0000000..bde96a4
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test205973/in.java
@@ -0,0 +1,93 @@
+class Example{
+	public void example() {
+		for (int i = 0; i < 10; i++) {
+		}
+		int a = 10;
+		while (a-- > 0) { System.out.println(a); }
+		do { a += 2;
+		System.out.println(a); } while(a < 50);
+	}
+}
+
+
+class Example {
+	public String example(int a) {
+		if (a < 0) { 
+			throw new IllegalArgumentException(); }
+		if (a == 0) { return null; }
+		if (false) {}
+		if (a % 3 == 0) {
+			System.out.println("fizz"); }
+		if (a % 5 == 0) { System.out.println("buzz"); return ""; }
+		return Integer.toString(a);
+	}
+}
+
+
+class Example {
+	Runnable emptyLambda = () -> {};
+	Runnable emptyLambda2 = () -> {
+	};
+	Runnable tinyLambda = () -> { doSomething(); };
+	Runnable smallLambda = () -> { doFirstThing(); doSecondThing(); };
+}
+
+
+class Example {
+	static {
+	}
+	
+	void foo() {
+		if (true) {} else {}
+		synchronized(this) {}
+		try {} finally {}
+		
+		labeled:{}
+	}
+}
+
+
+public class Example {
+	private int something;
+	public int getSomething() { return something; }
+	public void setSomehing(int something) { this.something = something; }
+	public void doNoting() {}
+	public void doOneThing() { System.out.println();
+	}
+	public void doMoreThings() { something = 4; doOneThing(); doOneThing(); }
+}
+
+
+public class EmptyClass{}
+public class TinyClass{ 
+	int a; }
+public class SmallClass{ int a; String b; }
+
+
+public class AnonymousClasses {
+	EmptyClass emptyAnonymous = new EmptyClass() {
+	};
+	TinyClass tinyAnonymous = new TinyClass() { String b; };
+	Object o = new SmallClass() { int a; int getA() { return a; } };
+}
+
+
+public enum EmptyEnum {}
+public enum TinyEnum{ A;
+}
+public enum SmallEnum{ VALUE(0); SmallEnum(int val) {}; }
+
+
+public enum EnumConstants {
+	EMPTY {
+	},
+	TINY { int getVal() { return 2; }},
+	SMALL { int val = 3; int getVal() { return 3; }};
+	int getVal() { return 1; }
+}
+
+
+public @interface EmptyInterface {}
+public @interface TinyInterface { 
+	void run(); }
+public @interface SmallInteface { int toA(); String toB(); }
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test496/A_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test496/A_out.java
index 7b6cead..19532de 100644
--- a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test496/A_out.java
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test496/A_out.java
@@ -1,7 +1,8 @@
 public class A {
 
     void doX() {
-        if (1 > 0) { return; //
+        if (1 > 0) {
+            return; //
         }
         return;
     }