### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java,v retrieving revision 1.71 diff -u -r1.71 Javadoc.java --- compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java 8 Feb 2011 05:16:20 -0000 1.71 +++ compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java 10 Feb 2011 15:17:49 -0000 @@ -399,7 +399,18 @@ if (scope.enclosingSourceType().isCompatibleWith(fieldRef.actualReceiverType)) { fieldRef.bits |= ASTNode.SuperAccess; } - fieldRef.methodBinding = scope.findMethod((ReferenceBinding)fieldRef.actualReceiverType, fieldRef.token, new TypeBinding[0], fieldRef); + ReferenceBinding resolvedType = (ReferenceBinding) fieldRef.actualReceiverType; + char[] selector = fieldRef.token; + boolean isConstructor = false; + if (CharOperation.equals(resolvedType.sourceName(), fieldRef.token)) { + selector = TypeConstants.INIT; + isConstructor = true; + } + if (isConstructor) { + fieldRef.methodBinding = scope.getConstructor(resolvedType, Binding.NO_TYPES, fieldRef); + } else { + fieldRef.methodBinding = scope.findMethod(resolvedType, selector, Binding.NO_TYPES, fieldRef); + } } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.java,v retrieving revision 1.32 diff -u -r1.32 JavadocFieldReference.java --- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.java 22 Oct 2010 22:42:55 -0000 1.32 +++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.java 10 Feb 2011 15:17:49 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2011 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 @@ -11,6 +11,7 @@ *******************************************************************************/ package org.eclipse.jdt.internal.compiler.ast; +import org.eclipse.jdt.core.compiler.CharOperation; import org.eclipse.jdt.internal.compiler.ASTVisitor; import org.eclipse.jdt.internal.compiler.impl.Constant; import org.eclipse.jdt.internal.compiler.lookup.*; @@ -75,9 +76,20 @@ } if (this.actualReceiverType instanceof ReferenceBinding) { ReferenceBinding refBinding = (ReferenceBinding) this.actualReceiverType; - MethodBinding possibleMethod = this.receiver.isThis() - ? scope.getImplicitMethod(this.token, Binding.NO_TYPES, this) - : scope.getMethod(refBinding, this.token, Binding.NO_TYPES, this); + char[] selector = this.token; + MethodBinding possibleMethod = null; + boolean isConstructor = false; + if (CharOperation.equals(this.actualReceiverType.sourceName(), selector)) { + selector = TypeConstants.INIT; + isConstructor = true; + } + if (isConstructor) { + possibleMethod = scope.getConstructor(refBinding, Binding.NO_TYPES, this); + } else { + possibleMethod = this.receiver.isThis() + ? scope.getImplicitMethod(selector, Binding.NO_TYPES, this) + : scope.getMethod(refBinding, selector, Binding.NO_TYPES, this); + } if (possibleMethod.isValidBinding()) { this.methodBinding = possibleMethod; } else { #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java,v retrieving revision 1.88 diff -u -r1.88 ASTConverterJavadocTest.java --- src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java 21 Jul 2010 15:42:29 -0000 1.88 +++ src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java 10 Feb 2011 15:17:49 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2011 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 @@ -3296,4 +3296,9 @@ public void test109() throws JavaModelException { verifyComments("test109"); } + // https://bugs.eclipse.org/bugs/show_bug.cgi?id=336821 + public void testBug336821() throws JavaModelException { + ICompilationUnit unit = getCompilationUnit("Converter" , "src", "javadoc.testBug336821", "Try.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + verifyComments(unit); + } } Index: workspace/Converter/src/javadoc/testBug336821/Try.java =================================================================== RCS file: workspace/Converter/src/javadoc/testBug336821/Try.java diff -N workspace/Converter/src/javadoc/testBug336821/Try.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ workspace/Converter/src/javadoc/testBug336821/Try.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,16 @@ +package javadoc.testBug336821; +/** + * First ref should resolve to constructor + * @see #Try + * @see #Try(int, String) + * @see #foo + */ +public class Try { + public Try(int i, String message) { + System.out.println(message + i); + } + + public void foo(int i, String message) { + System.out.println(message + i); + } +} \ No newline at end of file