View | Details | Raw Unified | Return to bug 336821 | Differences between
and this patch

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java (-1 / +12 lines)
Lines 399-405 Link Here
399
					if (scope.enclosingSourceType().isCompatibleWith(fieldRef.actualReceiverType)) {
399
					if (scope.enclosingSourceType().isCompatibleWith(fieldRef.actualReceiverType)) {
400
						fieldRef.bits |= ASTNode.SuperAccess;
400
						fieldRef.bits |= ASTNode.SuperAccess;
401
					}
401
					}
402
					fieldRef.methodBinding = scope.findMethod((ReferenceBinding)fieldRef.actualReceiverType, fieldRef.token, new TypeBinding[0], fieldRef);
402
					ReferenceBinding resolvedType = (ReferenceBinding) fieldRef.actualReceiverType;
403
					char[] selector = fieldRef.token;
404
					boolean isConstructor = false;
405
					if (CharOperation.equals(resolvedType.sourceName(), fieldRef.token)) {
406
						selector = TypeConstants.INIT;
407
						isConstructor = true;
408
					}
409
					if (isConstructor) {
410
						fieldRef.methodBinding = scope.getConstructor(resolvedType, Binding.NO_TYPES, fieldRef);
411
					} else {
412
						fieldRef.methodBinding = scope.findMethod(resolvedType, selector, Binding.NO_TYPES, fieldRef);
413
					}
403
				}
414
				}
404
			}
415
			}
405
416
(-)compiler/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.java (-4 / +16 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 11-16 Link Here
11
 *******************************************************************************/
11
 *******************************************************************************/
12
package org.eclipse.jdt.internal.compiler.ast;
12
package org.eclipse.jdt.internal.compiler.ast;
13
13
14
import org.eclipse.jdt.core.compiler.CharOperation;
14
import org.eclipse.jdt.internal.compiler.ASTVisitor;
15
import org.eclipse.jdt.internal.compiler.ASTVisitor;
15
import org.eclipse.jdt.internal.compiler.impl.Constant;
16
import org.eclipse.jdt.internal.compiler.impl.Constant;
16
import org.eclipse.jdt.internal.compiler.lookup.*;
17
import org.eclipse.jdt.internal.compiler.lookup.*;
Lines 75-83 Link Here
75
			}
76
			}
76
			if (this.actualReceiverType instanceof ReferenceBinding) {
77
			if (this.actualReceiverType instanceof ReferenceBinding) {
77
				ReferenceBinding refBinding = (ReferenceBinding) this.actualReceiverType;
78
				ReferenceBinding refBinding = (ReferenceBinding) this.actualReceiverType;
78
				MethodBinding possibleMethod = this.receiver.isThis()
79
				char[] selector = this.token;
79
					? scope.getImplicitMethod(this.token, Binding.NO_TYPES, this)
80
				MethodBinding possibleMethod = null;
80
					: scope.getMethod(refBinding, this.token, Binding.NO_TYPES, this);
81
				boolean isConstructor = false;
82
				if (CharOperation.equals(this.actualReceiverType.sourceName(), selector)) {
83
					selector = TypeConstants.INIT;
84
					isConstructor = true;
85
				}
86
				if (isConstructor) {
87
					possibleMethod = scope.getConstructor(refBinding, Binding.NO_TYPES, this);
88
				} else {
89
					possibleMethod = this.receiver.isThis()
90
						? scope.getImplicitMethod(selector, Binding.NO_TYPES, this)
91
						: scope.getMethod(refBinding, selector, Binding.NO_TYPES, this);
92
				}
81
				if (possibleMethod.isValidBinding()) {
93
				if (possibleMethod.isValidBinding()) {
82
					this.methodBinding = possibleMethod;
94
					this.methodBinding = possibleMethod;
83
				} else {
95
				} else {
(-)src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java (-1 / +6 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 3296-3299 Link Here
3296
	public void test109() throws JavaModelException {
3296
	public void test109() throws JavaModelException {
3297
		verifyComments("test109");
3297
		verifyComments("test109");
3298
	}
3298
	}
3299
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=336821
3300
	public void testBug336821() throws JavaModelException {
3301
		ICompilationUnit unit = getCompilationUnit("Converter" , "src", "javadoc.testBug336821", "Try.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
3302
		verifyComments(unit);
3303
	}
3299
}
3304
}
(-)workspace/Converter/src/javadoc/testBug336821/Try.java (+16 lines)
Added Link Here
1
package javadoc.testBug336821;
2
/**
3
 * First ref should resolve to constructor
4
 * @see #Try
5
 * @see #Try(int, String)
6
 * @see #foo
7
 */
8
public class Try {
9
    public Try(int i, String message) {
10
        System.out.println(message + i);
11
    }
12
13
    public void foo(int i, String message) {
14
        System.out.println(message + i);
15
    }
16
}

Return to bug 336821