Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 118542 - [context] open/close Java files leave interest on packages
Summary: [context] open/close Java files leave interest on packages
Status: CLOSED MOVED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: 0.4   Edit
Hardware: PC All
: P2 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 107948 129198 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-11-29 18:55 EST by Eugene Kuleshov CLA
Modified: 2009-07-24 00:28 EDT (History)
7 users (show)

See Also:


Attachments
a strongly suggested fix patch (4.03 KB, patch)
2006-03-04 11:03 EST, Wang Bin CLA
no flags Details | Diff
a strongly suggested fix patch (5.28 KB, patch)
2006-03-04 22:07 EST, Wang Bin CLA
no flags Details | Diff
a strongly suggested fix patch it should fix this bug (6.91 KB, patch)
2006-03-05 00:48 EST, Wang Bin CLA
no flags Details | Diff
Package explorer - screenshot-1 (102.03 KB, image/gif)
2007-03-03 16:04 EST, Willian Mitsuda CLA
no flags Details
Package explorer - screenshot-2 (28.60 KB, image/gif)
2007-03-03 16:05 EST, Willian Mitsuda CLA
no flags Details
Package Explorer - screenshot-3 (28.69 KB, image/gif)
2007-03-04 13:37 EST, Willian Mitsuda CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Kuleshov CLA 2005-11-29 18:55:35 EST
When you open and then close some Java files, Mylar filter on Package Explorer view leave interest on package nodes. I believe these nodes should disappear as soon as there is no interesting classes under.
Comment 1 Mik Kersten CLA 2005-11-29 20:06:26 EST
Definitely a bug.  Bug is this the same behavior as bug 118541?
Comment 2 Mik Kersten CLA 2005-11-29 23:01:19 EST
*** Bug 107948 has been marked as a duplicate of this bug. ***
Comment 3 Mik Kersten CLA 2006-02-23 13:39:52 EST
*** Bug 129198 has been marked as a duplicate of this bug. ***
Comment 4 Mik Kersten CLA 2006-02-23 13:40:59 EST
A related and equally annoying problem is that containers (folders, packages) lose interest too quickly even if they might have interesting resources in them. 
Comment 5 Wang Bin CLA 2006-03-04 01:50:18 EST
When I add below code at the last of method MylarContextManager.manipulateInterestForNode(IMylarElement element, boolean increment, boolean forceLandmark,
			String sourceId), the defect maybe can be fixed, and it need more test
			
		//update parent interesting
		String parentHandle = bridge.getParentHandle(element.getHandleIdentifier());
		IMylarElement parentElement = getElement(parentHandle);
		manipulateInterestForNode(parentElement, increment, forceLandmark, sourceId);
Comment 6 Wang Bin CLA 2006-03-04 11:03:12 EST
Created attachment 35722 [details]
a strongly suggested fix patch

It should can fix this problem. Again, I don't complete understand the meaning of propagateToParents in method handleInteractionEvent(InteractionEvent event, boolean propagateToParents). So I update the parent maunally.

In general, I strongly apply this patch and do some enhancement based on this patch. It worth us to do it. Please believe me.
Comment 7 Wang Bin CLA 2006-03-04 22:06:09 EST
Comment on attachment 35722 [details]
a strongly suggested fix patch

I forget another file.
In addition, the fix is also updated.
Comment 8 Wang Bin CLA 2006-03-04 22:07:08 EST
Created attachment 35730 [details]
a strongly suggested fix patch

Update two files.
Comment 9 Wang Bin CLA 2006-03-05 00:43:22 EST
Comment on attachment 35730 [details]
a strongly suggested fix patch

A new patch is provided
Comment 10 Wang Bin CLA 2006-03-05 00:48:22 EST
Created attachment 35732 [details]
a strongly suggested fix patch it should fix this bug

Refactor the patch to add a method needUpdateParent(IMylarElement).

I tested it and it works well. I spent much time on it and I really suggest to apply this patch.

In addition, I suggest to use two methods to handle note interest instead of manipulateInterestForNode, which are incrementInterest and decrementInterent.
Comment 11 Eugene Kuleshov CLA 2006-03-05 00:52:21 EST
Wang, it is a great efford, but it really make sense to write unit test for this issue. 

Here is an entry form Mylar's documentation for contributors:
http://www.eclipse.org/mylar/doc/devref.php#contributing-patches

----
For most patches, a failing unit test should be written first.  Before creating a new JUnit test class class check the components test suite (e.g. AllTasklistTests) for similar test cases (e.g. AllTasklistTests.suite()).
----

I am sure Mik would review your code, but it would save him some time if he would get test for this issue. And it could save time for you as well, so you won't need to submit 3 patches fixing each other in several hours.
Comment 12 Mik Kersten CLA 2006-03-06 11:53:26 EST
Thanks for you hard work on this Wang, I am raising the priority to ensure that I get to your patch this week, and because it is important that this gets fixed for 0.5.  But Eugene right, and a unit test is key for any patch of this form.  Only a slight change to the interest model can have big consequences to how it works after a context has been active for a long period of time, so you unit test(s) should document and verify every change that you've made to the model.  Please take a look at the tests in ContextManagerTest and write a similar one, then I will try to apply your patch and see if I need to extend the test coverage further.
Comment 13 Mik Kersten CLA 2006-04-06 20:48:44 EDT
The collory of this is fixed (bug 117979), so this should now be easier, but some additional model management improvements will needed to be done as part of this.
Comment 14 Eugene Kuleshov CLA 2006-07-03 09:48:12 EDT
Please consider to raise priority for this? It is been really old and quit annoying issue...
Comment 15 Mik Kersten CLA 2006-07-04 19:59:31 EDT
Yes, this is annoying and we need to improve the corresponding bookkeeping in the model (i.e. propagation of interest to parents).
Comment 16 Mik Kersten CLA 2006-09-25 17:59:06 EDT
All model changes will be made post 0.7.0.
Comment 17 Mik Kersten CLA 2006-12-04 16:22:16 EST
Deferring.
Comment 18 Willian Mitsuda CLA 2007-03-03 16:04:41 EST
Created attachment 60224 [details]
Package explorer - screenshot-1
Comment 19 Willian Mitsuda CLA 2007-03-03 16:05:02 EST
Created attachment 60225 [details]
Package explorer - screenshot-2
Comment 20 Willian Mitsuda CLA 2007-03-03 16:22:01 EST
Can you please raise the priority for this bug?

I have a high workspace, with +20 projects, not so large, but with inter-dependencies, so I touch many of them while working on a task.

The problem is that after some time working, the package explorer gets in a "bloated" state, where the focused UI begins to confuse instead of help (hey Mik, this causes a vertical scrollbar to appear!!! this is unacceptable!! ;)

I identified a lot of uninteresting elements in the previous 2 screenshots, among them, the empty packages which are the original focus of this bug.

But I also identified other elements which I don't like to be there. I don't know if they are caused by the same bug or not.

So, they are:

- rt.jar, screenshot-1 - I think this was caused by some J2SE class that lost interest, but the jar remains. There is no need to show "jars" or library containers who don't have interesting classes.
- import declarations, screenshot-1 - I remember there was some import statements with interest because I focused them on java editor, but they lost interest and the empty "import declarations" container remains.
- Java file with no class focused, last highlight from screenshot-1 - not so harmful, but quite strange.
- Binary class "DateMidnight.class", screenshot-2 - the same as above.
- Empty folder, screenshot-2 - there was a text file I was editing on this folder; after some time it lost interest, but the folder remains. Totally useless.

IHMO, regarding java elements, a container (jar, library, java file, etc.) would retain interest only if it has at least 1 java class/interface focused.
Comment 21 Mik Kersten CLA 2007-03-03 19:59:18 EST
I will try to do this for M2, but task context model changes of this sort are very involved.  But I agree that the extra nodes are unacceptable.  Scrollbars are evil ;)
Comment 22 Willian Mitsuda CLA 2007-03-04 13:37:23 EST
Created attachment 60228 [details]
Package Explorer - screenshot-3

Another one I caught today: it left a interest on org.eclipse.mylar.bugzilla.tests project, but IMHO it does not help me very much.

The funny is that I don't even remember having touched or navigated on anything in org.eclipse.mylar.bugzilla.tests project while working on this task.
Comment 23 Willian Mitsuda CLA 2007-03-04 13:45:43 EST
About the second highlight on screenshot-3: I know why it raised a interest on org.eclipse.jface.layout: I opened some layout classes (GridData, GridDataFactory, GridLayout) because I was working on a patch for task editor, but I didn't remember some methods and wanted to see their javadoc. I opened them several times and I'd like to Mylar automatically recognize them as something important/recurrent to this task, and don't let them lose interest so quickly.

In another words: if I'm working on a GUI-related task and often navigate through layout APIs, it is natural to have Mylar recognize them as something important.
Comment 24 Mik Kersten CLA 2007-05-02 21:16:43 EDT
Moving to RC1 due to API and Tasks UI focus on 2.0M3.
Comment 25 Mik Kersten CLA 2007-06-20 01:16:07 EDT
Any context model changes unfortunately have to get postponed until after 2.0.  I would really like to fix this but it will involve a fundamental change in how we do the bookkeeping of interest propagation to parents and handling of decay.
Comment 26 Mik Kersten CLA 2007-11-06 19:43:48 EST
This has been considerably improved and most of the underlying problem (bug 207225) has been addressed.  Will keep the bug open while we monitor the effects on longer running task contexts. 
Comment 27 Mik Kersten CLA 2008-06-12 16:14:48 EDT
There's not clear solution to this without doing some major changes in the bookkeeping of the context model.  Scheduling for exploration in 3.1.  
Comment 28 Eclipse Webmaster CLA 2022-11-15 11:45:08 EST
Mylyn has been restructured, and our issue tracking has moved to GitHub [1].

We are closing ~14K Bugzilla issues to give the new team a fresh start. If you feel that this issue is still relevant, please create a new one on GitHub.

[1] https://github.com/orgs/eclipse-mylyn