aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSatyam Kandula2012-08-06 04:30:24 (EDT)
committerJayaprakash Arthanareeswaran2012-08-10 03:03:59 (EDT)
commit834847be9877afec78f1128f1819798f39206357 (patch)
tree69d023135b56ecb249f26c74d47d4bae0b27d485
parentcc4d89ef78d77bbe857a2bc33e77e8ce14aaffa9 (diff)
downloadeclipse.jdt.core-834847be9877afec78f1128f1819798f39206357.zip
eclipse.jdt.core-834847be9877afec78f1128f1819798f39206357.tar.gz
eclipse.jdt.core-834847be9877afec78f1128f1819798f39206357.tar.bz2
Fixed bug 382606: [javadoc] constructor used in javadoc not getting
resolved for secondary types.
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java26
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java5
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 899041f..9d9cf1d 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 2df5abf..5d90545 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())) {