diff options
| author | Satyam Kandula | 2012-08-06 08:30:24 +0000 |
|---|---|---|
| committer | Jayaprakash Arthanareeswaran | 2012-08-10 07:03:59 +0000 |
| commit | 834847be9877afec78f1128f1819798f39206357 (patch) | |
| tree | 69d023135b56ecb249f26c74d47d4bae0b27d485 | |
| parent | cc4d89ef78d77bbe857a2bc33e77e8ce14aaffa9 (diff) | |
| download | eclipse.jdt.core-834847be9877afec78f1128f1819798f39206357.tar.gz eclipse.jdt.core-834847be9877afec78f1128f1819798f39206357.tar.xz eclipse.jdt.core-834847be9877afec78f1128f1819798f39206357.zip | |
Fixed bug 382606: [javadoc] constructor used in javadoc not getting
resolved for secondary types.
2 files changed, 29 insertions, 2 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java index 899041f4a3..9d9cf1d343 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java @@ -44,7 +44,7 @@ public static Class javadocTestClass() { // All specified tests which does not belong to the class are skipped... static { // TESTS_PREFIX = "testBug96237"; -// TESTS_NAMES = new String[] { "testBug68017javadocWarning2" }; +// TESTS_NAMES = new String[] { "testBug382606" }; // TESTS_NUMBERS = new int[] { 129241 }; // TESTS_RANGE = new int[] { 21, 50 }; } @@ -8856,5 +8856,29 @@ public void testBug221539c() { } ); } + +public void testBug382606() { + runConformTest( + new String[] { + "pack/A.java", + "package pack;\n" + + "/**\n"+ + "* @see A\n" + + "*/\n" + + "public interface A {\n"+ + "}\n"+ + "/**\n"+ + "* @see #B()\n"+ + "*/\n"+ + "class B {\n"+ + " B() {}\n"+ + "\n"+ + " public void foo(){\n"+ + " new B();\n"+ + " }\n"+ + "}\n" + } + ); +} } diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java index 2df5abf61e..5d90545be7 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -104,6 +104,9 @@ public class JavadocMessageSend extends MessageSend { // Try to search a constructor instead enclosingTypeBinding = this.actualReceiverType; MethodBinding contructorBinding = this.binding; + if (!contructorBinding.isValidBinding() && CharOperation.equals(this.selector, enclosingTypeBinding.shortReadableName())) { + contructorBinding = scope.getConstructor((ReferenceBinding)enclosingTypeBinding, argumentTypes, this); + } while (!contructorBinding.isValidBinding() && (enclosingTypeBinding.isMemberType() || enclosingTypeBinding.isLocalType())) { enclosingTypeBinding = enclosingTypeBinding.enclosingType(); if (CharOperation.equals(this.selector, enclosingTypeBinding.shortReadableName())) { |
