### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/model/SelectionJavadocModelTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SelectionJavadocModelTests.java,v retrieving revision 1.8 diff -u -r1.8 SelectionJavadocModelTests.java --- src/org/eclipse/jdt/core/tests/model/SelectionJavadocModelTests.java 14 Jun 2006 10:53:55 -0000 1.8 +++ src/org/eclipse/jdt/core/tests/model/SelectionJavadocModelTests.java 24 Nov 2006 18:54:47 -0000 @@ -919,4 +919,70 @@ elements ); } + + /** + * @bug 165701: [model] No hint for ambiguous javadoc + * @test Ensure that no exception is thrown while selecting method in javadoc comment + * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=165701" + */ + public void testBug165701() throws JavaModelException { + setUnit("b165701/Test.java", + "package b165701;\n" + + "/**\n" + + " * @see #fooo(int)\n" + + " */\n" + + "public class Test {\n" + + " public void foo() {}\n" + + "}\n" + ); + int[] selectionPositions = selectionInfo(workingCopies[0], "fooo", 1); + IJavaElement[] elements = workingCopies[0].codeSelect(selectionPositions[0], 0); + assertElementsEqual("Invalid selection(s)", + "Test [in [Working copy] Test.java [in b165701 [in [in Tests]]]]", + elements + ); + } } #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java,v retrieving revision 1.84 diff -u -r1.84 MethodBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java 6 Nov 2006 14:19:56 -0000 1.84 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java 24 Nov 2006 18:54:48 -0000 @@ -325,7 +325,7 @@ int signatureLength = sig.length; // thrown exceptions - int thrownExceptionsLength = this.thrownExceptions.length; + int thrownExceptionsLength = this.thrownExceptions == null ? 0 : this.thrownExceptions.length; int thrownExceptionsSignatureLength = 0; char[][] thrownExceptionsSignatures = null; boolean addThrownExceptions = thrownExceptionsLength > 0 && (!isGeneric || CharOperation.lastIndexOf('^', sig) < 0);