Lines 11-21
Link Here
|
11 |
|
11 |
|
12 |
package org.eclipse.jdt.core.tests.dom; |
12 |
package org.eclipse.jdt.core.tests.dom; |
13 |
|
13 |
|
|
|
14 |
import java.io.File; |
14 |
import java.io.IOException; |
15 |
import java.io.IOException; |
|
|
16 |
import java.util.HashMap; |
15 |
import java.util.List; |
17 |
import java.util.List; |
|
|
18 |
import java.util.Map; |
16 |
|
19 |
|
17 |
import junit.framework.Test; |
20 |
import junit.framework.Test; |
18 |
|
21 |
|
|
|
22 |
import org.eclipse.core.resources.IFolder; |
23 |
import org.eclipse.core.resources.IResource; |
19 |
import org.eclipse.core.runtime.CoreException; |
24 |
import org.eclipse.core.runtime.CoreException; |
20 |
import org.eclipse.jdt.core.ICompilationUnit; |
25 |
import org.eclipse.jdt.core.ICompilationUnit; |
21 |
import org.eclipse.jdt.core.IJavaElement; |
26 |
import org.eclipse.jdt.core.IJavaElement; |
Lines 24-29
Link Here
|
24 |
import org.eclipse.jdt.core.JavaCore; |
29 |
import org.eclipse.jdt.core.JavaCore; |
25 |
import org.eclipse.jdt.core.JavaModelException; |
30 |
import org.eclipse.jdt.core.JavaModelException; |
26 |
import org.eclipse.jdt.core.dom.*; |
31 |
import org.eclipse.jdt.core.dom.*; |
|
|
32 |
import org.eclipse.jdt.core.tests.util.Util; |
27 |
|
33 |
|
28 |
public class ASTConverter15Test extends ConverterTestSetup { |
34 |
public class ASTConverter15Test extends ConverterTestSetup { |
29 |
|
35 |
|
Lines 39-45
Link Here
|
39 |
} |
45 |
} |
40 |
|
46 |
|
41 |
static { |
47 |
static { |
42 |
// TESTS_NUMBERS = new int[] { 195 }; |
48 |
// TESTS_NUMBERS = new int[] { 196 }; |
43 |
// TESTS_NAMES = new String[] {"test0189"}; |
49 |
// TESTS_NAMES = new String[] {"test0189"}; |
44 |
} |
50 |
} |
45 |
public static Test suite() { |
51 |
public static Test suite() { |
Lines 5879-5882
Link Here
|
5879 |
assertTrue("Bindings are not equals", methodBinding2.isEqualTo(methodBinding2)); |
5885 |
assertTrue("Bindings are not equals", methodBinding2.isEqualTo(methodBinding2)); |
5880 |
assertTrue("Bindings are not equals", methodBinding.isEqualTo(methodBinding)); |
5886 |
assertTrue("Bindings are not equals", methodBinding.isEqualTo(methodBinding)); |
5881 |
} |
5887 |
} |
|
|
5888 |
|
5889 |
/* |
5890 |
* Ensures that creating an AST with binding resolution where there is a problem in a binary |
5891 |
* doesn't throw an NPE |
5892 |
* (regression test for bug 100606 NPE during reconcile) |
5893 |
*/ |
5894 |
public void test0196() throws CoreException { |
5895 |
try { |
5896 |
createJavaProject("P", new String[] {"src" }, new String[] {"CONVERTER_JCL15_LIB", "/P/lib"}, "bin", "1.5"); |
5897 |
IFolder folder = createFolder("/P/lib"); |
5898 |
String classesPath = folder.getLocation().toOSString(); |
5899 |
Map options = new HashMap(); |
5900 |
String[] pathsAndContents = new String[] { |
5901 |
"p/Bin.java", |
5902 |
"package p;\n" + |
5903 |
"public class Bin {\n" + |
5904 |
"}", |
5905 |
"p/BinSub.java", |
5906 |
"package p;\n" + |
5907 |
"public class BinSub extends Bin {\n" + |
5908 |
"}", |
5909 |
}; |
5910 |
Util.compile(pathsAndContents, options, classesPath); |
5911 |
folder.refreshLocal(IResource.DEPTH_INFINITE, null); |
5912 |
folder.getFolder("p").getFile("Bin.class").delete(false, null); |
5913 |
this.workingCopy = getWorkingCopy("/P/src/X.java", true/*resolve*/); |
5914 |
String contents = |
5915 |
"public class X {\n" + |
5916 |
" void bar() throws p.BinSub {\n" + |
5917 |
" }\n" + |
5918 |
" </*start*/T/*end*/> void foo() {\n" + |
5919 |
" }\n" + |
5920 |
"}"; |
5921 |
IBinding[] bindings = resolveBindings(contents, this.workingCopy); |
5922 |
assertBindingsEqual( |
5923 |
"LX;.foo<T:>():TT;", |
5924 |
bindings); |
5925 |
} finally { |
5926 |
deleteProject("P"); |
5927 |
} |
5928 |
} |
5882 |
} |
5929 |
} |