Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 188749 Details for
Bug 336821
Javadoc reference to constructor does not work without parameter list
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix + regression test
patch.txt (text/plain), 5.65 KB, created by
Satyam Kandula
on 2011-02-11 03:31:46 EST
(
hide
)
Description:
Proposed fix + regression test
Filename:
MIME Type:
Creator:
Satyam Kandula
Created:
2011-02-11 03:31:46 EST
Size:
5.65 KB
patch
obsolete
>### 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 11 Feb 2011 07:35:59 -0000 >@@ -399,7 +399,12 @@ > 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; >+ if (CharOperation.equals(resolvedType.sourceName(), fieldRef.token)) { >+ fieldRef.methodBinding = scope.getConstructor(resolvedType, Binding.NO_TYPES, fieldRef); >+ } else { >+ fieldRef.methodBinding = scope.findMethod(resolvedType, fieldRef.token, 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 11 Feb 2011 07:35:59 -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,15 @@ > } > 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; >+ if (CharOperation.equals(this.actualReceiverType.sourceName(), selector)) { >+ 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 11 Feb 2011 07:36:12 -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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 336821
:
188689
| 188749