diff options
| author | Satyam Kandula | 2012-08-06 08:30:24 +0000 |
|---|---|---|
| committer | Ayushman Jain | 2012-08-06 08:30:24 +0000 |
| commit | 9abb707b704e7290e8521834234b8e3991756882 (patch) | |
| tree | 979527a0d9a4ceec1b17c64333203dc7c1a6b04b | |
| parent | 308ce1529d0bb91113394dc94c8bd9e83fd91a69 (diff) | |
| download | eclipse.jdt.core-9abb707b704e7290e8521834234b8e3991756882.tar.gz eclipse.jdt.core-9abb707b704e7290e8521834234b8e3991756882.tar.xz eclipse.jdt.core-9abb707b704e7290e8521834234b8e3991756882.zip | |
Fixed bug 382606: [javadoc] constructor used in javadoc not gettingv20120806-083024
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())) { |
