|
Lines 2351-2354
Link Here
|
| 2351 |
project.setRawClasspath(originalClasspath, null); |
2351 |
project.setRawClasspath(originalClasspath, null); |
| 2352 |
} |
2352 |
} |
| 2353 |
} |
2353 |
} |
|
|
2354 |
/** |
| 2355 |
* @bug 254738: NPE in HierarchyResolver.setFocusType |
| 2356 |
* @test that a nested method/anonymous sub type is included in the hierarchy when the number of annotations > 10 |
| 2357 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=254738" |
| 2358 |
*/ |
| 2359 |
public void testBug254738() throws CoreException { |
| 2360 |
try { |
| 2361 |
createJavaProject("P", new String[] {"src"}, new String[] {}, "bin", "1.5"); |
| 2362 |
createFolder("/P/src/abc"); |
| 2363 |
createFile( |
| 2364 |
"/P/src/abc/Parent.java", |
| 2365 |
"package abc;\n" + |
| 2366 |
"public class Parent {\n" + |
| 2367 |
" public void parentmethod() {\n" + |
| 2368 |
" new Object() {\n" + |
| 2369 |
" void nestedonemethod() {\n" + |
| 2370 |
" new Object(){\n" + |
| 2371 |
" public int hashCode() {\n" + |
| 2372 |
" return 0; \n" + |
| 2373 |
" } \n" + |
| 2374 |
" }; \n" + |
| 2375 |
" }\n" + |
| 2376 |
" };\n" + |
| 2377 |
" }\n" + |
| 2378 |
"}\n" + |
| 2379 |
"@Deprecated\n" + |
| 2380 |
"class Dep {\n" + |
| 2381 |
" @Deprecated void a() {}\n" + |
| 2382 |
" @Deprecated void b() {}\n" + |
| 2383 |
" @Deprecated void c() {}\n" + |
| 2384 |
" @Deprecated void d() {}\n" + |
| 2385 |
" @Deprecated void e() {}\n" + |
| 2386 |
" @Deprecated void f() {}\n" + |
| 2387 |
" @Deprecated void g() {}\n" + |
| 2388 |
" @Deprecated void h() {}\n" + |
| 2389 |
" @Deprecated void i() {}\n" + |
| 2390 |
" @Deprecated void j() {}\n" + |
| 2391 |
" @Deprecated void k() {}\n" + |
| 2392 |
"}" |
| 2393 |
); |
| 2394 |
IType focus = getCompilationUnit("/P/src/abc/Parent.java").getType("Parent"); |
| 2395 |
focus = focus.getMethod("parentmethod", new String[]{}).getType("", 1).getMethod("nestedonemethod", new String[]{}). |
| 2396 |
getType("", 1); |
| 2397 |
ITypeHierarchy hierarchy = focus.newTypeHierarchy(null); |
| 2398 |
assertHierarchyEquals( |
| 2399 |
"Focus: <anonymous #1> [in nestedonemethod() [in <anonymous #1> [in parentmethod() [in Parent [in Parent.java [in abc [in src [in P]]]]]]]]\n" + |
| 2400 |
"Super types:\n" + |
| 2401 |
"Sub types:\n", |
| 2402 |
hierarchy); |
| 2403 |
} finally { |
| 2404 |
deleteProjects(new String[] {"P"}); |
| 2405 |
} |
| 2406 |
} |
| 2354 |
} |
2407 |
} |