update jdt.core & tests to I20120502-0800 aka 4.2 M7.
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 926394f..e5b5998 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
@@ -148,7 +148,7 @@
 //	JavaModelManager.VERBOSE = true;
 //	org.eclipse.jdt.internal.core.search.BasicSearchEngine.VERBOSE = true;
 //	TESTS_PREFIX = "testIgnoreIfBetterNonAccessibleRule";
-//	TESTS_NAMES = new String[] { "testIgnoreMethodBodies1", "testIgnoreMethodBodies2" };
+//	TESTS_NAMES = new String[] { "testBug374176" };
 //	TESTS_NUMBERS = new int[] { 118823 };
 //	TESTS_RANGE = new int[] { 16, -1 };
 }
@@ -5340,4 +5340,97 @@
 			deleteProject(project15);
 	}
 }
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=374176
+// verify that a reconcile does not result in errors for a CU whose package does not have
+// default null annotations
+public void testBug374176() throws CoreException, IOException, InterruptedException {
+	IJavaProject project15 = null;
+	try {
+		project15 = createJavaProject("TestAnnot", new String[] {"src"}, new String[] {"JCL15_LIB"}, "bin");
+		createFolder("/TestAnnot/src/p1");
+		String source = "package p1;\n" +
+				"public class Y {\n" +
+				"}\n;";
+		createFile(
+				"/TestAnnot/src/p1/Y.java",
+				source
+			);
+		createFolder("/TestAnnot/src/p2");
+		createFile(
+				"/TestAnnot/src/p2/Y2.java",
+				"package p2;\n" +
+				"public class Y2{\n" +
+				"}\n"
+			);
+		project15.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5);
+		project15.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
+		project15.setOption(JavaCore.COMPILER_PB_NULL_REFERENCE, JavaCore.ERROR);
+		project15.setOption(JavaCore.COMPILER_PB_POTENTIAL_NULL_REFERENCE, JavaCore.ERROR);
+		project15.setOption(JavaCore.COMPILER_PB_REDUNDANT_NULL_CHECK, JavaCore.ERROR);
+		project15.setOption(JavaCore.COMPILER_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS, JavaCore.ENABLED);
+		project15.setOption(JavaCore.COMPILER_ANNOTATION_NULL_ANALYSIS, JavaCore.ENABLED);
+		project15.setOption(JavaCore.COMPILER_PB_MISSING_NONNULL_BY_DEFAULT_ANNOTATION, JavaCore.ERROR);
+
+		this.workingCopies = new ICompilationUnit[2];
+		char[] sourceChars = source.toCharArray();
+		this.problemRequestor.initialize(sourceChars);
+		this.workingCopies[0] = getCompilationUnit("/TestAnnot/src/p1/Y.java").getWorkingCopy(this.wcOwner, null);
+		this.workingCopies[0].makeConsistent(null);
+		this.workingCopies[0].reconcile(ICompilationUnit.NO_AST, false, null, null);
+
+		assertNoProblem(sourceChars, this.workingCopies[0]);
+	} finally {
+		if (project15 != null)
+			deleteProject(project15);
+	}
+}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=374176
+// verify that a reconcile DOES result in errors for package-info whose package does not have
+// default null annotations
+public void testBug374176b() throws CoreException, IOException, InterruptedException {
+	IJavaProject project15 = null;
+	try {
+		project15 = createJavaProject("TestAnnot", new String[] {"src"}, new String[] {"JCL15_LIB"}, "bin");
+		createFolder("/TestAnnot/src/p1");
+		String source = "package p1;\n";
+		createFile(
+				"/TestAnnot/src/p1/package-info.java",
+				source
+			);
+		project15.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5);
+		project15.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
+		project15.setOption(JavaCore.COMPILER_PB_NULL_REFERENCE, JavaCore.ERROR);
+		project15.setOption(JavaCore.COMPILER_PB_POTENTIAL_NULL_REFERENCE, JavaCore.ERROR);
+		project15.setOption(JavaCore.COMPILER_PB_REDUNDANT_NULL_CHECK, JavaCore.ERROR);
+		project15.setOption(JavaCore.COMPILER_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS, JavaCore.ENABLED);
+		project15.setOption(JavaCore.COMPILER_ANNOTATION_NULL_ANALYSIS, JavaCore.ENABLED);
+		project15.setOption(JavaCore.COMPILER_PB_MISSING_NONNULL_BY_DEFAULT_ANNOTATION, JavaCore.ERROR);
+
+		this.workingCopies = new ICompilationUnit[1];
+		char[] sourceChars = source.toCharArray();
+		this.problemRequestor.initialize(sourceChars);
+		this.workingCopies[0] = getCompilationUnit("/TestAnnot/src/p1/package-info.java").getWorkingCopy(this.wcOwner, null);
+		this.workingCopies[0].makeConsistent(null);
+		this.workingCopies[0].reconcile(ICompilationUnit.NO_AST, false, null, null);
+
+		assertProblems("Unexpected problems",
+			"----------\n" + 
+			"1. ERROR in /TestAnnot/src/p1/package-info.java (at line 1)\n" + 
+			"	package p1;\n" + 
+			"	        ^^\n" + 
+			"A default nullness annotation has not been specified for the package p1\n" + 
+			"----------\n");
+		assertProblems("Unexpected problems",
+			"----------\n" + 
+			"1. ERROR in /TestAnnot/src/p1/package-info.java (at line 1)\n" + 
+			"	package p1;\n" + 
+			"	        ^^\n" + 
+			"A default nullness annotation has not been specified for the package p1\n" + 
+			"----------\n",
+			this.problemRequestor);
+	} finally {
+		if (project15 != null)
+			deleteProject(project15);
+	}
+}
 }
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ImportRewriteTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ImportRewriteTest.java
index f96f005..7d01596 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ImportRewriteTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ImportRewriteTest.java
@@ -1493,6 +1493,690 @@
 		buf.append("}\n");
 		assertEqualString(cu.getSource(), buf.toString());
 	}
+	
+	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=376930
+    public void testBug376930() throws Exception {
+        IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
+        StringBuffer buf = new StringBuffer();
+        // 2 imports are in 1 group but third is separated by a comment
+        buf.append(
+                "package pack1;\n" + 
+                "\n" + 
+                "import java.util.*; // test\n" +
+                "import java.util.Map.Entry;\n" +
+                "//comment 2\n" +
+                "import java.util.Map.SomethingElse;\n" +
+                "// commen 3\n" + 
+                "\n" + 
+                "public class C {\n" + 
+                "    public static void main(String[] args) {\n" + 
+                "        HashMap h;\n" + 
+                "\n" + 
+                "        Map.Entry e= null;\n" + 
+                "        Entry e2= null;\n" + 
+                "\n" + 
+                "        PrintWriter pw;\n" + 
+                "        System.out.println(\"hello\");\n" + 
+                "    }\n" + 
+                "}");
+        ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
+
+        String[] order = new String[] { "java", "java.util", "com", "pack" };
+
+        ImportRewrite imports= newImportsRewrite(cu, order, 1, 1, true);
+        imports.setUseContextToFilterImplicitImports(true);
+        imports.addImport("java.io.PrintWriter");
+
+        apply(imports);
+
+        buf = new StringBuffer();
+        buf.append(
+                "package pack1;\n" + 
+                "\n" + 
+                "import java.io.*;\n" + 
+                "\n" + 
+                "import java.util.*; // test\n" + 
+                "import java.util.Map.Entry;\n" + 
+                "//comment 2\n" +
+                "import java.util.Map.SomethingElse;\n" +
+                "// commen 3\n" +
+                "\n" +  
+                "public class C {\n" + 
+                "    public static void main(String[] args) {\n" + 
+                "        HashMap h;\n" + 
+                "\n" + 
+                "        Map.Entry e= null;\n" + 
+                "        Entry e2= null;\n" + 
+                "\n" + 
+                "        PrintWriter pw;\n" + 
+                "        System.out.println(\"hello\");\n" + 
+                "    }\n" + 
+                "}");
+        assertEqualString(cu.getSource(), buf.toString());
+    }
+    
+    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=376930
+    public void testBug376930_2() throws Exception {
+        IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
+        StringBuffer buf = new StringBuffer();
+        // all imports are in same group
+        buf.append(
+                "package pack1;\n" + 
+                "\n" +
+                "// comment 1\n" + 
+                "import java.util.*; // test\n" +
+                "import java.util.Map.Entry; // test2\n" +
+                "import java.util.Map.SomethingElse;\n" +
+                "// commen 3\n" + 
+                "\n" + 
+                "public class C {\n" + 
+                "    public static void main(String[] args) {\n" + 
+                "        HashMap h;\n" + 
+                "\n" + 
+                "        Map.Entry e= null;\n" + 
+                "        Entry e2= null;\n" + 
+                "\n" + 
+                "        PrintWriter pw;\n" + 
+                "        System.out.println(\"hello\");\n" + 
+                "    }\n" + 
+                "}");
+        ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
+
+        String[] order = new String[] { "java", "java.util", "com", "pack" };
+
+        ImportRewrite imports= newImportsRewrite(cu, order, 1, 1, true);
+        imports.setUseContextToFilterImplicitImports(true);
+        imports.addImport("java.io.PrintWriter");
+
+        apply(imports);
+
+        buf = new StringBuffer();
+        buf.append(
+                "package pack1;\n" + 
+                "\n" + 
+                "// comment 1\n" + 
+                "import java.io.*;\n" + 
+                "\n" + 
+                "import java.util.*; // test\n" +
+                "import java.util.Map.Entry; // test2\n" +
+                "import java.util.Map.SomethingElse;\n" +
+                "// commen 3\n" + 
+                "\n" + 
+                "public class C {\n" + 
+                "    public static void main(String[] args) {\n" + 
+                "        HashMap h;\n" + 
+                "\n" + 
+                "        Map.Entry e= null;\n" + 
+                "        Entry e2= null;\n" + 
+                "\n" + 
+                "        PrintWriter pw;\n" + 
+                "        System.out.println(\"hello\");\n" + 
+                "    }\n" + 
+                "}");
+        assertEqualString(cu.getSource(), buf.toString());
+    }
+    
+    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=376930
+    public void testBug376930_3() throws Exception {
+        IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
+        StringBuffer buf = new StringBuffer();
+        // all imports are in same group
+        // leading and trailing comments
+        buf.append(
+                "package pack1;\n" + 
+                "\n" +
+                "// comment 1\n" + 
+                "/* lead 1*/ import java.util.*; // test1\n" +
+                "/* lead 2*/import java.util.Map.Entry; // test2\n" +
+                "/* lead 3*/ import java.util.Map.SomethingElse; // test3\n" +
+                "// commen 3\n" + 
+                "\n" + 
+                "public class C {\n" + 
+                "    public static void main(String[] args) {\n" + 
+                "        HashMap h;\n" + 
+                "\n" + 
+                "        Map.Entry e= null;\n" + 
+                "        Entry e2= null;\n" + 
+                "\n" + 
+                "        PrintWriter pw;\n" + 
+                "        System.out.println(\"hello\");\n" + 
+                "    }\n" + 
+                "}");
+        ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
+
+        String[] order = new String[] { "java", "java.util", "com", "pack" };
+
+        ImportRewrite imports= newImportsRewrite(cu, order, 1, 1, true);
+        imports.setUseContextToFilterImplicitImports(true);
+        imports.addImport("java.io.PrintWriter");
+
+        apply(imports);
+
+        buf = new StringBuffer();
+        buf.append(
+                "package pack1;\n" + 
+                "\n" + 
+                "// comment 1\n" + 
+                "/* lead 1*/ import java.io.*;\n" + 
+                "\n" + 
+                "import java.util.*; // test1\n" +
+                "/* lead 2*/import java.util.Map.Entry; // test2\n" +
+                "/* lead 3*/ import java.util.Map.SomethingElse; // test3\n" +
+                "// commen 3\n" +  
+                "\n" + 
+                "public class C {\n" + 
+                "    public static void main(String[] args) {\n" + 
+                "        HashMap h;\n" + 
+                "\n" + 
+                "        Map.Entry e= null;\n" + 
+                "        Entry e2= null;\n" + 
+                "\n" + 
+                "        PrintWriter pw;\n" + 
+                "        System.out.println(\"hello\");\n" + 
+                "    }\n" + 
+                "}");
+        assertEqualString(cu.getSource(), buf.toString());
+    }
+    
+    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=376930
+    // remove imports, preserve all comments
+    public void testBug376930_3a() throws Exception {
+        IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
+        StringBuffer buf = new StringBuffer();
+        buf.append(
+                "package pack1;\n" + 
+                "\n" +
+                "// comment 1\n" + 
+                "/* lead 1*/ import java.util.*; // test1\n" +
+                "/* lead 2*/import java.util.Map.Entry; // test2\n" +
+                "/* lead 3*/ import java.util.Map.SomethingElse; // test3\n" +
+                "// commen 3\n" + 
+                "\n" + 
+                "public class C {\n" + 
+                "    public static void main(String[] args) {\n" + 
+                "        HashMap h;\n" + 
+                "\n" + 
+                "        Map.Entry e= null;\n" + 
+                "        Entry e2= null;\n" + 
+                "\n" + 
+                "        PrintWriter pw;\n" + 
+                "        System.out.println(\"hello\");\n" + 
+                "    }\n" + 
+                "}");
+        ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
+
+        String[] order = new String[] { "java", "java.util", "com", "pack" };
+
+        ImportRewrite imports= newImportsRewrite(cu, order, 1, 1, false);
+        imports.setUseContextToFilterImplicitImports(true);
+        imports.addImport("java.io.PrintWriter");
+
+        apply(imports);
+
+        buf = new StringBuffer();
+        buf.append(
+                "package pack1;\n" + 
+                "\n" + 
+                "// comment 1\n" +
+				"/* lead 1*/ " +
+				"import java.io.*;\n" + 
+				"// test1\n" +
+				"/* lead 2*/\n" +
+				"// test2\n" +
+				"/* lead 3*/ \n" +
+				"// test3\n" +
+				"// commen 3\n" +
+                "\n" + 
+                "public class C {\n" + 
+                "    public static void main(String[] args) {\n" + 
+                "        HashMap h;\n" + 
+                "\n" + 
+                "        Map.Entry e= null;\n" + 
+                "        Entry e2= null;\n" + 
+                "\n" + 
+                "        PrintWriter pw;\n" + 
+                "        System.out.println(\"hello\");\n" + 
+                "    }\n" + 
+                "}");
+        assertEqualString(cu.getSource(), buf.toString());
+    }
+    
+    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=376930
+    public void testBug376930_4() throws Exception {
+        IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
+        StringBuffer buf = new StringBuffer();
+        // all imports are in same group
+        // leading and trailing comments
+        // two on demand imports in the group
+        buf.append(
+                "package pack1;\n" + 
+                "\n" +
+                "// comment 1\n" + 
+                "/* lead 1*/ import java.util.*; // test1\n" +
+                "/* lead 2*/import java.util.Map.*; // test2\n" +
+                "/* lead 3*/ import java.util.Map.SomethingElse; // test3\n" +
+                "// commen 3\n" + 
+                "\n" + 
+                "public class C {\n" + 
+                "    public static void main(String[] args) {\n" + 
+                "        HashMap h;\n" + 
+                "\n" + 
+                "        Map.Entry e= null;\n" + 
+                "        Entry e2= null;\n" + 
+                "\n" + 
+                "        PrintWriter pw;\n" + 
+                "        System.out.println(\"hello\");\n" + 
+                "    }\n" + 
+                "}");
+        ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
+
+        String[] order = new String[] { "java", "java.util", "com", "pack" };
+
+        ImportRewrite imports= newImportsRewrite(cu, order, 1, 1, true);
+        imports.setUseContextToFilterImplicitImports(true);
+        imports.addImport("java.io.PrintWriter");
+
+        apply(imports);
+
+        buf = new StringBuffer();
+        buf.append(
+                "package pack1;\n" + 
+                "\n" + 
+                "// comment 1\n" + 
+                "/* lead 1*/ import java.io.*;\n" + 
+                "\n" +  
+                "import java.util.*; // test1\n" +
+                "/* lead 2*/import java.util.Map.*; // test2\n" +
+                "/* lead 3*/ import java.util.Map.SomethingElse; // test3\n" +
+                "// commen 3\n" + 
+                "\n" + 
+                "public class C {\n" + 
+                "    public static void main(String[] args) {\n" + 
+                "        HashMap h;\n" + 
+                "\n" + 
+                "        Map.Entry e= null;\n" + 
+                "        Entry e2= null;\n" + 
+                "\n" + 
+                "        PrintWriter pw;\n" + 
+                "        System.out.println(\"hello\");\n" + 
+                "    }\n" + 
+                "}");
+        assertEqualString(cu.getSource(), buf.toString());
+    }
+    
+    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=376930
+    // remove imports, preserve all comments
+    public void testBug376930_4a() throws Exception {
+        IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
+        StringBuffer buf = new StringBuffer();
+        buf.append(
+                "package pack1;\n" + 
+                "\n" +
+                "// comment 1\n" + 
+                "/* lead 1*/ import java.util.HashMap; // test1\n" +
+                "/* lead 2*/import java.util.Map.*; // test2\n" +
+                "/* lead 3*/ import java.util.Map.SomethingElse; // test3\n" +
+                "// commen 3\n" + 
+                "\n" + 
+                "public class C {\n" + 
+                "    public static void main(String[] args) {\n" + 
+                "        HashMap h;\n" + 
+                "\n" + 
+                "        Map.Entry e= null;\n" + 
+                "        Entry e2= null;\n" + 
+                "\n" + 
+                "        PrintWriter pw;\n" + 
+                "        System.out.println(\"hello\");\n" + 
+                "    }\n" + 
+                "}");
+        ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
+
+        String[] order = new String[] { "java", "java.util", "com", "pack" };
+
+        ImportRewrite imports= newImportsRewrite(cu, order, 1, 1, false);
+        imports.setUseContextToFilterImplicitImports(true);
+        imports.addImport("java.io.PrintWriter");
+
+        apply(imports);
+
+        buf = new StringBuffer();
+        buf.append(
+                "package pack1;\n" + 
+                "\n" +
+                "// comment 1\n" +
+				"/* lead 1*/ " +
+				"import java.io.*;\n" + 
+				"// test1\n" +
+				"/* lead 2*/\n" +
+				"// test2\n" +
+				"/* lead 3*/ \n" +
+				"// test3\n" +
+				"// commen 3\n" +
+                "\n" + 
+                "public class C {\n" + 
+                "    public static void main(String[] args) {\n" + 
+                "        HashMap h;\n" + 
+                "\n" + 
+                "        Map.Entry e= null;\n" + 
+                "        Entry e2= null;\n" + 
+                "\n" + 
+                "        PrintWriter pw;\n" + 
+                "        System.out.println(\"hello\");\n" + 
+                "    }\n" + 
+                "}");
+        assertEqualString(cu.getSource(), buf.toString());
+    }
+    
+    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=376930
+    public void testBug376930_5() throws Exception {
+        IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
+        StringBuffer buf = new StringBuffer();
+        // all imports of same group are scattered around
+        // leading and trailing comments
+        // adding an on-demand import belonging to a group
+        buf.append(
+                "package pack1;\n" + 
+                "\n" +
+                "// comment 1\n" + 
+                "/* lead 1*/ import java.util.*; // test1\n" +
+                "/* lead 2*/import java.io.PrintWriter.*; // test2\n" +
+                "/* lead 3*/ import java.util.Map.SomethingElse; // test3\n" +
+                "// commen 3\n" + 
+                "\n" + 
+                "public class C {\n" + 
+                "    public static void main(String[] args) {\n" + 
+                "        HashMap h;\n" + 
+                "\n" + 
+                "        Map.Entry e= null;\n" + 
+                "        Entry e2= null;\n" + 
+                "\n" + 
+                "        PrintWriter pw;\n" + 
+                "        System.out.println(\"hello\");\n" + 
+                "    }\n" + 
+                "}");
+        ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
+
+        String[] order = new String[] { "java", "java.util", "com", "pack" };
+
+        ImportRewrite imports= newImportsRewrite(cu, order, 1, 1, true);
+        imports.setUseContextToFilterImplicitImports(true);
+        imports.addImport("java.util.Map.*");
+
+        apply(imports);
+
+        buf = new StringBuffer();
+        buf.append(
+                "package pack1;\n" + 
+                "\n" + 
+                "// comment 1\n" + 
+                "/* lead 1*/ import java.util.*; // test1\n" +
+                "import java.util.Map.*;\n" +
+                "\n" +
+                "/* lead 2*/import java.io.PrintWriter.*; // test2\n" +
+                "/* lead 3*/ import java.util.Map.SomethingElse; // test3\n" +
+                "// commen 3\n" + 
+                "\n" + 
+                "public class C {\n" + 
+                "    public static void main(String[] args) {\n" + 
+                "        HashMap h;\n" + 
+                "\n" + 
+                "        Map.Entry e= null;\n" + 
+                "        Entry e2= null;\n" + 
+                "\n" + 
+                "        PrintWriter pw;\n" + 
+                "        System.out.println(\"hello\");\n" + 
+                "    }\n" + 
+                "}");
+        assertEqualString(cu.getSource(), buf.toString());
+    }
+    
+    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=376930
+    public void testBug376930_5a() throws Exception {
+        IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
+        StringBuffer buf = new StringBuffer();
+        // all imports are in same group
+        // leading and trailing comments
+        // adding an on-demand import belonging to a group
+        buf.append(
+                "package pack1;\n" + 
+                "\n" +
+                "// comment 1\n" +
+                "/* lead 2*/import java.io.PrintWriter.*; // test2\n" +
+                "/* lead 1*/ import java.util.*; // test1\n" +
+                "/* lead 3*/ import java.util.Map.SomethingElse; // test3\n" +
+                "// commen 3\n" + 
+                "\n" + 
+                "public class C {\n" + 
+                "    public static void main(String[] args) {\n" + 
+                "        HashMap h;\n" + 
+                "\n" + 
+                "        Map.Entry e= null;\n" + 
+                "        Entry e2= null;\n" + 
+                "\n" + 
+                "        PrintWriter pw;\n" + 
+                "        System.out.println(\"hello\");\n" + 
+                "    }\n" + 
+                "}");
+        ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
+
+        String[] order = new String[] { "java", "java.util", "com", "pack" };
+
+        ImportRewrite imports= newImportsRewrite(cu, order, 1, 1, true);
+        imports.setUseContextToFilterImplicitImports(true);
+        imports.addImport("java.util.Map.*");
+
+        apply(imports);
+
+        buf = new StringBuffer();
+        buf.append(
+                "package pack1;\n" + 
+                "\n" + 
+                "// comment 1\n" + 
+                "/* lead 2*/import java.io.PrintWriter.*; // test2\n" +
+                "/* lead 1*/ import java.util.*; // test1\n" +
+                "import java.util.Map.*;\n" +
+                "/* lead 3*/ import java.util.Map.SomethingElse; // test3\n" +
+                "// commen 3\n" + 
+                "\n" + 
+                "public class C {\n" + 
+                "    public static void main(String[] args) {\n" + 
+                "        HashMap h;\n" + 
+                "\n" + 
+                "        Map.Entry e= null;\n" + 
+                "        Entry e2= null;\n" + 
+                "\n" + 
+                "        PrintWriter pw;\n" + 
+                "        System.out.println(\"hello\");\n" + 
+                "    }\n" + 
+                "}");
+        assertEqualString(cu.getSource(), buf.toString());
+    }
+    
+    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=376930
+    // added import should get folded into existing *, without touching comments
+    public void testBug376930_5b() throws Exception {
+        IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
+        StringBuffer buf = new StringBuffer();
+        buf.append(
+                "package pack1;\n" + 
+                "\n" +
+                "// comment 1\n" +
+                "/* lead 2*/import java.io.PrintWriter.*; // test2\n" +
+                "/* lead 1*/ import java.util.*; // test1\n" +
+                "/* lead 3*/ import java.util.Map.SomethingElse; // test3\n" +
+                "// commen 3\n" + 
+                "\n" + 
+                "public class C {\n" + 
+                "    public static void main(String[] args) {\n" + 
+                "        HashMap h;\n" + 
+                "\n" + 
+                "        Map.Entry e= null;\n" + 
+                "        Entry e2= null;\n" + 
+                "\n" + 
+                "        PrintWriter pw;\n" + 
+                "        System.out.println(\"hello\");\n" + 
+                "    }\n" + 
+                "}");
+        ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
+
+        String[] order = new String[] { "java", "java.util", "com", "pack" };
+
+        ImportRewrite imports= newImportsRewrite(cu, order, 1, 1, false);
+        imports.setUseContextToFilterImplicitImports(true);
+        imports.addImport("java.util.Map");
+
+        apply(imports);
+
+        buf = new StringBuffer();
+        buf.append(
+                "package pack1;\n" + 
+                "\n" +
+                "// comment 1\n" +
+				"/* lead 2*/" +
+				"import java.util.*;\n" + 
+				"// test2\n" +
+				"/* lead 1*/ \n" +
+				"// test1\n" +
+				"/* lead 3*/ \n" +
+				"// test3\n" +
+				"// commen 3\n" +
+                "\n" + 
+                "public class C {\n" + 
+                "    public static void main(String[] args) {\n" + 
+                "        HashMap h;\n" + 
+                "\n" + 
+                "        Map.Entry e= null;\n" + 
+                "        Entry e2= null;\n" + 
+                "\n" + 
+                "        PrintWriter pw;\n" + 
+                "        System.out.println(\"hello\");\n" + 
+                "    }\n" + 
+                "}");
+        assertEqualString(cu.getSource(), buf.toString());
+    }
+    
+    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=376930
+    // remove imports, preserve all comments
+    public void testBug376930_5c() throws Exception {
+        IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
+        StringBuffer buf = new StringBuffer();
+        buf.append(
+                "package pack1;\n" + 
+                "\n" +
+                "// comment 1\n" + 
+                "/* lead 1*/ import java.util.*; // test1\n" +
+                "/* lead 2*/import java.io.PrintWriter.*; // test2\n" +
+                "/* lead 3*/ import java.util.Map.SomethingElse; // test3\n" +
+                "// commen 3\n" + 
+                "\n" + 
+                "public class C {\n" + 
+                "    public static void main(String[] args) {\n" + 
+                "        HashMap h;\n" + 
+                "\n" + 
+                "        Map.Entry e= null;\n" + 
+                "        Entry e2= null;\n" + 
+                "\n" + 
+                "        PrintWriter pw;\n" + 
+                "        System.out.println(\"hello\");\n" + 
+                "    }\n" + 
+                "}");
+        ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
+
+        String[] order = new String[] { "java", "java.util", "com", "pack" };
+
+        ImportRewrite imports= newImportsRewrite(cu, order, 1, 1, false);
+        imports.setUseContextToFilterImplicitImports(true);
+        imports.addImport("java.util.Map.*");
+
+        apply(imports);
+
+        buf = new StringBuffer();
+        buf.append(
+                "package pack1;\n" + 
+                "\n" + 
+                "// comment 1\n" +
+				"/* lead 1*/ " +
+				"import java.util.Map.*;\n" + 
+				"// test1\n" +
+				"/* lead 2*/\n" +
+				"// test2\n" +
+				"/* lead 3*/ \n" +
+				"// test3\n" +
+				"// commen 3\n" +
+                "\n" + 
+                "public class C {\n" + 
+                "    public static void main(String[] args) {\n" + 
+                "        HashMap h;\n" + 
+                "\n" + 
+                "        Map.Entry e= null;\n" + 
+                "        Entry e2= null;\n" + 
+                "\n" + 
+                "        PrintWriter pw;\n" + 
+                "        System.out.println(\"hello\");\n" + 
+                "    }\n" + 
+                "}");
+        assertEqualString(cu.getSource(), buf.toString());
+    }
+    
+    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=376930
+    // added import should get folded along with existing import into *, without deleting comments
+    public void testBug376930_5d() throws Exception {
+        IPackageFragment pack1 = this.sourceFolder.createPackageFragment("pack1", false, null);
+        StringBuffer buf = new StringBuffer();
+        buf.append(
+                "package pack1;\n" + 
+                "\n" +
+                "// comment 1\n" +
+                "/* lead 2*/import java.io.PrintWriter.*; // test2\n" +
+                "/* lead 1*/ import java.util.Map; // test1\n" +
+                "// commen 3\n" + 
+                "\n" + 
+                "public class C {\n" + 
+                "    public static void main(String[] args) {\n" + 
+                "        HashMap h;\n" + 
+                "\n" + 
+                "        Map.Entry e= null;\n" + 
+                "        Entry e2= null;\n" + 
+                "\n" + 
+                "        PrintWriter pw;\n" + 
+                "        System.out.println(\"hello\");\n" + 
+                "    }\n" + 
+                "}");
+        ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
+
+        String[] order = new String[] { "java", "java.util", "com", "pack" };
+
+        ImportRewrite imports= newImportsRewrite(cu, order, 2, 2, true);
+        imports.setUseContextToFilterImplicitImports(true);
+        imports.addImport("java.util.HashMap");
+
+        apply(imports);
+
+        buf = new StringBuffer();
+        buf.append(
+                "package pack1;\n" + 
+                "\n" +
+                "// comment 1\n" +
+                "/* lead 2*/import java.io.PrintWriter.*; // test2\n" +
+                "\n" +
+                "/* lead 1*/ \n" +
+                " // test1\n" +
+                "// commen 3\n" +
+                "import java.util.*;\n" + 
+                "\n" + 
+                "public class C {\n" + 
+                "    public static void main(String[] args) {\n" + 
+                "        HashMap h;\n" + 
+                "\n" + 
+                "        Map.Entry e= null;\n" + 
+                "        Entry e2= null;\n" + 
+                "\n" + 
+                "        PrintWriter pw;\n" + 
+                "        System.out.println(\"hello\");\n" + 
+                "    }\n" + 
+                "}");
+        assertEqualString(cu.getSource(), buf.toString());
+    }
 
 	private void assertAddedAndRemoved(ImportRewrite imports, String[] expectedAdded, String[] expectedRemoved, String[] expectedAddedStatic, String[] expectedRemovedStatic) {
 		assertEqualStringsIgnoreOrder(imports.getAddedImports(), expectedAdded);
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties
index 2333687..ae8f14f 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties
@@ -21,7 +21,7 @@
 #Format: compiler.name = word1 word2 word3
 compiler.name = Eclipse Compiler for Java(TM)
 #Format: compiler.version = 0.XXX[, other words (don't forget the comma if adding other words)]
-compiler.version = 0.C49, 3.8.0 M7
+compiler.version = 0.C50, 3.8.0 M7
 compiler.copyright = Copyright IBM Corp 2000, 2012. All rights reserved.
 
 ###{ObjectTeams:
@@ -211,7 +211,7 @@
 \                                      reported as errors\n\
 \ \n\
 \ Setting warning or error options using properties file:\n\
-\    -properties: <file>   set warnings/errors option based on the properties\n\
+\    -properties <file>   set warnings/errors option based on the properties\n\
 \                          file contents. This option can be used with -nowarn,\n\
 \                          -err:.. or -warn:.. options, but the last one on the\n\
 \                          command line sets the options to be used.\n\
diff --git a/org.eclipse.jdt.core/buildnotes_jdt-core.html b/org.eclipse.jdt.core/buildnotes_jdt-core.html
index 2b1cab1..3250c39 100644
--- a/org.eclipse.jdt.core/buildnotes_jdt-core.html
+++ b/org.eclipse.jdt.core/buildnotes_jdt-core.html
@@ -42,17 +42,30 @@
 	</td>
   </tr>
 </table>
+<a name="v_C50"></a>
+<hr><h1>
+Eclipse Platform Build Notes<br>
+Java development tools core</h1>
+Eclipse SDK 3.8.0 - April 30, 2012 - 3.8.0 M7
+<br>
+<h2>What's new in this drop</h2>
+
+<h3>Problem Reports Fixed</h3>
+<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=376930">376930</a>
+FUP of bug 24804: Organize imports does not work when folding imports into on-demand import
+
 <a name="v_C49"></a>
 <hr><h1>
 Eclipse Platform Build Notes<br>
 Java development tools core</h1>
-Eclipse SDK 3.8.0 - %date% - 3.8.0 M7
-<br>Project org.eclipse.jdt.core v_C49
-(<a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jdt.core/?only_with_tag=v_C49">cvs</a>).
+Eclipse SDK 3.8.0 - April 30, 2012
+<br>
 <h2>What's new in this drop</h2>
 
 <h3>Problem Reports Fixed</h3>
-<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=371832">371832</a>
+<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=374176">374176</a>
+Sticky default nullness diagnostics.
+<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=371832">371832</a>
 The preference &quot;Suppress optional errors with '@SuppressWarnings'&quot; ends up silencing warnings it shouldn't
 
 <a name="v_C48"></a>
@@ -60,8 +73,7 @@
 Eclipse Platform Build Notes<br>
 Java development tools core</h1>
 Eclipse SDK 3.8.0 - April 27, 2012
-<br>Project org.eclipse.jdt.core v_C48
-(<a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jdt.core/?only_with_tag=v_C48">cvs</a>).
+<br>
 <h2>What's new in this drop</h2>
 
 <h3>Problem Reports Fixed</h3>
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/CompilationResult.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/CompilationResult.java
index 9f632a6..1904303 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/CompilationResult.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/CompilationResult.java
@@ -65,6 +65,7 @@
 import org.eclipse.jdt.internal.compiler.impl.ReferenceContext;
 import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
 import org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
+import org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
 import org.eclipse.jdt.internal.compiler.parser.RecoveryScannerData;
 import org.eclipse.jdt.internal.compiler.problem.DefaultProblem;
 import org.eclipse.jdt.internal.compiler.util.Util;
@@ -347,6 +348,45 @@
 // SH}
 	return this.problems;
 }
+/**
+ * Same as getProblems() but don't answer problems that actually concern the enclosing package.
+ */
+public CategorizedProblem[] getCUProblems() {
+	// Re-adjust the size of the problems if necessary and filter package problems
+	if (this.problems != null) {
+		CategorizedProblem[] filteredProblems = new CategorizedProblem[this.problemCount];
+		int keep = 0;
+		for (int i=0; i< this.problemCount; i++) {
+			CategorizedProblem problem = this.problems[i];
+			if (problem.getID() != IProblem.MissingNonNullByDefaultAnnotationOnPackage) {
+				filteredProblems[keep++] = problem;
+			} else if (this.compilationUnit != null) {
+				if (CharOperation.equals(this.compilationUnit.getMainTypeName(), TypeConstants.PACKAGE_INFO_NAME)) {
+					filteredProblems[keep++] = problem;
+				}
+			}
+		}
+		if (keep < this.problemCount) {
+			System.arraycopy(filteredProblems, 0, filteredProblems = new CategorizedProblem[keep], 0, keep);
+			this.problemCount = keep;
+		}
+		this.problems = filteredProblems;
+		if (this.maxProblemPerUnit > 0 && this.problemCount > this.maxProblemPerUnit){
+			quickPrioritize(this.problems, 0, this.problemCount - 1);
+			this.problemCount = this.maxProblemPerUnit;
+			System.arraycopy(this.problems, 0, (this.problems = new CategorizedProblem[this.problemCount]), 0, this.problemCount);
+		}
+
+		// Stable sort problems per source positions.
+		Arrays.sort(this.problems, 0, this.problems.length, CompilationResult.PROBLEM_COMPARATOR);
+		//quickSort(problems, 0, problems.length-1);
+	}
+//{ObjectTeams: safer:
+	else
+		return new CategorizedProblem[0];
+// SH}
+	return this.problems;
+}
 
 /**
  * Answer the tasks (TO-DO, ...) encountered during compilation.
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer.java
index bbb1d97..e9ef87d 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -238,8 +238,8 @@
 					return testedName;
 				}
 			}
-			} while (index >= 0); 
-	return name;
+		} while (index >= 0); 
+		return name;
 	}
 
 	private static String getFullName(ImportDeclaration decl) {
@@ -276,28 +276,39 @@
 			int nextLength= next.getLength();
 			int nextOffsetLine= root.getLineNumber(nextOffset);
 
-			int extendedStart = root.getExtendedStartPosition(next);
-			int extendedLength = root.getExtendedLength(next);
+			int extendedStart = root.getExtendedStartPosition(curr);
+			if (extendedStart < this.replaceRange.getOffset()) {
+				// don't touch the first comments before the start of import declarations
+				extendedStart = currOffset;
+			}
+			int extendedLength = root.getExtendedLength(curr);
 			// if next import is on a different line, modify the end position to the next line begin offset
+			int nextLineOffset = nextOffset; // offset at the start of next line. Next import may not start here
 			if (currEndLine < nextOffsetLine) {
 				currEndLine++;
-				nextOffset= root.getPosition(currEndLine, 0);
+				nextLineOffset = root.getPosition(currEndLine, 0); 
+				// There may be some leading comments (or line delimiters) before the next import. The start of those comments
+				// is not the real start offset of the next import. So don't change nextOffset
 			}
 			// retrieve preceding and trailing comments if any
 			IRegion rangeBefore = null;
 			IRegion rangeAfter = null;
-			if (nextOffset != extendedStart) {
-				rangeBefore = new Region(extendedStart, extendedStart - nextOffset + 1);
+			
+			if (currOffset > extendedStart) {
+				rangeBefore = new Region(extendedStart, currOffset - extendedStart);
 			}
-			if (nextLength != extendedLength) {
-				rangeAfter = new Region(nextOffset + nextLength, extendedLength - nextLength + 1);
+			int currLen = curr.getLength();
+			if (currLen < extendedLength - (currOffset - extendedStart)) {
+				int currEndOffset = currOffset + currLen;
+				int rangeBeforeLen = rangeBefore != null? rangeBefore.getLength() : 0;
+				rangeAfter = new Region(currEndOffset, extendedLength - rangeBeforeLen - currLen);
 			}
 			currPackage.add(
 					new ImportDeclEntry(
 							packName.length(), 
 							name, 
 							isStatic, 
-							new Region(currOffset, nextOffset - currOffset),
+							new Region(currOffset, nextLineOffset - currOffset), // should not include leading comments of next import, line delimiters, etc.
 							rangeBefore,
 							rangeAfter));
 //{ObjectTeams: base import
@@ -313,7 +324,7 @@
 
 				currPackage= new PackageEntry(); // create a comment package entry for this
 				this.packageEntries.add(currPackage);
-				currPackage.add(new ImportDeclEntry(packName.length(), null, false, new Region(currOffset, nextOffset - currOffset)));
+				currPackage.add(new ImportDeclEntry(packName.length(), null, false, new Region(nextLineOffset, nextOffset - nextLineOffset)));
 
 				currOffset= nextOffset;
 			}
@@ -334,8 +345,23 @@
 // SH}
 			this.packageEntries.add(currPackage);
 		}
-		int length= this.replaceRange.getOffset() + this.replaceRange.getLength() - curr.getStartPosition();
-		currPackage.add(new ImportDeclEntry(packName.length(), name, isStatic, new Region(curr.getStartPosition(), length)));
+		int currStartOffset = curr.getStartPosition();
+		int currLen = curr.getLength();
+		int extendedStartOffset = root.getExtendedStartPosition(curr);
+		IRegion leadingComments = null;
+		IRegion allTrailingComments = null;
+		
+		if (currStartOffset > extendedStartOffset) {
+			leadingComments = new Region(extendedStartOffset, currOffset - extendedStartOffset);
+		}
+		int length= this.replaceRange.getOffset() + this.replaceRange.getLength() - currStartOffset;
+		int extendedLength = root.getExtendedLength(curr);
+		if (currLen < extendedLength - (currOffset - extendedStartOffset)) {
+			int currEndOffset = currOffset + currLen;
+			int leadingCommentsLen = leadingComments != null? leadingComments.getLength() : 0;
+			allTrailingComments = new Region(currEndOffset, extendedLength - leadingCommentsLen - currLen);
+		}
+		currPackage.add(new ImportDeclEntry(packName.length(), name, isStatic, new Region(curr.getStartPosition(), length), leadingComments, allTrailingComments));
 //{ObjectTeams: base import
 		if (isBase)
 			currPackage.getLast().setIsBase(true);
@@ -865,6 +891,14 @@
 						}
 					} else if (!doStarImport || currDecl.isOnDemand() || onDemandConflicts == null || onDemandConflicts.contains(currDecl.getSimpleName())) {
 						int offset= region.getOffset();
+						IRegion rangeBefore = currDecl.getPrecedingCommentRange();
+						if (rangeBefore != null && currPos > rangeBefore.getOffset()) {
+							// moved ahead of the leading comments, bring the currPos back
+							currPos = rangeBefore.getOffset();
+						}
+						if (rangeBefore != null) {
+							stringsToInsert.add(buffer.getText(rangeBefore.getOffset(), rangeBefore.getLength()));
+						}
 						removeAndInsertNew(buffer, currPos, offset, stringsToInsert, resEdit);
 						stringsToInsert.clear();
 //{ObjectTeams:
@@ -883,6 +917,10 @@
 						String simpleName = currDecl.getTypeQualifiedName();
 						if (simpleName.indexOf('.') != -1) {
 							IRegion rangeBefore = currDecl.getPrecedingCommentRange();
+							if (rangeBefore != null && currPos > rangeBefore.getOffset()) {
+								// moved ahead of the leading comments, bring the currPos back
+								currPos = rangeBefore.getOffset();
+							}
 							if (rangeBefore != null) {
 								stringsToInsert.add(buffer.getText(rangeBefore.getOffset(), rangeBefore.getLength()));
 							}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitProblemFinder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitProblemFinder.java
index 4dd3cc2..458fbda 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitProblemFinder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitProblemFinder.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -243,7 +243,7 @@
 			}
 			if (unit != null) {
 				CompilationResult unitResult = unit.compilationResult;
-				CategorizedProblem[] unitProblems = unitResult.getProblems();
+				CategorizedProblem[] unitProblems = unitResult.getCUProblems();
 				int length = unitProblems == null ? 0 : unitProblems.length;
 				if (length > 0) {
 					CategorizedProblem[] categorizedProblems = new CategorizedProblem[length];
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchPattern.java
index 900cfa5..0325eae 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchPattern.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchPattern.java
@@ -2550,11 +2550,8 @@
 
 	// Verify Regexp match rule
 	if ((matchRule & R_REGEXP_MATCH) != 0) {
-		if ((matchRule & R_PATTERN_MATCH) != 0 || (matchRule & R_PREFIX_MATCH) != 0 ||
-			(matchRule & R_CAMELCASE_MATCH) != 0 || (matchRule & R_CAMELCASE_SAME_PART_COUNT_MATCH) != 0) {
-			// regexp is not supported yet
-			return -1;
-		}
+		// regexp is not supported yet
+		return -1;
 	}
 
 	// Verify Pattern match rule