Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 64887 - Browsing perspective doesn't deal with closed projects [browsing]
Summary: Browsing perspective doesn't deal with closed projects [browsing]
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 65943
Blocks:
  Show dependency tree
 
Reported: 2004-06-01 05:56 EDT by Dirk Baeumer CLA
Modified: 2004-07-06 09:35 EDT (History)
1 user (show)

See Also:


Attachments
Proposed patch (3.67 KB, patch)
2004-06-04 04:36 EDT, Jerome Lanneluc CLA
no flags Details | Diff
Updated tests (1.83 KB, patch)
2004-06-04 04:37 EDT, Jerome Lanneluc CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Baeumer CLA 2004-06-01 05:56:53 EDT
RC2

- two windows, one as browsing perspective
- drill into a project in browsing perspective (down to members view)
- close project.

observe: the browsing perspective shows stale information.
Comment 1 Dirk Baeumer CLA 2004-06-01 05:57:06 EDT
RC2 candidate
Comment 2 Dirk Baeumer CLA 2004-06-01 05:57:23 EDT
Happens on RC1
Comment 3 Dirk Baeumer CLA 2004-06-03 09:19:13 EDT
Dani, can you please assess if we should do something for RC2. Was this a 
problem in 2.1.* ?
Comment 4 Dani Megert CLA 2004-06-03 12:27:36 EDT
Not a regression - did not work in 2.x. either.
JDT UI tests the delta for open/closed flags:
	if (elementType == IJavaElement.JAVA_PROJECT) {
		// handle open and closing of a project
		if ((flags & (IJavaElementDelta.F_CLOSED | IJavaElementDelta.F_OPENED)) != 0) {			
			postRefresh(element);
			return;

which is not sent. What's sent is:
Java Model[*]: {CHILDREN | CONTENT}
   Test[-]: {}
   ResourceDelta(/Test)[*]

where Test is the closed project.

Note: the same problem arises if you only have on window and close the project
from another view e.g. the Package Explorer
Comment 5 Jerome Lanneluc CLA 2004-06-03 13:21:11 EDT
Note that the F_CLOSED and F_OPENED were not set in 2.0 either. Only in 1.0 
were they set.
Comment 6 Philipe Mulet CLA 2004-06-03 15:48:04 EDT
Pls investigate if actually our bug or lack of consistency in UI. What 
surprises me is that the package explorer seems happy.
Comment 7 Philipe Mulet CLA 2004-06-03 15:49:09 EDT
Comment #5 seems to imply this is a UI bug.
Comment 8 Jerome Lanneluc CLA 2004-06-03 17:07:30 EDT
Yes this is a UI bug, but UI would fix it easily if we had the F_CLOSED flag 
set.
Comment 9 Jerome Lanneluc CLA 2004-06-04 04:36:26 EDT
Created attachment 11580 [details]
Proposed patch

Changed DeltaProcessor to create a CHANGED delta with F_CLOSED/F_OPENED flag
set if the project is closed/opened. Changed TypeHierarchy delta processing to
handle this flag.
Comment 10 Jerome Lanneluc CLA 2004-06-04 04:37:31 EDT
Created attachment 11581 [details]
Updated tests

Changed JavaElementDeltaTests and JavaProjectTests to reflect this change.
Comment 11 Jerome Lanneluc CLA 2004-06-04 04:45:05 EDT
Dani, even with this patch the Java Browsing perspective is still showing 
stale information. You can reproduce the problem if you delete the project 
instead of closing it.
Comment 12 Dani Megert CLA 2004-06-04 04:58:09 EDT
Please file a separate bug if you can reproduce this.

re comment 7: I cannot see how comment 5 would imply an UI bug - can you explain
(UI has the code which deals with the open/close flags in-place hence it would
work if Core sent the expected delta)

Note: The reason why the Package Explorer works is pure luck: if there are more
than 1 resource delta included in the JMDelta it refreshes the parent, in this
case the Java Model itself. If this optimization gets changed in the future the
Package Explorer would suffer the same problem.
Comment 13 Jerome Lanneluc CLA 2004-06-04 05:24:32 EDT
See bug 65686. Looks like a UI bug :-)
Comment 14 Jerome Lanneluc CLA 2004-06-07 07:22:56 EDT
Entered bug 65943 against JDT Core to fix the delta problem. Moving back to 
JDT UI as even with the fix for bug 65943, the original problem is still there.

Note it looks like a dup of bug 65686, but according to Dani they are 2 
different bugs.
Comment 15 Dani Megert CLA 2004-06-07 07:28:31 EDT
Removing target milestone. Will add back in case J Core fixes the dependent bug.
Comment 16 Dani Megert CLA 2004-06-08 03:51:53 EDT
Will be reopened once bug 65943 has been fixed.
Comment 17 Dani Megert CLA 2004-07-06 09:29:35 EDT
.
Comment 18 Dani Megert CLA 2004-07-06 09:35:34 EDT
verified that this bug is fixed.