Bug 345429

Summary: Doc should be updated for org.eclipse.jdt.ui.SharedASTProvider.getAST(ITypeRoot, WAIT_FLAG, IProgressMonitor)
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: UIAssignee: Dani Megert <daniel_megert>
Status: VERIFIED FIXED QA Contact:
Severity: trivial    
Priority: P3 CC: daniel_megert, Michael_Rennie
Version: 3.7Keywords: Documentation
Target Milestone: 3.7 RC1   
Hardware: All   
OS: All   
Whiteboard:

Description Olivier Thomann CLA 2011-05-11 10:28:23 EDT
This method can return null if the operation is canceled. This is not clearly specified right now.
Comment 1 Dani Megert CLA 2011-05-11 10:32:29 EDT
(In reply to comment #0)
> This method can return null if the operation is canceled. This is not clearly
> specified right now.

It specifies that 'null' can be returned. What is the other thing that you would expect to get back if you cancel the operation?
Comment 2 Olivier Thomann CLA 2011-05-11 10:37:27 EDT
When WAIT_YES is specified, I don't see null as a possible return value.
Comment 3 Dani Megert CLA 2011-05-11 10:45:22 EDT
(In reply to comment #2)
> When WAIT_YES is specified, I don't see null as a possible return value.

Right, but cancel isn't mentioned in any of the cases explicitly. But again: what would you expect if it gets canceled?

Anyway, I've added an additional blurb so that it's crystal clear.
Comment 4 Dani Megert CLA 2011-05-11 10:45:37 EDT
.
Comment 5 Olivier Thomann CLA 2011-05-11 10:55:47 EDT
(In reply to comment #3)
> Right, but cancel isn't mentioned in any of the cases explicitly. But again:
> what would you expect if it gets canceled?
> Anyway, I've added an additional blurb so that it's crystal clear.
I would expect null, but I think this should be mentioned in the doc.

Also check all callers of this method, I found a couple of places where null is not handled.
Comment 6 Dani Megert CLA 2011-05-16 06:17:25 EDT
Verified in I20110512-2000 that the Javadoc mentions the cancel case.