| Summary: | [javadoc] Javadoc of ContentAssist#computeCompletionProposals(ITextViewer, int) incorrect: it can return null | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Andreas Sewe <sewe> |
| Component: | Text | Assignee: | Dani Megert <daniel_megert> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | daniel_megert |
| Version: | 4.7 | ||
| Target Milestone: | 4.7 M2 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Andreas Sewe
(In reply to Andreas Sewe from comment #0) > While investigating Bug 499653 I found a possible problem in > org.eclipse.jface.text.contentassist. > ContentAssist#computeCompletionProposals. Contrary to what its Javadoc > indicates and what its callers (at least > CompletionProposalPopup#computeProposals) expect, the method can return null. I just realized that I should have been more precise, as ContentAssist#computeCompletionProposals is overloaded. - ContentAssist#computeCompletionProposals(IContentAssistSubjectControl, int): Javadoc says "@return an array of completion proposals", but it *can* return null. - ContentAssist#computeCompletionProposals(ITextViewer, int): Javadoc correctly says "@return an array of completion proposals or <code>null</code> if no proposals are possible". IMHO, the Javadoc in both cases should indicate that the method can return null. > This causes *immediate* trouble for > CompletionProposalPopup#computeProposals, as that methods tries to sort the > returned array -- which is null rather than empty. The above problem should probably be addressed in a separate bug -- this one is just about the incorrect Javadoc. (In reply to Andreas Sewe from comment #1) > The above problem should probably be addressed in a separate bug -- this one > is just about the incorrect Javadoc. Filed Bug 499980 to track the potential NPE. |