Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 364443

Summary: JavaNavigatorContentProvider adds folders previously filtered out by other contenproviders
Product: [Eclipse Project] Platform Reporter: Heiko Böttger <heiko.boettger>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, francisu
Version: 3.6.2   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard: stalebug
Attachments:
Description Flags
Example demonstrating the problem. none

Description Heiko Böttger CLA 2011-11-22 03:30:15 EST
Build Identifier: 20110218-0911

We wrote our own contentprovider replacing all subfolders in our src-folders by packages. This is nearly the same what JDT does. However if out contentprovider is executed before the JDT-Contentprovider the folders are readded. The reason for this is, that the getChildren-Method returns the folders. 

The solution for this is either setting the appearsBefore-property to the jdt-contentprovider id or setting a higher priority. This seems more like a hack, because we cannot know every contentprovider and the priority is limited to highest. I think the JDT ContentProvider should be changed to never add folders in the getPipedlinedChildren-Method.


Reproducible: Always

Steps to Reproduce:
1. Create and register a new NavigationContentProvider
2. Remove some folders in the getPipedlineChildren-Method
3. Make sure the new ContentProvider is queried before the JDTContentProvider
  (see NavigatorContentServiceContentProvider#pipelineChildren, lower priority should enforce this)
Comment 1 Dani Megert CLA 2011-11-22 05:37:56 EST
Are you saying that you try to alter the way (Java source) folders and packages are shown inside a Java project?

Can you attach a test plug-in?
Comment 2 Heiko Böttger CLA 2011-11-22 16:18:44 EST
No, I don't trie to overwrite the result of jdt-directly. Our contentprovider overrides the resource-contentprovider as jdt did. From my understanding the contentprovider should modify the pipelinedchildrens by replacing/moving item the element in the give set. 

For better understanding I added a plugin, replacing all folders starting with "replace" by a MyData-Object. I also provide 3 different plugin.xml configurations. I expect that there shouldn't be a difference between all settings. 

What I found out is, that if MyData is adaptable to IResource than jdt won´t readd the replaced folders. However this only works if there is a replacement at the same location.
Comment 3 Heiko Böttger CLA 2011-11-22 16:19:56 EST
Created attachment 207389 [details]
Example demonstrating the problem.
Comment 4 Dani Megert CLA 2012-02-21 04:52:21 EST
Hard problem and one could say it works as designed: You only override the resource content provider but the JDT content provider still correctly serves its resources since it is not overridden. The same problem also arises the other way around i.e. if you'd override the JDT content, you would get the resource back by the resource content provider.

You could try to suppress both. In this case you have to make sure that you don't replace twice ;-).


Moving to Platform UI to comment whether the current behavior is as designed.

Francis, maybe you have time to look into it?
Comment 5 Lars Vogel CLA 2019-11-14 03:19:57 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.