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 101034 Details for
Bug 232790
[misc] @inheritDoc tag does not inherit doc anymore
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Fix 2
232790_2_patch.txt (text/plain), 2.54 KB, created by
Markus Keller
on 2008-05-20 09:20:50 EDT
(
hide
)
Description:
Fix 2
Filename:
MIME Type:
Creator:
Markus Keller
Created:
2008-05-20 09:20:50 EDT
Size:
2.54 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.ui >Index: ui/org/eclipse/jdt/internal/ui/text/javadoc/JavadocContentAccess2.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavadocContentAccess2.java,v >retrieving revision 1.4 >diff -u -r1.4 JavadocContentAccess2.java >--- ui/org/eclipse/jdt/internal/ui/text/javadoc/JavadocContentAccess2.java 15 May 2008 13:07:20 -0000 1.4 >+++ ui/org/eclipse/jdt/internal/ui/text/javadoc/JavadocContentAccess2.java 20 May 2008 13:16:16 -0000 >@@ -16,6 +16,7 @@ > import java.util.ArrayList; > import java.util.Iterator; > import java.util.List; >+import java.util.regex.Pattern; > > import org.eclipse.jdt.core.IBuffer; > import org.eclipse.jdt.core.IJavaElement; >@@ -61,6 +62,12 @@ > */ > public class JavadocContentAccess2 { > >+ /** >+ * Pattern that matches Javadocs containing only an inheritDoc tag. >+ * The (?s).? at the end is for https://bugs.eclipse.org/bugs/show_bug.cgi?id=232944 . >+ */ >+ private static final Pattern ONLY_INHERITDOC_PATTERN= Pattern.compile("/\\*\\*[\\s*]*\\{@inheritDoc\\}[\\s*]*\\*/(?s).?"); //$NON-NLS-1$ >+ > private final IMember fMember; > private String fSource; > >@@ -109,10 +116,8 @@ > ISourceRange javadocRange= member.getJavadocRange(); > if (javadocRange != null) { > String rawJavadoc= buf.getText(javadocRange.getOffset(), javadocRange.getLength()); >- String javadoc= javadoc2HTML(member, rawJavadoc); >- if (!containsOnlyInheritDoc(javadoc)) { >- return javadoc; >- } >+ if (!containsOnlyInheritDoc(rawJavadoc)) >+ return javadoc2HTML(member, rawJavadoc); > } > > if (allowInherited && (member.getElementType() == IJavaElement.METHOD)) { >@@ -174,9 +179,17 @@ > return buf.toString(); > } > >+ /** >+ * Checks whether the given string is Javadoc and >+ * only contains whitespace and the inheritDoc tag. >+ * >+ * @param javadoc the string to test >+ * @return <code>true</code> if the given string is Javadoc with only an inheritDoc tag >+ * @since 3.4 >+ */ > private static boolean containsOnlyInheritDoc(String javadoc) { >- //FIXME: improve {@inheritDoc} support >- return javadoc != null && javadoc.trim().equals("{@inheritDoc}"); //$NON-NLS-1$ >+ //FIXME: improve {@inheritDoc} support: https://bugs.eclipse.org/bugs/show_bug.cgi?id=24227 >+ return ONLY_INHERITDOC_PATTERN.matcher(javadoc).matches(); > } > > private static String findDocInHierarchy(IMethod method, boolean useAttachedJavadoc) throws JavaModelException {
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 232790
:
101009
| 101034