[294918] [search] Type hierarchy is not complete for multiple levels of inheritance
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AbstractJavaSearchTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AbstractJavaSearchTests.java
index d40758f..0e7f507 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AbstractJavaSearchTests.java
+++ b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AbstractJavaSearchTests.java
@@ -38,6 +38,8 @@
 	protected static boolean COPY_DIRS = true;
 	protected static int EXACT_RULE = SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE;
 	protected static int EQUIVALENT_RULE = EXACT_RULE | SearchPattern.R_EQUIVALENT_MATCH;
+	protected static int ERASURE_RULE = EXACT_RULE | SearchPattern.R_ERASURE_MATCH;
+	protected static int RAW_RULE = EXACT_RULE | SearchPattern.R_ERASURE_MATCH | SearchPattern.R_EQUIVALENT_MATCH;
 
 //	IJavaScriptUnit[] workingCopies;
 //	boolean discard;
@@ -162,6 +164,8 @@
 								line.append("EXACT_");
 							} else if (match.isEquivalent()) {
 								line.append("EQUIVALENT_");
+							} else if (match.isErasure()) {
+								line.append("ERASURE_");
 							} else {
 								line.append("INVALID_RULE_");
 							}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionTests.java
index 35c0016..585d60a 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionTests.java
+++ b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 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
@@ -3694,6 +3694,24 @@
 		requestor.getResults());
 }
 
+public void testCompletionFindSuperInterface() throws JavaScriptModelException {
+	this.wc = getWorkingCopy(
+            "/Completion/src/CompletionFindSuperInterface.js",
+            "public class CompletionFindSuperInterface implements SuperInterface {\n"+
+            "}");
+    
+    
+    CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+    String str = this.wc.getSource();
+    String completeBehind = "Super";
+    int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+    this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
+
+    assertResults(
+           "SuperInterface[TYPE_REF]{SuperInterface, , LSuperInterface;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_INTERFACE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
+			requestor.getResults());
+}
+
 /**
  * Complete the field "bar" from "this.ba"
  */
@@ -9861,7 +9879,71 @@
 		}
 	}
 }
-
+public void testCompletionSuperType3() throws JavaScriptModelException {
+	IJavaScriptUnit superClass = null;
+	IJavaScriptUnit superClass2 = null;
+	IJavaScriptUnit superInterface = null;
+	IJavaScriptUnit superInterface2 = null;
+	try {
+		superClass = getWorkingCopy(
+	            "/Completion/src/CompletionSuperClass.js",
+	            "public class CompletionSuperClass{\n" +
+	            "	public class Inner {}\n" +
+	            "	public int eqFoo(int a,Object b){\n" +
+	            "		return 1;\n" +
+	            "	}\n" +
+	            "}");
+		
+		superClass2 = getWorkingCopy(
+	            "/Completion/src/CompletionSuperClass2.js",
+	            "public class CompletionSuperClass2 {\n" +
+	            "	public class InnerClass {}\n" +
+	            "	public interface InnerInterface {}\n" +
+	            "}");
+		
+		superInterface = getWorkingCopy(
+	            "/Completion/src/CompletionSuperInterface.js",
+	            "public interface CompletionSuperInterface{\n" +
+	            "	public int eqFoo(int a,Object b);\n" +
+	            "}");
+		
+		superInterface2 = getWorkingCopy(
+	            "/Completion/src/CompletionSuperInterface2.js",
+	            "public interface CompletionSuperInterface2 {\n" +
+	            "	public class InnerClass {}\n" +
+	            "	public interface InnerInterface {}\n" +
+	            "}");
+		
+		this.wc = getWorkingCopy(
+	            "/Completion/src/CompletionSuperType3.js",
+	            "public class CompletionSuperType3 implements CompletionSuper");
+	    
+	    
+	    CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+	    String str = this.wc.getSource();
+	    String completeBehind = "CompletionSuper";
+	    int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+	    this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
+	
+		assertResults(
+			"CompletionSuperInterface[TYPE_REF]{CompletionSuperInterface, , LCompletionSuperInterface;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_INTERFACE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}\n" +
+			"CompletionSuperInterface2[TYPE_REF]{CompletionSuperInterface2, , LCompletionSuperInterface2;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_INTERFACE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}",
+			requestor.getResults());
+	} finally {
+		if(superClass != null) {
+			superClass.discardWorkingCopy();
+		}
+		if(superClass2 != null) {
+			superClass2.discardWorkingCopy();
+		}
+		if(superInterface != null) {
+			superInterface.discardWorkingCopy();
+		}
+		if(superInterface2 != null) {
+			superInterface2.discardWorkingCopy();
+		}
+	}
+}
 public void testCompletionSuperType4() throws JavaScriptModelException {
 	IJavaScriptUnit superClass2 = null;
 	try {
@@ -9893,6 +9975,164 @@
 		}
 	}
 }
+public void testCompletionSuperType5() throws JavaScriptModelException {
+	IJavaScriptUnit superInterface2 = null;
+	try {
+		superInterface2 = getWorkingCopy(
+	            "/Completion/src/CompletionSuperInterface2.js",
+	            "public interface CompletionSuperInterface2 {\n" +
+	            "	public class InnerClass {}\n" +
+	            "	public interface InnerInterface {}\n" +
+	            "}");
+		
+		this.wc = getWorkingCopy(
+	            "/Completion/src/CompletionSuperType5.js",
+	            "public class CompletionSuperType5 implements CompletionSuperInterface2.Inner");
+	    
+	    
+	    CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+	    String str = this.wc.getSource();
+	    String completeBehind = "CompletionSuperInterface2.Inner";
+	    int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+	    this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
+	
+		assertResults(
+			"CompletionSuperInterface2.InnerClass[TYPE_REF]{InnerClass, , LCompletionSuperInterface2$InnerClass;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" +
+			"CompletionSuperInterface2.InnerInterface[TYPE_REF]{InnerInterface, , LCompletionSuperInterface2$InnerInterface;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_INTERFACE+ R_NON_RESTRICTED)+"}",
+			requestor.getResults());
+	} finally {
+		if(superInterface2 != null) {
+			superInterface2.discardWorkingCopy();
+		}
+	}
+}
+public void testCompletionSuperType6() throws JavaScriptModelException {
+	IJavaScriptUnit superClass = null;
+	IJavaScriptUnit superClass2 = null;
+	IJavaScriptUnit superInterface = null;
+	IJavaScriptUnit superInterface2 = null;
+	try {
+		superClass = getWorkingCopy(
+	            "/Completion/src/CompletionSuperClass.js",
+	            "public class CompletionSuperClass{\n" +
+	            "	public class Inner {}\n" +
+	            "	public int eqFoo(int a,Object b){\n" +
+	            "		return 1;\n" +
+	            "	}\n" +
+	            "}");
+		
+		superClass2 = getWorkingCopy(
+	            "/Completion/src/CompletionSuperClass2.js",
+	            "public class CompletionSuperClass2 {\n" +
+	            "	public class InnerClass {}\n" +
+	            "	public interface InnerInterface {}\n" +
+	            "}");
+		
+		superInterface = getWorkingCopy(
+	            "/Completion/src/CompletionSuperInterface.js",
+	            "public interface CompletionSuperInterface{\n" +
+	            "	public int eqFoo(int a,Object b);\n" +
+	            "}");
+		
+		superInterface2 = getWorkingCopy(
+	            "/Completion/src/CompletionSuperInterface2.js",
+	            "public interface CompletionSuperInterface2 {\n" +
+	            "	public class InnerClass {}\n" +
+	            "	public interface InnerInterface {}\n" +
+	            "}");
+		
+		this.wc = getWorkingCopy(
+	            "/Completion/src/CompletionSuperType6.js",
+	            "public interface CompletionSuperType6 extends CompletionSuper");
+	    
+	    
+	    CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+	    String str = this.wc.getSource();
+	    String completeBehind = "CompletionSuper";
+	    int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+	    this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
+	
+		assertResults(
+				"CompletionSuperInterface[TYPE_REF]{CompletionSuperInterface, , LCompletionSuperInterface;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_INTERFACE + R_NON_RESTRICTED)+"}\n" +
+				"CompletionSuperInterface2[TYPE_REF]{CompletionSuperInterface2, , LCompletionSuperInterface2;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_INTERFACE+ R_NON_RESTRICTED)+"}",
+				requestor.getResults());
+	} finally {
+		if(superClass != null) {
+			superClass.discardWorkingCopy();
+		}
+		if(superClass2 != null) {
+			superClass2.discardWorkingCopy();
+		}
+		if(superInterface != null) {
+			superInterface.discardWorkingCopy();
+		}
+		if(superInterface2 != null) {
+			superInterface2.discardWorkingCopy();
+		}
+	}
+}
+public void testCompletionSuperType7() throws JavaScriptModelException {
+	IJavaScriptUnit superClass2 = null;
+	try {
+		superClass2 = getWorkingCopy(
+	            "/Completion/src/CompletionSuperClass2.js",
+	            "public class CompletionSuperClass2 {\n" +
+	            "	public class InnerClass {}\n" +
+	            "	public interface InnerInterface {}\n" +
+	            "}");
+		
+		this.wc = getWorkingCopy(
+	            "/Completion/src/CompletionSuperType7.js",
+	            "public interface CompletionSuperType7 extends CompletionSuperClass2.Inner");
+	    
+	    
+	    CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+	    String str = this.wc.getSource();
+	    String completeBehind = "CompletionSuperClass2.Inner";
+	    int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+	    this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
+	
+		assertResults(
+			"CompletionSuperClass2.InnerClass[TYPE_REF]{InnerClass, , LCompletionSuperClass2$InnerClass;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" +
+			"CompletionSuperClass2.InnerInterface[TYPE_REF]{InnerInterface, , LCompletionSuperClass2$InnerInterface;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_INTERFACE+ R_NON_RESTRICTED)+"}",
+			requestor.getResults());
+	} finally {
+		if(superClass2 != null) {
+			superClass2.discardWorkingCopy();
+		}
+	}
+}
+public void testCompletionSuperType8() throws JavaScriptModelException {
+	IJavaScriptUnit superInterface2 = null;
+	try {
+		superInterface2 = getWorkingCopy(
+	            "/Completion/src/CompletionSuperInterface2.js",
+	            "public interface CompletionSuperInterface2 {\n" +
+	            "	public class InnerClass {}\n" +
+	            "	public interface InnerInterface {}\n" +
+	            "}");
+		
+		this.wc = getWorkingCopy(
+	            "/Completion/src/CompletionSuperType8.js",
+	            "public interface CompletionSuperType8 extends CompletionSuperInterface2.Inner");
+	    
+	    
+	    CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+	    String str = this.wc.getSource();
+	    String completeBehind = "CompletionSuperInterface2.Inner";
+	    int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+	    this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
+	
+		assertResults(
+			"CompletionSuperInterface2.InnerClass[TYPE_REF]{InnerClass, , LCompletionSuperInterface2$InnerClass;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED)+"}\n" +
+			"CompletionSuperInterface2.InnerInterface[TYPE_REF]{InnerInterface, , LCompletionSuperInterface2$InnerInterface;, null, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_INTERFACE+ R_NON_RESTRICTED)+"}",
+			requestor.getResults());
+	} finally {
+		if(superInterface2 != null) {
+			superInterface2.discardWorkingCopy();
+		}
+	}
+}
 public void testCompletionThrowStatement() throws JavaScriptModelException {
 	CompletionTestsRequestor requestor = new CompletionTestsRequestor();
 	IJavaScriptUnit cu= getCompilationUnit("Completion", "src", "", "CompletionThrowStatement.js");
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/HierarchyOnWorkingCopiesTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/HierarchyOnWorkingCopiesTests.java
index b0de5ad..f41c826 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/HierarchyOnWorkingCopiesTests.java
+++ b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/HierarchyOnWorkingCopiesTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2009 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
@@ -38,9 +38,8 @@
  */
 public void testSimpleSubTypeHierarchy() throws CoreException {
 	String newContents =
-		"package x.y;\n" +
-		"public class A extends B {\n" +
-		"}";
+		"function A(){}\n" +
+		"A.prototype = new B()\n";
 	this.copy.getBuffer().setContents(newContents);
 	this.copy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
 	
@@ -48,9 +47,7 @@
 	try {
 		file = this.createFile(
 			"P/src/x/y/B.js", 
-			"package x.y;\n" +
-			"public class B {\n" +
-			"}");
+			"function B() {}\n");
 	
 		IType type = this.getCompilationUnit("P/src/x/y/B.js").getType("B");
 		ITypeHierarchy h = type.newTypeHierarchy(new IJavaScriptUnit[] {this.copy}, null);
@@ -58,7 +55,7 @@
 		assertHierarchyEquals(
 			"Focus: B [in B.js [in x.y [in src [in P]]]]\n" + 
 			"Super types:\n" + 
-			"  Object [in Object.class [in java.lang [in "+ getSystemJsPathString() + " [in P]]]]\n" + 
+			"  Object [in System.js [in java.lang [in "+ getSystemJsPathString() + " [in P]]]]\n" + 
 			"Sub types:\n" + 
 			"  A [in [Working copy] A.js [in x.y [in src [in P]]]]\n",
 			h);
@@ -72,10 +69,8 @@
  */
 public void testSimpleSuperTypeHierarchy() throws CoreException {
 	String newContents =
-		"package x.y;\n" +
-		"public class A {\n" +
-		"}\n"  +
-		"class B {\n" +
+		"function A() {this.a = 1;}\n" +
+		"function B(this.b = 2;) {\n" +
 		"}";
 	this.copy.getBuffer().setContents(newContents);
 	this.copy.reconcile(IJavaScriptUnit.NO_AST, false, null, null);
@@ -84,9 +79,8 @@
 	try {
 		file = this.createFile(
 			"P/src/x/y/C.js", 
-			"package x.y;\n" +
-			"public class C extends B {\n" +
-			"}");
+			"function C() {} {\n" +
+			"C.prototype = new B();");
 	
 		IType type = this.getCompilationUnit("P/src/x/y/C.js").getType("C");
 		ITypeHierarchy h = type.newSupertypeHierarchy(new IJavaScriptUnit[] {this.copy}, null);
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaSearchBugsTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaSearchBugsTests.java
index dd4af2d..ccb33f3 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaSearchBugsTests.java
+++ b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaSearchBugsTests.java
@@ -794,6 +794,26 @@
 	assertSearchResults("");
 }
 
+/**
+ * Bug 79803: [1.5][search] Search for references to type A reports match for type variable A
+ * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=79803"
+ */
+public void testBug79803() throws CoreException {
+	workingCopies = new IJavaScriptUnit[1];
+	workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b79803/A.js",
+		"package b79803;\n" + 
+		"class A<A> {\n" + 
+		"    A a;\n" + 
+		"    b79803.A pa= new b79803.A();\n" + 
+		"}\n"	
+	);
+	IType type = workingCopies[0].getType("A");
+	search(type, REFERENCES, ERASURE_RULE);
+	assertSearchResults(
+		"src/b79803/A.java b79803.A.pa [b79803.A] EXACT_MATCH\n" + 
+		"src/b79803/A.java b79803.A.pa [b79803.A] EXACT_MATCH"
+	);
+}
 public void testBug79803string() throws CoreException {
 	workingCopies = new IJavaScriptUnit[1];
 	workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b79803/A.js",
@@ -1300,7 +1320,7 @@
 public void testBug80918() throws CoreException {
 	IType type = getClassFile("JavaSearchBugs", getExternalJCLPathString("1.5"), "java.lang", "Exception.class").getType();
 	IJavaScriptSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaScriptProject[] {getJavaProject("JavaSearchBugs")}, IJavaScriptSearchScope.SOURCES);
-	search(type, REFERENCES, SearchPattern.R_CASE_SENSITIVE|SearchPattern.R_EQUIVALENT_MATCH, scope);
+	search(type, REFERENCES, SearchPattern.R_CASE_SENSITIVE|SearchPattern.R_ERASURE_MATCH, scope);
 	assertSearchResults(
 		"" // do not expect to find anything, just verify that no CCE happens
 	);
@@ -1488,6 +1508,49 @@
 		"src/b82208/Test.java b82208.B82208 [B82208] EXACT_MATCH"
 	);
 }
+public void testBug82208_INTERFACE() throws CoreException {
+	resultCollector.showRule = true;
+	setUpBug82208();
+	search("B82208*", INTERFACE, ALL_OCCURRENCES);
+	assertSearchResults(
+		"src/b82208/Test.java b82208.B82208_I [B82208_I] EXACT_MATCH"
+	);
+}
+public void testBug82208_ENUM() throws CoreException {
+	resultCollector.showRule = true;
+	setUpBug82208();
+	search("B82208*", ENUM, ALL_OCCURRENCES);
+	assertSearchResults(
+		"src/b82208/Test.java b82208.B82208_E [B82208_E] EXACT_MATCH"
+	);
+}
+public void testBug82208_ANNOTATION_TYPE() throws CoreException {
+	resultCollector.showRule = true;
+	setUpBug82208();
+	search("B82208*", ANNOTATION_TYPE, ALL_OCCURRENCES);
+	assertSearchResults(
+		"src/b82208/Test.java b82208.B82208_A [B82208_A] EXACT_MATCH"
+	);
+}
+public void testBug82208_CLASS_AND_INTERFACE() throws CoreException {
+	resultCollector.showRule = true;
+	setUpBug82208();
+	search("B82208*", CLASS_AND_INTERFACE, ALL_OCCURRENCES);
+	assertSearchResults(
+		"src/b82208/Test.java b82208.B82208_I [B82208_I] EXACT_MATCH\n" + 
+		"src/b82208/Test.java b82208.B82208 [B82208] EXACT_MATCH"
+	);
+}
+public void testBug82208_CLASS_AND_ENUMERATION() throws CoreException {
+	resultCollector.showRule = true;
+	setUpBug82208();
+	search("B82208*", CLASS_AND_ENUM, ALL_OCCURRENCES);
+	assertSearchResults(
+		"src/b82208/Test.java b82208.B82208_E [B82208_E] EXACT_MATCH\n" + 
+		"src/b82208/Test.java b82208.B82208 [B82208] EXACT_MATCH"
+	);
+}
+
 /**
  * Bug 82673: [1.5][search][annot] Search for annotations misses references in default and values constructs
  * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=83012"
@@ -1710,6 +1773,197 @@
 }
 
 /**
+ * Bug 83304: [search] correct results are missing in java search
+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=83304"
+ */
+public void testBug83304() throws CoreException {
+	resultCollector.showRule = true;
+	workingCopies = new IJavaScriptUnit[1];
+	workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83304/Test.js",
+		"package b83304;\n" + 
+		"public class Test {\n" + 
+		"	void foo() {\n" + 
+		"		Class<? extends Throwable> l1= null;\n" + 
+		"		Class<Exception> l2= null;\n" + 
+		"		\n" + 
+		"		Class<String> string_Class;\n" + 
+		"	}\n" + 
+		"}\n"
+		);
+	IType type = selectType(workingCopies[0], "Class", 3);
+	search(type, REFERENCES, ERASURE_RULE, getJavaSearchWorkingCopiesScope());
+	assertSearchResults(
+		"src/b83304/Test.java void b83304.Test.foo() [Class] ERASURE_MATCH\n" + 
+		"src/b83304/Test.java void b83304.Test.foo() [Class] ERASURE_MATCH\n" + 
+		"src/b83304/Test.java void b83304.Test.foo() [Class] EXACT_MATCH"
+	);
+}
+private void setUpBug83304_TypeParameterizedElementPattern() throws CoreException {
+	resultCollector.showRule = true;
+	workingCopies = new IJavaScriptUnit[1];
+	workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83304/Types.js",
+		"package b83304;\n" + 
+		"import g1.t.s.def.Generic;\n" + 
+		"public class Types {\n" + 
+		"	public Generic gen;\n" + 
+		"	public Generic<Object> gen_obj;\n" + 
+		"	public Generic<Exception> gen_exc;\n" + 
+		"	public Generic<?> gen_wld;\n" + 
+		"	public Generic<? extends Throwable> gen_thr;\n" + 
+		"	public Generic<? super RuntimeException> gen_run;\n" + 
+		"}\n"
+	);
+}
+public void testBug83304_TypeParameterizedElementPattern() throws CoreException {
+	resultCollector.showRule = true;
+	setUpBug83304_TypeParameterizedElementPattern();
+	IType type = selectType(workingCopies[0], "Generic", 4);
+	search(type, REFERENCES, ERASURE_RULE);
+	assertSearchResults(
+		"src/b83304/Types.java [g1.t.s.def.Generic] EQUIVALENT_RAW_MATCH\n" + 
+		"src/b83304/Types.java b83304.Types.gen [Generic] EQUIVALENT_RAW_MATCH\n" + 
+		"src/b83304/Types.java b83304.Types.gen_obj [Generic] ERASURE_MATCH\n" + 
+		"src/b83304/Types.java b83304.Types.gen_exc [Generic] EXACT_MATCH\n" + 
+		"src/b83304/Types.java b83304.Types.gen_wld [Generic] EQUIVALENT_MATCH\n" + 
+		"src/b83304/Types.java b83304.Types.gen_thr [Generic] EQUIVALENT_MATCH\n" + 
+		"src/b83304/Types.java b83304.Types.gen_run [Generic] EQUIVALENT_MATCH\n" + 
+		"lib/JavaSearch15.jar g1.t.s.def.Generic<T> g1.t.s.def.Generic.foo() ERASURE_MATCH"
+	);
+}
+public void testBug83304_TypeGenericElementPattern() throws CoreException {
+	resultCollector.showRule = true;
+	setUpBug83304_TypeParameterizedElementPattern();
+	IType type = getClassFile("JavaSearchBugs", "lib/JavaSearch15.jar", "g1.t.s.def", "Generic.class").getType();
+	search(type, REFERENCES, ERASURE_RULE);
+	assertSearchResults(
+		"src/b83304/Types.java [g1.t.s.def.Generic] EQUIVALENT_RAW_MATCH\n" + 
+		"src/b83304/Types.java b83304.Types.gen [Generic] ERASURE_RAW_MATCH\n" + 
+		"src/b83304/Types.java b83304.Types.gen_obj [Generic] ERASURE_MATCH\n" + 
+		"src/b83304/Types.java b83304.Types.gen_exc [Generic] ERASURE_MATCH\n" + 
+		"src/b83304/Types.java b83304.Types.gen_wld [Generic] ERASURE_MATCH\n" + 
+		"src/b83304/Types.java b83304.Types.gen_thr [Generic] ERASURE_MATCH\n" + 
+		"src/b83304/Types.java b83304.Types.gen_run [Generic] ERASURE_MATCH\n" + 
+		"lib/JavaSearch15.jar g1.t.s.def.Generic<T> g1.t.s.def.Generic.foo() EXACT_MATCH"
+	);
+}
+public void testBug83304_TypeStringPattern() throws CoreException {
+	resultCollector.showRule = true;
+	setUpBug83304_TypeParameterizedElementPattern();
+	search("Generic<? super Exception>", TYPE, REFERENCES, ERASURE_RULE);
+	assertSearchResults(
+		"src/b83304/Types.java [Generic] EQUIVALENT_RAW_MATCH\n" + 
+		"src/b83304/Types.java b83304.Types.gen [Generic] EQUIVALENT_RAW_MATCH\n" + 
+		"src/b83304/Types.java b83304.Types.gen_obj [Generic] EQUIVALENT_MATCH\n" + 
+		"src/b83304/Types.java b83304.Types.gen_exc [Generic] EQUIVALENT_MATCH\n" + 
+		"src/b83304/Types.java b83304.Types.gen_wld [Generic] EQUIVALENT_MATCH\n" + 
+		"src/b83304/Types.java b83304.Types.gen_thr [Generic] ERASURE_MATCH\n" + 
+		"src/b83304/Types.java b83304.Types.gen_run [Generic] ERASURE_MATCH\n" + 
+		"lib/JavaSearch15.jar g1.t.s.def.Generic<T> g1.t.s.def.Generic.foo() ERASURE_MATCH"
+	);
+}
+private void setUpBug83304_MethodParameterizedElementPattern() throws CoreException {
+	resultCollector.showRule = true;
+	workingCopies = new IJavaScriptUnit[1];
+	workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83304/Methods.js",
+		"package b83304;\n" + 
+		"import g5.m.def.Single;\n" + 
+		"public class Methods {\n" + 
+		"	void test() {\n" + 
+		"		Single<Exception> gs = new Single<Exception>();\n" + 
+		"		Exception exc = new Exception();\n" + 
+		"		gs.<Throwable>generic(exc);\n" + 
+		"		gs.<Exception>generic(exc);\n" + 
+		"		gs.<String>generic(\"\");\n" + 
+		"	}\n" + 
+		"}\n"
+	);
+}
+public void testBug83304_MethodParameterizedElementPattern() throws CoreException {
+	resultCollector.showRule = true;
+	setUpBug83304_MethodParameterizedElementPattern();
+	IFunction method = selectMethod(workingCopies[0], "generic", 2);
+	search(method, REFERENCES, ERASURE_RULE);
+	assertSearchResults(
+		"src/b83304/Methods.java void b83304.Methods.test() [generic(exc)] ERASURE_MATCH\n" + 
+		"src/b83304/Methods.java void b83304.Methods.test() [generic(exc)] EXACT_MATCH\n" + 
+		"src/b83304/Methods.java void b83304.Methods.test() [generic(\"\")] ERASURE_MATCH"
+	);
+}
+public void testBug83304_MethodGenericElementPattern() throws CoreException {
+	resultCollector.showRule = true;
+	setUpBug83304_MethodParameterizedElementPattern();
+	IType type = getClassFile("JavaSearchBugs", "lib/JavaSearch15.jar", "g5.m.def", "Single.class").getType();
+	IFunction method = type.getFunction("generic", new String[] { "TU;" });
+	search(method, REFERENCES, ERASURE_RULE);
+	assertSearchResults(
+		"src/b83304/Methods.java void b83304.Methods.test() [generic(exc)] ERASURE_MATCH\n" + 
+		"src/b83304/Methods.java void b83304.Methods.test() [generic(exc)] ERASURE_MATCH\n" + 
+		"src/b83304/Methods.java void b83304.Methods.test() [generic(\"\")] ERASURE_MATCH"
+	);
+}
+public void testBug83304_MethodStringPattern() throws CoreException {
+	resultCollector.showRule = true;
+	setUpBug83304_MethodParameterizedElementPattern();
+	search("<Exception>generic", METHOD, REFERENCES, ERASURE_RULE);
+	assertSearchResults(
+		"src/b83304/Methods.java void b83304.Methods.test() [generic(exc)] ERASURE_MATCH\n" + 
+		"src/b83304/Methods.java void b83304.Methods.test() [generic(exc)] EXACT_MATCH\n" + 
+		"src/b83304/Methods.java void b83304.Methods.test() [generic(\"\")] ERASURE_MATCH"
+	);
+}
+private void setUpBug83304_ConstructorGenericElementPattern() throws CoreException {
+	resultCollector.showRule = true;
+	workingCopies = new IJavaScriptUnit[1];
+	workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b83304/Constructors.js",
+		"package b83304;\n" + 
+		"import g5.c.def.Single;\n" + 
+		"public class Constructors {\n" + 
+		"	void test() {\n" + 
+		"		Exception exc= new Exception();\n" + 
+		"		new <Throwable>Single<String>(\"\", exc);\n" + 
+		"		new <Exception>Single<String>(\"\", exc);\n" + 
+		"		new <String>Single<String>(\"\", \"\");\n" + 
+		"	}\n" + 
+		"}\n"
+	);
+}
+public void testBug83304_ConstructorGenericElementPattern() throws CoreException {
+	resultCollector.showRule = true;
+	setUpBug83304_ConstructorGenericElementPattern();
+	IFunction method = selectMethod(workingCopies[0], "Single", 3);
+	search(method, REFERENCES, ERASURE_RULE);
+	assertSearchResults(
+		"src/b83304/Constructors.java void b83304.Constructors.test() [new <Throwable>Single<String>(\"\", exc)] ERASURE_MATCH\n" + 
+		"src/b83304/Constructors.java void b83304.Constructors.test() [new <Exception>Single<String>(\"\", exc)] EXACT_MATCH\n" + 
+		"src/b83304/Constructors.java void b83304.Constructors.test() [new <String>Single<String>(\"\", \"\")] ERASURE_MATCH"
+	);
+}
+public void testBug83304_ConstructorParameterizedElementPattern() throws CoreException {
+	resultCollector.showRule = true;
+	setUpBug83304_ConstructorGenericElementPattern();
+	IType type = getClassFile("JavaSearchBugs", "lib/JavaSearch15.jar", "g5.c.def", "Single.class").getType();
+	IFunction method = type.getFunction("Single", new String[] { "TT;", "TU;" });
+	search(method, REFERENCES, ERASURE_RULE);
+	assertSearchResults(
+		"src/b83304/Constructors.java void b83304.Constructors.test() [new <Throwable>Single<String>(\"\", exc)] ERASURE_MATCH\n" + 
+		"src/b83304/Constructors.java void b83304.Constructors.test() [new <Exception>Single<String>(\"\", exc)] ERASURE_MATCH\n" + 
+		"src/b83304/Constructors.java void b83304.Constructors.test() [new <String>Single<String>(\"\", \"\")] ERASURE_MATCH"
+	);
+}
+public void testBug83304_ConstructorStringPattern() throws CoreException {
+	resultCollector.showRule = true;
+	setUpBug83304_ConstructorGenericElementPattern();
+	search("<Exception>Single", CONSTRUCTOR, REFERENCES, ERASURE_RULE);
+	assertSearchResults(
+		"src/b83304/Constructors.java void b83304.Constructors.test() [new <Throwable>Single<String>(\"\", exc)] ERASURE_MATCH\n" + 
+		"src/b83304/Constructors.java void b83304.Constructors.test() [new <Exception>Single<String>(\"\", exc)] EXACT_MATCH\n" + 
+		"src/b83304/Constructors.java void b83304.Constructors.test() [new <String>Single<String>(\"\", \"\")] ERASURE_MATCH\n" + 
+		"lib/JavaSearch15.jar g5.m.def.Single<T> g5.m.def.Single.returnParamType() ERASURE_MATCH\n" + 
+		"lib/JavaSearch15.jar g5.m.def.Single<T> g5.m.def.Single.complete(U, g5.m.def.Single<T>) ERASURE_MATCH"
+	);
+}
+
+/**
  * Bug 83804: [1.5][javadoc] Missing Javadoc node for package declaration
  * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=83804"
  */
@@ -2764,6 +3018,110 @@
 		"b92944.B92944",
 		requestor);
 }
+public void testBug92944_CLASS_AND_INTERFACE() throws CoreException {
+	resultCollector.showRule = true;
+	setUpBug92944();
+	TypeNameRequestor requestor =  new SearchTests.SearchTypeNameRequestor();
+	new SearchEngine(this.workingCopies).searchAllTypeNames(
+		null,
+		SearchPattern.R_EXACT_MATCH,
+		null,
+		SearchPattern.R_PATTERN_MATCH, // case insensitive
+		CLASS_AND_INTERFACE,
+		getJavaSearchWorkingCopiesScope(),
+		requestor,
+		IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
+		null
+	);
+	// Remove enum and annotation
+	assertSearchResults(
+		"Unexpected all type names",
+		"b92944.B92944\n" + 
+		"b92944.B92944_I",  // Annotation is an interface in java.lang
+		requestor);
+}
+public void testBug92944_CLASS_AND_ENUM() throws CoreException {
+	resultCollector.showRule = true;
+	setUpBug92944();
+	TypeNameRequestor requestor =  new SearchTests.SearchTypeNameRequestor();
+	new SearchEngine(this.workingCopies).searchAllTypeNames(
+		null,
+		SearchPattern.R_EXACT_MATCH,
+		null,
+		SearchPattern.R_PATTERN_MATCH, // case insensitive
+		CLASS_AND_ENUM,
+		getJavaSearchWorkingCopiesScope(),
+		requestor,
+		IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
+		null
+	);
+	// Remove interface and annotation
+	assertSearchResults(
+		"Unexpected all type names",
+		"b92944.B92944\n" + 
+		"b92944.B92944_E",
+		requestor);
+}
+public void testBug92944_INTERFACE() throws CoreException {
+	resultCollector.showRule = true;
+	setUpBug92944();
+	TypeNameRequestor requestor =  new SearchTests.SearchTypeNameRequestor();
+	new SearchEngine(this.workingCopies).searchAllTypeNames(
+		null,
+		SearchPattern.R_EXACT_MATCH,
+		null,
+		SearchPattern.R_PATTERN_MATCH, // case insensitive
+		INTERFACE,
+		getJavaSearchWorkingCopiesScope(),
+		requestor,
+		IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
+		null
+	);
+	assertSearchResults(
+		"Unexpected all type names",
+		"b92944.B92944_I",
+		requestor);
+}
+public void testBug92944_ENUM() throws CoreException {
+	resultCollector.showRule = true;
+	setUpBug92944();
+	TypeNameRequestor requestor =  new SearchTests.SearchTypeNameRequestor();
+	new SearchEngine(this.workingCopies).searchAllTypeNames(
+		null,
+		SearchPattern.R_EXACT_MATCH,
+		null,
+		SearchPattern.R_PATTERN_MATCH, // case insensitive
+		ENUM,
+		getJavaSearchWorkingCopiesScope(),
+		requestor,
+		IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
+		null
+	);
+	assertSearchResults(
+		"Unexpected all type names",
+		"b92944.B92944_E",
+		requestor);
+}
+public void testBug92944_ANNOTATION_TYPE() throws CoreException {
+	resultCollector.showRule = true;
+	setUpBug92944();
+	TypeNameRequestor requestor =  new SearchTests.SearchTypeNameRequestor();
+	new SearchEngine(this.workingCopies).searchAllTypeNames(
+		null,
+		SearchPattern.R_EXACT_MATCH,
+		null,
+		SearchPattern.R_PATTERN_MATCH, // case insensitive
+		ANNOTATION_TYPE,
+		getJavaSearchWorkingCopiesScope(),
+		requestor,
+		IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
+		null
+	);
+	assertSearchResults(
+		"Unexpected all type names",
+		"b92944.B92944_A",
+		requestor);
+}
 
 /**
  * Bug 93392: [1.5][search][annot] search for annotation elements does not seem to be implemented yet
@@ -3249,6 +3607,34 @@
 }
 
 /**
+ * Bug 97087: [1.5][search] Can't find reference of generic class's constructor.
+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=97087"
+ */
+public void testBug97087() throws CoreException {
+	workingCopies = new IJavaScriptUnit[1];
+	this.resultCollector.showRule = true;
+	workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b97087/Bug.js",
+		"package b97087;\n" + 
+		"public class Bug<Type> {\n" + 
+		"    Bug(){}\n" + 
+		"}\n" + 
+		"class Foo extends Bug<String>{\n" + 
+		"    Foo(){}\n" + 
+		"}\n" +
+		"class Bar extends Bug<Exception>{\n" + 
+		"    Bar(){super();}\n" + 
+		"}"
+	);
+	IType type = workingCopies[0].getType("Bug");
+	IFunction method= type.getFunctions()[0];
+	search(method, REFERENCES, SearchPattern.R_ERASURE_MATCH);
+	assertSearchResults(
+		"src/b97087/Bug.java b97087.Foo() [Foo] EXACT_MATCH\n" + 
+		"src/b97087/Bug.java b97087.Bar() [super();] ERASURE_MATCH"
+	);
+}
+
+/**
  * Bug 97120: 
  * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=97120"
  */
@@ -3295,6 +3681,63 @@
 	search(method, REFERENCES);
 	assertSearchResults(""); // Expect no result
 }
+
+/**
+ * Bug 97606: [1.5][search] Raw type reference is reported as exact match for qualified names
+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=97606"
+ */
+public void testBug97606() throws CoreException {
+	workingCopies = new IJavaScriptUnit[4];
+	workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b97606/pack/def/L.js",
+		"package b97606.pack.def;\n" + 
+		"public interface L<E> {}\n"
+	);
+	workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b97606/pack/def/LL.js",
+		"package b97606.pack.def;\n" + 
+		"public class LL<E> implements L<E> {\n" + 
+		"	public Object clone() {\n" + 
+		"		return null;\n" + 
+		"	}\n" + 
+		"}\n"
+	);
+	workingCopies[2] = getWorkingCopy("/JavaSearchBugs/src/b97606/pack/ref/K.js",
+		"package b97606.pack.ref;\n" + 
+		"public interface K {}\n"
+	);
+	workingCopies[3] = getWorkingCopy("/JavaSearchBugs/src/b97606/pack/ref/X.js",
+		"package b97606.pack.ref;\n" + 
+		"public class X implements K {\n" + 
+		"	private b97606.pack.def.LL sg;\n" + 
+		"	protected synchronized b97606.pack.def.L<K> getSG() {\n" + 
+		"		return (sg != null) \n" + 
+		"			? (b97606.pack.def.L) sg.clone()\n" + 
+		"			: null;\n" + 
+		"	}\n" + 
+		"}\n"
+	);
+	IPath pathDef = new Path("/JavaSearchBugs/src/b97606/pack/def");
+	IPath pathRef = new Path("/JavaSearchBugs/src/b97606/pack/ref");
+	try {
+		createFolder(pathDef);
+		createFolder(pathRef);
+		workingCopies[0].commitWorkingCopy(true, null);
+		workingCopies[1].commitWorkingCopy(true, null);
+		workingCopies[2].commitWorkingCopy(true, null);
+		workingCopies[3].commitWorkingCopy(true, null);
+		this.resultCollector.showRule = true;
+		IType type = workingCopies[0].getType("L");
+		search(type, REFERENCES, SearchPattern.R_ERASURE_MATCH);
+		assertSearchResults(
+			"src/b97606/pack/def/LL.java b97606.pack.def.LL [L] ERASURE_MATCH\n" + 
+			"src/b97606/pack/ref/X.java b97606.pack.def.L<K> b97606.pack.ref.X.getSG() [b97606.pack.def.L] ERASURE_MATCH\n" + 
+			"src/b97606/pack/ref/X.java b97606.pack.def.L<K> b97606.pack.ref.X.getSG() [b97606.pack.def.L] ERASURE_RAW_MATCH"
+		);
+	}
+	finally {
+		deleteFolder(pathDef);
+		deleteFolder(pathRef);
+	}
+}
 public void testBug97606b() throws CoreException {
 	workingCopies = new IJavaScriptUnit[4];
 	workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b97606/pack/def/L.js",
@@ -3336,7 +3779,7 @@
 		workingCopies[3].commitWorkingCopy(true, null);
 		this.resultCollector.showRule = true;
 		IType type = workingCopies[0].getType("L");
-		search(type, REFERENCES, SearchPattern.R_EQUIVALENT_MATCH);
+		search(type, REFERENCES, SearchPattern.R_ERASURE_MATCH);
 		assertSearchResults(
 			"src/b97606/pack/def/LL.java b97606.pack.def.LL [L] ERASURE_MATCH\n" + 
 			"src/b97606/pack/ref/X.java L<K> b97606.pack.ref.X.getSG() [L] ERASURE_MATCH\n" + 
@@ -5254,6 +5697,30 @@
 }
 
 /**
+ * Bug 116459: [search] correct results are missing in java search
+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=116459"
+ */
+public void testBug116459() throws CoreException {
+	workingCopies = new IJavaScriptUnit[1];
+	workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/p1/X.js",
+		"package p1;\n" + 
+		"class X<T> {\n" + 
+		"	X<T> gen;\n" + 
+		"	X<String> param;\n" + 
+		"	X raw;\n" + 
+		"}"
+	);
+	IType type = workingCopies[0].getType("X");
+	this.resultCollector.showRule = true;
+	search(type, REFERENCES, ERASURE_RULE);
+	assertSearchResults(
+		"src/p1/X.java p1.X.gen [X] EXACT_MATCH\n" + 
+		"src/p1/X.java p1.X.param [X] ERASURE_MATCH\n" + 
+		"src/p1/X.java p1.X.raw [X] ERASURE_RAW_MATCH"
+	);
+}
+
+/**
  * @test Bug 119545: [search] Binary java method model elements returned by SearchEngine have unresolved parameter types
  * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=119545"
  */
@@ -5348,6 +5815,13 @@
 		"src/b122442/X.java b122442.X [I] EXACT_MATCH"
 	);
 }
+public void testBug122442b() throws CoreException {
+	setUpBug122442a();
+	search("I", INTERFACE, IMPLEMENTORS);
+	assertSearchResults(
+		"src/b122442/II.java b122442.II [I] EXACT_MATCH"
+	);
+}
 public void testBug122442c() throws CoreException {
 	setUpBug122442a();
 	search("I", CLASS, IMPLEMENTORS);
@@ -5376,6 +5850,13 @@
 		"src/b122442/User.java void b122442.User.m():<anonymous>#2 [Interface] EXACT_MATCH"
 	);
 }
+public void testBug122442e() throws CoreException {
+	setUpBug122442d();
+	search("Interface", INTERFACE, IMPLEMENTORS);
+	assertSearchResults(
+		"" // expected no result
+	);
+}
 public void testBug122442f() throws CoreException {
 	setUpBug122442d();
 	search("Interface", CLASS, IMPLEMENTORS);
@@ -5391,6 +5872,13 @@
 		"src/b122442/User.java b122442.Sub [Klass] EXACT_MATCH"
 	);
 }
+public void testBug122442h() throws CoreException {
+	setUpBug122442d();
+	search("Klass", INTERFACE, IMPLEMENTORS);
+	assertSearchResults(
+		"" // expected no result
+	);
+}
 public void testBug122442i() throws CoreException {
 	setUpBug122442d();
 	search("Klass", CLASS, IMPLEMENTORS);
@@ -6495,6 +6983,39 @@
 }
 
 /**
+ * Bug 156177: [1.5][search] interfaces and annotations could be found with only one requets of searchAllTypeName
+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=156177"
+ */
+public void testBug156177() throws CoreException {
+	resultCollector.showRule = true;
+	workingCopies = new IJavaScriptUnit[1];
+	workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b156177/Test.js",
+		"package b156177;\n" + 
+		"interface B156177_I {}\n" + 
+		"enum B156177_E {}\n" + 
+		"@interface B156177_A {}\n" + 
+		"public class B156177 {}\n"
+	);
+	TypeNameRequestor requestor =  new SearchTests.SearchTypeNameRequestor();
+	new SearchEngine(this.workingCopies).searchAllTypeNames(
+		null,
+		SearchPattern.R_EXACT_MATCH,
+		null,
+		SearchPattern.R_PATTERN_MATCH, // case insensitive
+		INTERFACE_AND_ANNOTATION,
+		getJavaSearchWorkingCopiesScope(),
+		requestor,
+		IJavaScriptSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
+		null
+	);
+	assertSearchResults(
+		"Unexpected all type names",
+		"b156177.B156177_A\n" + 
+		"b156177.B156177_I",
+		requestor);
+}
+
+/**
  * Bug 156491: [1.5][search] interfaces and annotations could be found with only one requets of searchAllTypeName
  * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=156491"
  */
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaSearchTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaSearchTests.java
index c306689..8529ee1 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaSearchTests.java
+++ b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaSearchTests.java
@@ -1635,6 +1635,30 @@
 		"src/s4/X.java void s4.X.fred() [foo()] OUTSIDE_JAVADOC",
 		this.resultCollector);
 }
+/*
+ * Generic method reference.
+ */
+public void testMethodReference16() throws CoreException {
+	IType type = getCompilationUnit("JavaSearch15/src/p2/X.js").getType("X");
+	IFunction method = type.getFunction("foo", new String[] {"QE;"});
+	search(method, REFERENCES, ERASURE_RULE, getJavaSearchScope15(), resultCollector);
+	assertSearchResults(
+		"src/p2/Y.java void p2.Y.bar() [foo(this)]",
+		this.resultCollector);
+}
+/**
+ * Bug 111416: [search] wrong potential matches on a static method open
+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=111416"
+ */
+public void testMethodReference17() throws CoreException {
+	IType type = getCompilationUnit("JavaSearch/src/b111416/X.js").getType("X");
+	IFunction method = type.getFunction("open", new String[] {"QString;"});
+	resultCollector.showAccuracy = true;
+	search(method, REFERENCES, ERASURE_RULE, getJavaSearchScope(), resultCollector);
+	assertSearchResults(
+		"src/b111416/X.java void b111416.X.foo() [open(\"\")] EXACT_MATCH",
+		this.resultCollector);
+}
 /**
  * OrPattern test.
  * (regression test for bug 5862 search : too many matches on search with OrPattern)
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/NameLookupTests2.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/NameLookupTests2.java
index 1a611fd..31c0e4e 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/NameLookupTests2.java
+++ b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/NameLookupTests2.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 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
@@ -150,7 +150,7 @@
 		);
 		NameLookup nameLookup = project.newNameLookup(workingCopies);
 		//		NameLookup.Answer answer=nameLookup.findBinding("foo","",Binding.METHOD, false, NameLookup.ACCEPT_ALL,false);
-		NameLookup.Answer answer=nameLookup.findBinding("foo","",Binding.METHOD, false, NameLookup.ACCEPT_CLASSES,false, false, null); 
+		NameLookup.Answer answer=nameLookup.findBinding("foo","",Binding.METHOD, false, NameLookup.ACCEPT_ALL,false, false, null); 
 		assertEquals(
 			"Unepexted ",
 			"foo",
@@ -221,7 +221,7 @@
 				"}"
 			}, 
 			"1.4");
-		IType type = getNameLookup((JavaProject) project).findType("p.X$$1", false, NameLookup.ACCEPT_CLASSES);
+		IType type = getNameLookup((JavaProject) project).findType("p.X$$1", false, NameLookup.ACCEPT_ALL);
 		assertTypesEqual(
 			"Unexpected type", 
 			"p.X$$1\n",
@@ -240,7 +240,7 @@
 		createFolder("/P/lib/p");
 		createFile("/P/lib/p/X.js", "");
 		createFile("/P/lib/p/X$X.js", "");
-		IType type = getNameLookup((JavaProject) project).findType("p.X", false, NameLookup.ACCEPT_CLASSES);
+		IType type = getNameLookup((JavaProject) project).findType("p.X", false, NameLookup.ACCEPT_ALL);
 		assertTypesEqual(
 			"Unexpected type", 
 			"p.X\n",
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/TypeHierarchySerializationTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/TypeHierarchySerializationTests.java
index 2f2df3f..62e235f 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/TypeHierarchySerializationTests.java
+++ b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/TypeHierarchySerializationTests.java
@@ -49,10 +49,6 @@
 	IType type2 = loaded.getType();
 	assertEquals("["+focus+"] focus are not the same", type1, type2);
 	
-	IType[] allTypes1 = stored.getAllClasses();
-	IType[] allTypes2 = loaded.getAllClasses();
-	compare("["+focus+"] all types are not the same", allTypes1, allTypes2);
-	
 	IType[] allClasses1 = stored.getAllClasses();
 	IType[] allClasses2 = loaded.getAllClasses();
 	compare("["+focus+"] all classes are not the same", allClasses1, allClasses2);
@@ -65,8 +61,8 @@
 	Object[] missingTypes2 = loaded.missingTypes.toArray();
 	compare("["+focus+"] all missing types are not the same", missingTypes1, missingTypes2);
 	
-	for (int i = 0; i < allTypes1.length; i++) {
-		IType aType = allTypes1[i];
+	for (int i = 0; i < allClasses1.length; i++) {
+		IType aType = allClasses1[i];
 		
 		int cachedFlags1 = stored.getCachedFlags(aType);
 		int cachedFlags2 = loaded.getCachedFlags(aType);
@@ -76,17 +72,9 @@
 		IType superclass2 = loaded.getSuperclass(aType);
 		assertEquals("["+focus+"] superclass are not the same for "+aType.getFullyQualifiedName(), superclass1, superclass2);
 		
-		IType[] superTypes1 = new IType[]{stored.getSuperclass(aType)};
-		IType[] superTypes2 = new IType[]{loaded.getSuperclass(aType)};
-		compare("["+focus+"] all super types are not the same for "+aType.getFullyQualifiedName(), superTypes1, superTypes2);
-		
 		IType[] subclasses1 = stored.getSubclasses(aType);
 		IType[] subclasses2 = loaded.getSubclasses(aType);
 		compare("["+focus+"] all subclasses are not the same for "+aType.getFullyQualifiedName(), subclasses1, subclasses2);
-		
-		IType[] subtypes1 = stored.getSubclasses(aType);
-		IType[] subtypes2 = loaded.getSubclasses(aType);
-		compare("["+focus+"] all subtypes are not the same for "+aType.getFullyQualifiedName(), subtypes1, subtypes2);
 	}
 }
 private static void compare(String msg, Object[] types1, Object[] types2) {
@@ -132,10 +120,10 @@
 	ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
 	ITypeHierarchy h2 = type.loadTypeHierachy(inputStream, null);
 	
-	compare(type.getFullyQualifiedName(), h1, h2);
+	compare(type.getElementName(), h1, h2);
 	
 	h2.refresh(null);
-	compare(type.getFullyQualifiedName(), h1, h2);
+	compare(type.getElementName(), h1, h2);
 }
 public void test001() throws JavaScriptModelException {
 	IJavaScriptUnit cu = getCompilationUnit(PROJECTNAME, "src", "p1", "X.js");
@@ -152,34 +140,4 @@
 	IType type = cu.getType("Z");
 	testFocusHierarchy(type, project);
 }
-public void test004() throws JavaScriptModelException {
-	IJavaScriptUnit cu = getCompilationUnit(PROJECTNAME, "src", "p1", "I1.js");
-	IType type = cu.getType("I1");
-	testFocusHierarchy(type, project);
-}
-public void test005() throws JavaScriptModelException {
-	IJavaScriptUnit cu = getCompilationUnit(PROJECTNAME, "src", "p1", "I2.js");
-	IType type = cu.getType("I2");
-	testFocusHierarchy(type, project);
-}
-public void test006() throws JavaScriptModelException {
-	IJavaScriptUnit cu = getCompilationUnit(PROJECTNAME, "src", "p1", "I3.js");
-	IType type = cu.getType("I3");
-	testFocusHierarchy(type, project);
-}
-public void test007() throws JavaScriptModelException {
-	IJavaScriptUnit cu = getCompilationUnit(PROJECTNAME, "src", "p1", "I4.js");
-	IType type = cu.getType("I4");
-	testFocusHierarchy(type, project);
-}
-public void test008() throws JavaScriptModelException {
-	IJavaScriptUnit cu = getCompilationUnit(PROJECTNAME, "src", "p1", "I5.js");
-	IType type = cu.getType("I5");
-	testFocusHierarchy(type, project);
-}
-public void test009() throws JavaScriptModelException {
-	IJavaScriptUnit cu = getCompilationUnit(PROJECTNAME, "src", "p1", "I6.js");
-	IType type = cu.getType("I6");
-	testFocusHierarchy(type, project);
-}
 }
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/TypeHierarchyTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/TypeHierarchyTests.java
index 8ac335c..1317c3d 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/TypeHierarchyTests.java
+++ b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/TypeHierarchyTests.java
@@ -30,9 +30,6 @@
 	 */
 	ITypeHierarchy typeHierarchy;
 
-static {
-//	TESTS_NAMES= new String[] { "testGeneric7" };
-}
 public static Test suite() {
 	return buildModelTestSuite(TypeHierarchyTests.class);
 }
@@ -1093,11 +1090,11 @@
  */
 public void testGetSupertypesInRegion() throws JavaScriptModelException {
 	IType type = getClassFile("TypeHierarchy", "lib.jar", "binary", "Y.class").getType();
-	IType[] superTypes = new IType[]{this.typeHierarchy.getSuperclass(type)};
+	IType superType = this.typeHierarchy.getSuperclass(type);
 	assertTypesEqual(
 		"Unexpected super types of Y",
 		"binary.X\n",
-		superTypes);
+		new IType[]{superType});
 }
 /**
  * Ensures that the correct supertypes exist in the type 
@@ -1109,11 +1106,11 @@
 	region.add(project);
 	IType type = getClassFile("TypeHierarchy", "lib.jar", "binary", "Y.class").getType();
 	ITypeHierarchy hierarchy = project.newTypeHierarchy(type, region, null);
-	IType[] superTypes = new IType[]{hierarchy.getSuperclass(type)};
+	IType superType = hierarchy.getSuperclass(type);
 	assertTypesEqual(
 		"Unexpected super types of Y",
 		"binary.X\n",
-		superTypes);
+		new IType[]{superType});
 }
 /**
  * Ensures that getType() returns the type the hierarchy was created for.
@@ -1707,19 +1704,4 @@
 		hierarchy
 	);
 }
-/*
- * Ensures that a hierarchy where the super interface is not visible can still be constructed.
- */
-public void testVisibility2() throws JavaScriptModelException {
-	IType type = getCompilationUnit("/TypeHierarchy/src/q6/Z.js").getType("Z");
-	ITypeHierarchy hierarchy = type.newTypeHierarchy(null);
-	assertHierarchyEquals(
-		"Focus: Z [in Z.java [in q6 [in src [in TypeHierarchy]]]]\n" + 
-		"Super types:\n" + 
-		"  NonVisibleInterface [in X.java [in q5 [in src [in TypeHierarchy]]]]\n" + 
-		"  Object [in Object.class [in java.lang [in "+ getSystemJsPathString() + "]]]\n" + 
-		"Sub types:\n",
-		hierarchy
-	);
-}
 }
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/I1.js b/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/I1.js
deleted file mode 100644
index 32a3fe9..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/I1.js
+++ /dev/null
@@ -1,4 +0,0 @@
-package p1;

-public interface I1 {

-

-}
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/I2.js b/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/I2.js
deleted file mode 100644
index 1d5f61c..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/I2.js
+++ /dev/null
@@ -1,4 +0,0 @@
-package p1;

-public interface I2 extends I6 {

-

-}
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/I3.js b/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/I3.js
deleted file mode 100644
index 96b1996..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/I3.js
+++ /dev/null
@@ -1,4 +0,0 @@
-package p1;

-public interface I3 {

-

-}
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/I4.js b/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/I4.js
deleted file mode 100644
index 5a53f2b..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/I4.js
+++ /dev/null
@@ -1,4 +0,0 @@
-package p1;

-public interface I4 {

-

-}
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/I5.js b/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/I5.js
deleted file mode 100644
index fd6d1a2..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/I5.js
+++ /dev/null
@@ -1,4 +0,0 @@
-package p1;

-public interface I5 {

-

-}
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/I6.js b/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/I6.js
deleted file mode 100644
index 635c2cd..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/I6.js
+++ /dev/null
@@ -1,4 +0,0 @@
-package p1;

-public interface I6 {

-

-}
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/X.js b/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/X.js
index 9e564e5..b719975 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/X.js
+++ b/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/X.js
@@ -1,4 +1,3 @@
-package p1;

-public class X implements I5 {

-		

+function X() {

+	this.x = "x";

 }
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/Y.js b/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/Y.js
index 963e926..ee85c71 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/Y.js
+++ b/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/Y.js
@@ -1,4 +1,2 @@
-package p1;

-public class Y extends X implements I1, I2, IA, IB {

-		

-}
\ No newline at end of file
+function Y() {}

+Y.prototype = new X();
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/Z.js b/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/Z.js
index 7aafa43..0dbd193 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/Z.js
+++ b/tests/org.eclipse.wst.jsdt.core.tests.model/workspace/TypeHierarchySerialization/src/p1/Z.js
@@ -1,4 +1,2 @@
-package p1;

-public class Z extends Y implements I3, I4, IC {

-		

-}
\ No newline at end of file
+function Z() {}

+Z.prototype = new Y();
\ No newline at end of file