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 31669 Details for
Bug 120559
Getting Javadoc from attached Javadoc gives JavaModelException
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch_120559.txt (text/plain), 4.58 KB, created by
Olivier Thomann
on 2005-12-13 14:24:48 EST
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2005-12-13 14:24:48 EST
Size:
4.58 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/BinaryField.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryField.java,v >retrieving revision 1.30 >diff -u -r1.30 BinaryField.java >--- model/org/eclipse/jdt/internal/core/BinaryField.java 5 Dec 2005 15:33:53 -0000 1.30 >+++ model/org/eclipse/jdt/internal/core/BinaryField.java 13 Dec 2005 19:23:57 -0000 >@@ -109,7 +109,7 @@ > } > public String getAttachedJavadoc(IProgressMonitor monitor, String defaultEncoding) throws JavaModelException { > String contents = ((BinaryType) this.getDeclaringType()).getJavadocContents(monitor, defaultEncoding); >- if (contents == null) throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.CANNOT_RETRIEVE_ATTACHED_JAVADOC, this)); >+ if (contents == null) return null; > int indexAnchor = contents.indexOf( > JavadocConstants.ANCHOR_PREFIX_START + this.getElementName() + JavadocConstants.ANCHOR_PREFIX_END); > if (indexAnchor == -1) throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.UNKNOWN_JAVADOC_FORMAT, this)); >Index: model/org/eclipse/jdt/internal/core/BinaryMethod.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java,v >retrieving revision 1.79 >diff -u -r1.79 BinaryMethod.java >--- model/org/eclipse/jdt/internal/core/BinaryMethod.java 8 Dec 2005 14:48:52 -0000 1.79 >+++ model/org/eclipse/jdt/internal/core/BinaryMethod.java 13 Dec 2005 19:23:57 -0000 >@@ -462,7 +462,7 @@ > return extractJavadoc(declaringType, contents); > } > private String extractJavadoc(IType declaringType, String contents) throws JavaModelException { >- if (contents == null) throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.CANNOT_RETRIEVE_ATTACHED_JAVADOC, this)); >+ if (contents == null) return null; > > String typeQualifiedName = declaringType.getTypeQualifiedName('.'); > typeQualifiedName = typeQualifiedName.replace('$', '.'); >Index: model/org/eclipse/jdt/internal/core/BinaryType.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryType.java,v >retrieving revision 1.129 >diff -u -r1.129 BinaryType.java >--- model/org/eclipse/jdt/internal/core/BinaryType.java 7 Dec 2005 16:42:52 -0000 1.129 >+++ model/org/eclipse/jdt/internal/core/BinaryType.java 13 Dec 2005 19:23:57 -0000 >@@ -988,7 +988,7 @@ > } > public String getAttachedJavadoc(IProgressMonitor monitor, String defaultEncoding) throws JavaModelException { > final String contents = getJavadocContents(monitor, defaultEncoding); >- if (contents == null) throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.CANNOT_RETRIEVE_ATTACHED_JAVADOC, this)); >+ if (contents == null) return null; > final int indexOfStartOfClassData = contents.indexOf(JavadocConstants.START_OF_CLASS_DATA); > if (indexOfStartOfClassData == -1) throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.UNKNOWN_JAVADOC_FORMAT, this)); > int indexOfNextSummary = contents.indexOf(JavadocConstants.NESTED_CLASS_SUMMARY); >Index: model/org/eclipse/jdt/internal/core/JavaElement.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElement.java,v >retrieving revision 1.111 >diff -u -r1.111 JavaElement.java >--- model/org/eclipse/jdt/internal/core/JavaElement.java 7 Dec 2005 16:42:52 -0000 1.111 >+++ model/org/eclipse/jdt/internal/core/JavaElement.java 13 Dec 2005 19:23:57 -0000 >@@ -11,6 +11,7 @@ > package org.eclipse.jdt.internal.core; > > import java.io.BufferedInputStream; >+import java.io.FileNotFoundException; > import java.io.IOException; > import java.io.InputStream; > import java.net.MalformedURLException; >@@ -722,9 +723,11 @@ > return String.valueOf(contents); > } > } catch (MalformedURLException e) { >- // ignore >- } catch (IOException e) { >- // ignore >+ throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.CANNOT_RETRIEVE_ATTACHED_JAVADOC, this)); >+ } catch (FileNotFoundException e) { >+ // ignore. see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=120559 >+ } catch(IOException e) { >+ throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.CANNOT_RETRIEVE_ATTACHED_JAVADOC, this)); > } finally { > if (stream != null) { > try {
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 120559
: 31669 |
36991