Lines 10-17
Link Here
|
10 |
*******************************************************************************/ |
10 |
*******************************************************************************/ |
11 |
package org.eclipse.jdt.core.tests.model; |
11 |
package org.eclipse.jdt.core.tests.model; |
12 |
|
12 |
|
|
|
13 |
import java.io.IOException; |
14 |
|
15 |
import org.eclipse.core.runtime.CoreException; |
13 |
import org.eclipse.jdt.core.*; |
16 |
import org.eclipse.jdt.core.*; |
14 |
import org.eclipse.jdt.core.ICompilationUnit; |
|
|
15 |
|
17 |
|
16 |
import junit.framework.*; |
18 |
import junit.framework.*; |
17 |
|
19 |
|
Lines 2236-2239
Link Here
|
2236 |
elements |
2238 |
elements |
2237 |
); |
2239 |
); |
2238 |
} |
2240 |
} |
|
|
2241 |
|
2242 |
/* |
2243 |
* Ensure that resolving a binary synthetic contructor call in a generic class returns the member type |
2244 |
* (regression test for bug 131519 JDK with attached source unnavigable.) |
2245 |
*/ |
2246 |
public void test101() throws CoreException,IOException { |
2247 |
try { |
2248 |
IJavaProject project = createJavaProject("P", new String[] {}, new String[] {"JCL15_LIB"}, "", "1.5"); |
2249 |
String source = |
2250 |
"public class X<E> {\n" + |
2251 |
" private class Y {\n" + |
2252 |
" }\n" + |
2253 |
" Object foo() {\n" + |
2254 |
" return new Y();\n" + |
2255 |
" }\n" + |
2256 |
"}"; |
2257 |
addLibrary(project, "lib15.jar", "lib15.zip", new String[] {"X.java", source}, "1.5"); |
2258 |
IClassFile classFile = getClassFile("P", "/P/lib15.jar", "", "X.class"); |
2259 |
int start = source.indexOf("Y()"); |
2260 |
int end = source.indexOf("();"); |
2261 |
IJavaElement[] elements = classFile.codeSelect(start, end-start); |
2262 |
assertElementsEqual( |
2263 |
"Unexpected selection", |
2264 |
"Y [in X$Y.class [in <default> [in lib15.jar [in P]]]]", |
2265 |
elements); |
2266 |
} finally { |
2267 |
deleteProject("P"); |
2268 |
} |
2269 |
} |
2239 |
} |
2270 |
} |