| Summary: | [actions] Opening a project in Package Explorer forces me to select the project to open twice | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Tomasz Zarna <tomasz.zarna> | ||||||||
| Component: | UI | Assignee: | Raksha Vasisht <raksha.vasisht> | ||||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | daniel_megert, markus.kell.r, remy.suen, Szymon.Brandys | ||||||||
| Version: | 3.6 | Flags: | markus.kell.r:
review+
|
||||||||
| Target Milestone: | 3.7 M7 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows XP | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Tomasz Zarna
Szymon has been experiencing the same inconvenience for some time. I can't reproduce that. When the selection contains a closed project, the OpenProjectAction does not show the dialog. The dialog is only shown when no closed project is selected. Note that the dashed rectangle around a tree item is not a selection -- that's just a focus cursor. The implementation of this is in org.eclipse.jdt.ui.actions.OpenProjectAction.run(IStructuredSelection). I admit it does not happen each time. It appears to be a timing issue when 2 'Open project' jobs (for the same project) are batched and wait for 'Building workspace' to complete (triggered on the project's closure). Created attachment 154018 [details]
Screen shot
I20091208-0100
More reliable steps:
1. Switch to a large workspace. This seems to be crucial since auto-build takes more time then.
2. Make sure 'Build Automatically' option is on
3. Right click on o.e.jdt.core and do 'Close project'
=> Workspace starts build
4. As soon as project's icon changes to 'closed', right click again on the project and pick 'Open project'
=> Workspace is still building
5. Quickly right click again on the same project and do 'Open project' one more time
=> See screen shot
I know it's a matter of timing and a bit of luck but I was able to reproduce it quite easily on Pawel's I20091207-1800 in his workspace as well.
Created attachment 170168 [details]
workspace with troublesome projects
I stripped and packed my workspace as this hit me again running 3.6RC2.
Steps:
1. Extract the archive
2. Run Eclipse and point it to use the workspace from the archive
3. Go to Java perspective
4. In Package Explorer expand 'extssh' working set
5. Select o.e.core.net.linux.x86 project (closed)
6. Right click on the project and select 'Open'
=> Instead of opening the project, 'Open Project' dialog pops out asking to me
to select the project(s) I want to open one more time.
btw, ignore the previous comment, as it turned out, the building process has nothing to do with this issue.
Another curiosity: 7. Open the project by selecting it in the dialog 8. Delete it, but leave it on disk 9. Refresh (F5) the working set => The project re-appears in the Package Explorer, but it's gone in the Project Explorer Reopening, see the comments above. Reproduced, looks like a problem with the resource working set. Also note the broken org.eclipse.releng in the working set (project not available on disk). The ResourceWorkingSetUpdater should probably take care of this. (In reply to comment #8) > Reproduced, looks like a problem with the resource working set. > > Also note the broken org.eclipse.releng in the working set (project not > available on disk). The ResourceWorkingSetUpdater should probably take care of > this. There's also bug 311168 that may be related about working sets and non-existent projects. Raksha, could you please have a look? Created attachment 193781 [details] Proposed fix (In reply to comment #5) > Created attachment 170168 [details] [diff] > workspace with troublesome projects > > I stripped and packed my workspace as this hit me again running 3.6RC2. > > Steps: > 1. Extract the archive > 2. Run Eclipse and point it to use the workspace from the archive > 3. Go to Java perspective > 4. In Package Explorer expand 'extssh' working set > 5. Select o.e.core.net.linux.x86 project (closed) > 6. Right click on the project and select 'Open' > => Instead of opening the project, 'Open Project' dialog pops out asking to me > to select the project(s) I want to open one more time. I see that the problem is in org.eclipse.jdt.ui.actions.OpenProjectAction.isClosedProject(Object) where we assume that the selection is an IProject instance, whereas in this attached example the selection is actually a JavaProject and hence goes not being detected as a closed project and opens a dialog with all the closed projects in the workspace. I'm not sure why the selection shows up as Java Project only when in Working Sets mode and not in Projects mode in PE. I can't reproduce the problem when I create new projects or check out a projectunder a resource working set. The attached patch takes care of the scenario when the selection is a JavaProject. (In reply to comment #6) > Another curiosity: > 7. Open the project by selecting it in the dialog > 8. Delete it, but leave it on disk > 9. Refresh (F5) the working set > => The project re-appears in the Package Explorer, but it's gone in the Project > Explorer I think this has been fixed in bug 300368 comment# 15. It also gives you a workaround for older builds and existing stale projects. Patch is good, please release. (In reply to comment #12) > Patch is good, please release. Thanks, Committed to HEAD. Verified in I20110425-1800: the fix looks good. I suspect that the given workspace somehow got corrupted at some point, e.g. abnormally exited and hence the Platform's working set manager had the Java project stored but somehow it got closed in-between. Under normal circumstances a closed project is an IProject in the working set manager. |