Summary: | IMethod#getParameterNames() should not throw JME if javadoc not parseable | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> | ||||||
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | major | ||||||||
Priority: | P3 | CC: | daniel_megert, philippe_mulet | ||||||
Version: | 3.2 | ||||||||
Target Milestone: | 3.2 RC3 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows XP | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Markus Keller
2006-04-28 10:03:23 EDT
Then if the anchor is not found, I should not log an error. But this could have two explanations: wrong computing of the anchor or missing anchor. Do you suggest not to log any exception in both cases? Created attachment 39858 [details]
Proposed fix
Philippe,
Candidate for RC3?
Philippe, Candidate for RC3? (In reply to comment #1) > Then if the anchor is not found, I should not log an error. > But this could have two explanations: wrong computing of the anchor or missing > anchor. > Do you suggest not to log any exception in both cases? Yes. People will file bugs anyway if javadoc attachments don't show up, so we don't need an exception. Missing anchors have to be expected with partial, outdated, or customized javadoc, and no exception should be thrown for expected failures. However, I think this only applies to IJavaElement#getAttachedJavadoc(..). For the case in comment 0, the fix should also make sure that IMethod#getParameterNames() never throws a JME, not even if the Javadoc is malformed or something (i.e. add a try {..} catch (JavaModelException e) { } around BinaryMethod.java:230, rev. 1.89). Created attachment 40016 [details]
Better patch
This patch adds a try/catch around the extraction of the javadoc for the binary method.
Candidate for RC3? Patch is ready. +1 for 3.2RC3. Being resilient is good here. It will revert to inferring arg0... argN. Dani/Markus - pls cast your vote. +1 for 3.2 RC3. Fixed and released in HEAD. Regression test added in org.eclipse.jdt.core.tests.model.AttachedJavadocTests.test020 Verified using N20060503-0010 for 3.2RC3 Double-checked using N20060504-0010 + JDT/Core v_663. Note that this exception does not occur with 3.2 RC2 but only with I20060428-0010. |