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

Bug 578990

Summary: PDE do not react to changes in org.eclipse.pde.core.prefs for BUNDLE_ROOT_PATH
Product: [Eclipse Project] PDE Reporter: Christoph Laeubrich <laeubi>
Component: UIAssignee: PDE-UI-Inbox <pde-ui-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: wellmann.hannes1
Version: 4.23   
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/c/pde/eclipse.pde.ui/+/191246
https://git.eclipse.org/r/c/pde/eclipse.pde.ui/+/192077
https://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=fb5ad5bf72c88c5f7bf6076abadbc5e488e897be
https://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=15d4491246a0bc3eb19f874a4cd2774a1bdc2269
Whiteboard:

Description Christoph Laeubrich CLA 2022-02-26 01:21:39 EST
Steps to reproduce

1) create a new bundle project and name it "bundleroot"
2) in the view "Target Platform state" you will see the bundle "bundleroot"
3) create a new folder "test" in the project and move the META-INF folder there
4) "Target Platform state" you will no no longer see the bundle "bundleroot"
5) create a file 'org.eclipse.pde.core.prefs' in .settings with the following content:

BUNDLE_ROOT_PATH=test
eclipse.preferences.version=1

6) nothing will change in the target platform state
7) restart eclipse --> You will see the bundle again in the "Target Platform state"
8) delete the 'BUNDLE_ROOT_PATH=test' line --> bundle will still be shown in "Target Platform state"
Comment 1 Christoph Laeubrich CLA 2022-02-26 01:23:36 EST
@Hannes do you like to take a look? I'm not sure if this is too late for this release, but it produces hard to understand error when using m2e+felix bundle plugin because one needs to restart eclipse sometimes to get a bundle recognized.

Once PDE got track of the changed location, everything works smoothly ...
Comment 2 Hannes Wellmann CLA 2022-02-26 18:58:14 EST
The problem here is that the WorkspacePluginModelManager does not react to changes in the .settings/org.eclipse.pde.core.prefs file at the moment.

Besides that I noticed (a while ago already) that changes in a MANIFEST generated by Felix are also not recognised by the WorkspacePluginModelManager, because in its super-class WorkspaceModelManager the method visit(IResourceDelta) ignores derived resources. In this case of the Manifest this is fatal for obvious reasons. I'm think about if the check for the derived flag can be removed from the WorkspaceModelManager.visit() method.
That check was added for Bug 205888 but I think with the current implementation there would not really be a performance regression if derived resources would also be considered because they are only entered if they are 'interesting', which is only the case if the bundle-root is there (WorkspaceFeatureModelManager is generally not interested in sub-folders and WorkspaceProductModelManager can specify that is only interested in non-derived resources).

However I'm about to submit a patch where it is only handled in WorkspacePluginModelManager for now.


The patch should handle the original issue and the one just described.
Nevertheless I would like to make myself more familiar with the code to gain more confidence about the change. Unfortunately I probably don't have more time to work on this this weekend and will be on vacation for most of the time next week. So I expect this will be too late for 2022-03, but it should be completed early in 2022-06.
Comment 3 Eclipse Genie CLA 2022-02-26 18:59:52 EST
New Gerrit change created: https://git.eclipse.org/r/c/pde/eclipse.pde.ui/+/191246
Comment 4 Eclipse Genie CLA 2022-03-20 09:53:30 EDT
New Gerrit change created: https://git.eclipse.org/r/c/pde/eclipse.pde.ui/+/192077
Comment 7 Hannes Wellmann CLA 2022-03-23 04:38:47 EDT
Christoph do you want to verify/test this with tomorrows I-build?