Summary: | Java Model Exception when proposal window opened | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Alex Chapiro <achapiro> | ||||||||||
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||||||
Severity: | normal | ||||||||||||
Priority: | P3 | CC: | daniel_megert, jerome_lanneluc, philippe_mulet | ||||||||||
Version: | 3.2 | ||||||||||||
Target Milestone: | 3.2 RC2 | ||||||||||||
Hardware: | PC | ||||||||||||
OS: | Windows XP | ||||||||||||
Whiteboard: | |||||||||||||
Attachments: |
|
Description
Alex Chapiro
2006-04-23 22:25:51 EDT
I can reproduce this using Sun 5.0_06 (http://java.sun.com/j2se/1.5.0/docs/api/). It seems that JDT Core cannot retrieve the Javadov for ArrayList.toArray(Object[]) It works for http://java.sun.com/j2se/1.4.2/docs/api/ Philippe, Candidate for RC2? I am investigating it. Created attachment 39389 [details]
Proposed fix
The patch is extracting the right information out of the generic signature of the generic method when there is one.
With this patch, I can successfully get the javadoc for all methods in java.util.List or java.util.Collections.
+1 for 3.2RC2. Jerome - pls review the patch Created attachment 39421 [details]
Better patch
This patch reorganized the previous patch by moving the code into the Util class to build the anchor string.
Created attachment 39464 [details]
Last patch
This last patch is removing some check and add a try/catch in Util.toAnchor(...). If null is returned, this is logged as an unknown format so we can find out cases that would fail.
I can successfully retrieve the javadocs for all methods from java.util.List or java.util.Collections.
Merging these new append... methods with the existing one from Util isn't really useful. Actual methods return void and these methods need to return an int.
This would not make the code more legible.
Added regression test18 in org.eclipse.jdt.core.tests.model.AttachedJavadocTests. It is disabled for now. Jérôme, please enable it once the patch is released. I would not catch RuntimeException without logging. Since you're doing all the checks and throwing IllegalArgumentException, I would just catch IllegalArgumentException. Then no logging would be necessary. I am logging. if (anchor == null) throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.UNKNOWN_JAVADOC_FORMAT, this)); This is enough to log that a problem happened opening a specific type, isn't it? If the RuntimeException is not an IllegalArgumentException, you're losing this information. Why do you need to catch more than IllegalArgumentException ? Since I removed the checks for the bounds I could also have AIOOBE. I can put the check back and then I don't expect anything else than IllegalArgumentException. Yes that would be better Created attachment 39534 [details]
Patch with checks
Jérôme,
This patch has all the checks and catches only IllegalArgumentException.
Ok to release?
OK to release Fixed and released in HEAD. Regression test added in org.eclipse.jdt.core.tests.model.AttachedJavadocTests.test018 Verified with I20060427-1600 for 3.2RC2 |