View | Details | Raw Unified | Return to bug 100636 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java (-1 / +32 lines)
Lines 36-42 Link Here
36
	// All specified tests which do not belong to the class are skipped...
36
	// All specified tests which do not belong to the class are skipped...
37
	static {
37
	static {
38
//		TESTS_PREFIX =  "testBug86380";
38
//		TESTS_PREFIX =  "testBug86380";
39
//		TESTS_NAMES = new String[] { "testAnonymousType2" };
39
//		TESTS_NAMES = new String[] { "testBinaryMemberTypeFromAnonymousClassFile" };
40
//		TESTS_NUMBERS = new int[] { 83230 };
40
//		TESTS_NUMBERS = new int[] { 83230 };
41
//		TESTS_RANGE = new int[] { 83304, -1 };
41
//		TESTS_RANGE = new int[] { 83304, -1 };
42
		}
42
		}
Lines 85-90 Link Here
85
				"public class Y<T> {\n" +
85
				"public class Y<T> {\n" +
86
				"  public Y(T t) {\n" +
86
				"  public Y(T t) {\n" +
87
				"  }\n" +
87
				"  }\n" +
88
				"}",
89
				"p/Z.java",
90
				"package p;\n" +
91
				"public class Z {\n" +
92
				"  /*start*/class Member {\n" +
93
				"  }/*end*/\n" +
94
				"  void foo() {\n" +
95
				"    new Member() {};\n" +
96
				"  }\n" +
88
				"}"
97
				"}"
89
			}, 
98
			}, 
90
			"1.5");
99
			"1.5");
Lines 243-248 Link Here
243
	}
252
	}
244
	
253
	
245
	/*
254
	/*
255
	 * Ensures that the IJavaElement for a binary member type coming from an anoumous class file is correct.
256
	 * (regression test for bug 100636 [model] Can't find overriden methods of protected nonstatic inner class.)
257
	 */
258
	public void testBinaryMemberTypeFromAnonymousClassFile() throws JavaModelException {
259
		IClassFile classFile = getClassFile("P", "/P/lib.jar", "p", "Z$1.class");
260
		String source = classFile.getSource();
261
		MarkerInfo markerInfo = new MarkerInfo(source);
262
		markerInfo.astStarts = new int[] {source.indexOf("/*start*/") + "/*start*/".length()};
263
		markerInfo.astEnds = new int[] {source.indexOf("/*end*/")};
264
		ASTNode node = buildAST(markerInfo, classFile);
265
		IBinding binding = ((TypeDeclaration) node).resolveBinding();
266
		assertNotNull("No binding", binding);
267
		IJavaElement element = binding.getJavaElement();
268
		assertElementEquals(
269
			"Unexpected Java element",
270
			"Member [in Z$Member.class [in p [in lib.jar [in P]]]]",
271
			element
272
		);
273
		assertTrue("Element should exist", element.exists());
274
	}
275
	
276
	/*
246
	 * Ensures that the correct IBindings are created for a given set of IJavaElement
277
	 * Ensures that the correct IBindings are created for a given set of IJavaElement
247
	 * (test several kinds of elements)
278
	 * (test several kinds of elements)
248
	 */
279
	 */

Return to bug 100636