Bug 120847 - [javadoc] AIOOBE while getting attached javadoc in Javadoc view
Summary: [javadoc] AIOOBE while getting attached javadoc in Javadoc view
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M4   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-14 06:54 EST by Frederic Fusier CLA
Modified: 2005-12-14 19:43 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Fusier CLA 2005-12-14 06:54:04 EST
Verifying bug 120559 with build I20051214-0010, I got an AIOOBE with following test case:

1) Create a project
2) Add external library to this project (whatever you want it does not matter)
3) Edit Javadoc location and enter a valid location (file:/D:/tmp/doc/ for example)
4) Click OK on all dialogs to validate your changes
5) Edit .classpath file and modify Javadoc location by hand to make it invalid
   (D:/tmp/doc/ for example)
6) Open Javadoc view
7) Select a class in the external library => AIOOBE:
java.lang.ArrayIndexOutOfBoundsException: 0
	at org.eclipse.jdt.internal.core.JavaModelStatus.getMessage(JavaModelStatus.java:364)
	at org.eclipse.core.runtime.CoreException.<init>(CoreException.java:42)
	at org.eclipse.jdt.core.JavaModelException.<init>(JavaModelException.java:70)
	at org.eclipse.jdt.internal.core.JavaElement.getLibraryJavadocLocation(JavaElement.java:678)
	at org.eclipse.jdt.internal.core.JavaElement.getJavadocBaseLocation(JavaElement.java:642)
	at org.eclipse.jdt.internal.core.BinaryType.getJavadocContents(BinaryType.java:1034)
	at org.eclipse.jdt.internal.core.BinaryType.getAttachedJavadoc(BinaryType.java:990)
	at org.eclipse.jdt.ui.JavadocContentAccess.getHTMLContentReader(JavadocContentAccess.java:121)
	at org.eclipse.jdt.internal.ui.infoviews.JavadocView.getJavadocHtml(JavadocView.java:467)
	at org.eclipse.jdt.internal.ui.infoviews.JavadocView.computeInput(JavadocView.java:399)
	at org.eclipse.jdt.internal.ui.infoviews.AbstractInfoView$2.run(AbstractInfoView.java:456)

I agree that it's not a common scenario as user is not intended to modify .classpath by hand, however it may happen and we must be safe about that.

It seems that at JavaElement.getLibraryJavadocLocation(JavaElement.java:678), built status does not have any JavaElement and message is expecting one for this ID...
Comment 1 Olivier Thomann CLA 2005-12-14 09:26:37 EST
Fixed and released in HEAD.
Added regression test org.eclipse.jdt.core.tests.model.AttachedJavadocTests.test016
Comment 2 Frederic Fusier CLA 2005-12-14 10:07:10 EST
Verified for 3.2 M4 using build I20051214-0010 + patch of JDT/Core HEAD
Comment 3 Olivier Thomann CLA 2005-12-14 19:43:59 EST
Verified with  I20051214-1600 for 3.2M4