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 101009 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
patch.txt (text/plain), 3.54 KB, created by
Dani Megert
on 2008-05-20 02:57:30 EDT
(
hide
)
Description:
Fix
Filename:
MIME Type:
Creator:
Dani Megert
Created:
2008-05-20 02:57:30 EDT
Size:
3.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 06:55:54 -0000 >@@ -12,8 +12,10 @@ > > import java.io.IOException; > import java.io.Reader; >+import java.io.StringReader; > import java.net.URISyntaxException; > import java.util.ArrayList; >+import java.util.Arrays; > import java.util.Iterator; > import java.util.List; > >@@ -61,6 +63,8 @@ > */ > public class JavadocContentAccess2 { > >+ private static final char[] INHERIT_DOC_TAG= "@inheritDoc}".toCharArray(); //$NON-NLS-1$ >+ > private final IMember fMember; > private String fSource; > >@@ -109,10 +113,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 +176,73 @@ > 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 Javdoc 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$ >+ >+ org.eclipse.core.runtime.Assert.isLegal(javadoc != null); >+ >+ StringReader reader= new StringReader(javadoc); >+ int state= 0; >+ int ch= 0; >+ while (ch != -1) { >+ try { >+ ch= reader.read(); >+ if (ch == -1) >+ break; >+ >+ if (Character.isWhitespace((char) ch)) >+ continue; >+ >+ switch (state) { >+ case 0: // expecting '/' -> 1 >+ if (ch != '/') >+ return false; >+ state= 1; >+ break; >+ case 1: // expecting first '*' -> 2 >+ if (ch != '*') >+ return false; >+ state= 2; >+ break; >+ case 2: // expecting '*' -> 2 or '{' -> 3 >+ if (ch == '*') >+ continue; >+ if (ch != '{') >+ return false; >+ int size= INHERIT_DOC_TAG.length; >+ char[] result= new char[size]; >+ int readCount= reader.read(result, 0, size); >+ if (readCount != size || !Arrays.equals(INHERIT_DOC_TAG, result)) >+ return false; >+ state= 3; >+ break; >+ case 3: // expecting '*' -> 4 >+ if (ch != '*') >+ return false; >+ state= 4; >+ break; >+ case 4: // expecting '*' -> 4 or '/' -> 5 >+ if (ch == '/') >+ state= 5; >+ else if (ch != '*') >+ return false; >+ break; >+ default: >+ return false; >+ } >+ } catch (IOException e) { >+ return false; >+ } >+ } >+ return true; > } > > 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