Bug 391016 - [organize imports] null returned even though SharedASTProvider.WAIT_YES was used
Summary: [organize imports] null returned even though SharedASTProvider.WAIT_YES was used
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.8   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.3 M3   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2012-10-03 09:37 EDT by Nicolas Bros CLA
Modified: 2012-10-31 05:04 EDT (History)
2 users (show)

See Also:


Attachments
stacktrace (6.03 KB, text/plain)
2012-10-03 09:37 EDT, Nicolas Bros CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Bros CLA 2012-10-03 09:37:35 EDT
Created attachment 221833 [details]
stacktrace

I got the attached "IllegalArgumentException: AST must not be null" while modifying a Java file during a full rebuild of my huge workspace (that takes several minutes to compile).

Eclipse SDK
Version: 3.8.0
Build id: I20120608-1200
Comment 1 Srikanth Sankaran CLA 2012-10-22 05:03:11 EDT
Sorry for the delay. The exception at org.eclipse.jdt.core.dom.rewrite.ImportRewrite.create is expected as the
AST is null there. It appears SharedASTProvider returns a null
AST which is passed around by several parties and rejected with
IAE by ImportRewrite.create. Passing to JDT/UI for comment.
Comment 2 Dani Megert CLA 2012-10-22 08:45:47 EDT
We use SharedASTProvider.WAIT_YES but if the workspace is built in parallel, one could possible get 'null' back if the operation got cancelled.

Nicolas, is it possible that you maybe cancelled some of the jobs?
Comment 3 Dani Megert CLA 2012-10-22 08:52:25 EDT
I fixed the 'null' case in the AddImportsOperation with
http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=5f6b0452256e8c5e08facb917eb07d2a65f1ca02
Comment 4 Nicolas Bros CLA 2012-10-22 09:17:23 EDT
(In reply to comment #2)
> Nicolas, is it possible that you maybe cancelled some of the jobs?

I don't remember precisely what I did, but that is very possible that I cancelled a build job, since the build takes forever with all the projects in my workspace.
Comment 5 Dani Megert CLA 2012-10-22 09:42:16 EDT
(In reply to comment #4)
> (In reply to comment #2)
> > Nicolas, is it possible that you maybe cancelled some of the jobs?
> 
> I don't remember precisely what I did, but that is very possible that I
> cancelled a build job, since the build takes forever with all the projects
> in my workspace.

OK, thanks.
Comment 6 Dani Megert CLA 2012-10-31 05:04:52 EDT
Verified in 4.3-I20121030-2000 through code inspection.