Lines 44-50
Link Here
|
44 |
// All specified tests which do not belong to the class are skipped... |
44 |
// All specified tests which do not belong to the class are skipped... |
45 |
static { |
45 |
static { |
46 |
// TESTS_PREFIX = "testBug86380"; |
46 |
// TESTS_PREFIX = "testBug86380"; |
47 |
// TESTS_NAMES = new String[] { "testCreateBindings19" }; |
47 |
// TESTS_NAMES = new String[] { "testCreateBindings23" }; |
48 |
// TESTS_NUMBERS = new int[] { 83230 }; |
48 |
// TESTS_NUMBERS = new int[] { 83230 }; |
49 |
// TESTS_RANGE = new int[] { 83304, -1 }; |
49 |
// TESTS_RANGE = new int[] { 83304, -1 }; |
50 |
} |
50 |
} |
Lines 664-669
Link Here
|
664 |
} |
664 |
} |
665 |
|
665 |
|
666 |
/* |
666 |
/* |
|
|
667 |
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=297757 |
668 |
*/ |
669 |
public void testCreateBindings23() throws JavaModelException { |
670 |
ASTParser parser = ASTParser.newParser(AST.JLS3); |
671 |
parser.setProject(getJavaProject("P")); |
672 |
WorkingCopyOwner owner = new WorkingCopyOwner() {}; |
673 |
this.workingCopies = new ICompilationUnit[3]; |
674 |
this.workingCopies[0] = getWorkingCopy( |
675 |
"/P/src/p/IScriptRunnable.java", |
676 |
"package p;\n" + |
677 |
"public interface IScriptRunnable<V, E extends Exception> {\n" + |
678 |
" public V run(Object cx, Object scope) throws E;\n" + |
679 |
"}", |
680 |
owner |
681 |
); |
682 |
this.workingCopies[1] = getWorkingCopy( |
683 |
"/P/src/p/Environment.java", |
684 |
"package p;\n" + |
685 |
"public interface Environment {\n" + |
686 |
" public <V, E extends Exception> V execute(IScriptRunnable<V, E> code) throws E;\n" + |
687 |
"}", |
688 |
owner |
689 |
); |
690 |
this.workingCopies[2] = getWorkingCopy( |
691 |
"/P/src/X.java", |
692 |
"import p.*;\n" + |
693 |
"public class X {\n" + |
694 |
" p.Environment env;\n" + |
695 |
" private void test() {\n" + |
696 |
" env.execute(new IScriptRunnable<Object, RuntimeException>() {\n" + |
697 |
" public Object run(Object cx, Object scope) throws RuntimeException {\n" + |
698 |
" return null;\n" + |
699 |
" }\n" + |
700 |
" });\n" + |
701 |
" }\n" + |
702 |
"}", |
703 |
owner |
704 |
); |
705 |
IJavaElement[] elements = new IJavaElement[] { |
706 |
this.workingCopies[0].getType("IScriptRunnable"), |
707 |
this.workingCopies[1].getType("Environment"), |
708 |
this.workingCopies[2].getType("X").getMethod("test", new String[0]).getType("", 1) |
709 |
}; |
710 |
IBinding[] bindings = parser.createBindings(elements, null); |
711 |
assertBindingsEqual( |
712 |
"Lp/IScriptRunnable<TV;TE;>;\n" + |
713 |
"Lp/Environment;\n" + |
714 |
"LX$90;", |
715 |
bindings); |
716 |
} |
717 |
|
718 |
/* |
667 |
* Ensures that the correct IBindings are created for a given set of IJavaElement |
719 |
* Ensures that the correct IBindings are created for a given set of IJavaElement |
668 |
* (top level type) |
720 |
* (top level type) |
669 |
*/ |
721 |
*/ |