Lines 919-922
Link Here
|
919 |
elements |
919 |
elements |
920 |
); |
920 |
); |
921 |
} |
921 |
} |
|
|
922 |
|
923 |
/** |
924 |
* @bug 165701: [model] No hint for ambiguous javadoc |
925 |
* @test Ensure that no exception is thrown while selecting method in javadoc comment |
926 |
* @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=165701" |
927 |
*/ |
928 |
public void testBug165701() throws JavaModelException { |
929 |
setUnit("b165701/Test.java", |
930 |
"package b165701;\n" + |
931 |
"/**\n" + |
932 |
" * @see #fooo(int)\n" + |
933 |
" */\n" + |
934 |
"public class Test {\n" + |
935 |
" public void foo() {}\n" + |
936 |
"}\n" |
937 |
); |
938 |
int[] selectionPositions = selectionInfo(workingCopies[0], "fooo", 1); |
939 |
IJavaElement[] elements = workingCopies[0].codeSelect(selectionPositions[0], 0); |
940 |
assertElementsEqual("Invalid selection(s)", |
941 |
"Test [in [Working copy] Test.java [in b165701 [in <project root> [in Tests]]]]", |
942 |
elements |
943 |
); |
944 |
} |
945 |
|
946 |
/** |
947 |
* @bug 165794: [model] No hint for ambiguous javadoc |
948 |
* @test Ensure that no exception is thrown while selecting method in javadoc comment |
949 |
* @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=165794" |
950 |
*/ |
951 |
public void testBug165794() throws JavaModelException { |
952 |
setUnit("b165794/Test.java", |
953 |
"package b165794;\n" + |
954 |
"/**\n" + |
955 |
" * No reasonable hint for resolving the {@link #getMax(A)}.\n" + |
956 |
" */\n" + |
957 |
"public class X {\n" + |
958 |
" /**\n" + |
959 |
" * Extends Number method.\n" + |
960 |
" * @see #getMax(A ipZ)\n" + |
961 |
" */\n" + |
962 |
" public <T extends Y> T getMax(final A<T> ipY) {\n" + |
963 |
" return ipY.t();\n" + |
964 |
" }\n" + |
965 |
" \n" + |
966 |
" /**\n" + |
967 |
" * Extends Exception method.\n" + |
968 |
" * @see #getMax(A ipY)\n" + |
969 |
" */\n" + |
970 |
" public <T extends Z> T getMax(final A<T> ipZ) {\n" + |
971 |
" return ipZ.t();\n" + |
972 |
" }\n" + |
973 |
"}\n" + |
974 |
"class A<T> {\n" + |
975 |
" T t() { return null; }\n" + |
976 |
"}\n" + |
977 |
"class Y {}\n" + |
978 |
"class Z {}" |
979 |
); |
980 |
int[] selectionPositions = selectionInfo(workingCopies[0], "getMax", 1); |
981 |
IJavaElement[] elements = workingCopies[0].codeSelect(selectionPositions[0], 0); |
982 |
assertElementsEqual("Invalid selection(s)", |
983 |
"getMax(A<T>) [in X [in [Working copy] Test.java [in b165794 [in <project root> [in Tests]]]]]\n" + |
984 |
"getMax(A<T>) [in X [in [Working copy] Test.java [in b165794 [in <project root> [in Tests]]]]]", |
985 |
elements |
986 |
); |
987 |
} |
922 |
} |
988 |
} |