Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2021-11-24 20:27:28 +0000
committerLars Vogel2021-12-09 10:29:52 +0000
commiteafac3d983f1ac22cd03c6fcfd3ffcc597759cd5 (patch)
treeb491a96d14226e4a2f8c39de1a85a7ec4dc08643
parentf44354ef8ba9f104a56dbc90ea6f55b220c3d3b7 (diff)
downloadeclipse.pde.ui-eafac3d983f1ac22cd03c6fcfd3ffcc597759cd5.tar.gz
eclipse.pde.ui-eafac3d983f1ac22cd03c6fcfd3ffcc597759cd5.tar.xz
eclipse.pde.ui-eafac3d983f1ac22cd03c6fcfd3ffcc597759cd5.zip
Bug 577275 - Opened Spy destroys Eclipse workbench state on next startupI20211209-1800
The spy part descriptors are marked as not to be persisted. If the user opens this part as part via the show view menu, the generated placeholder does not get the persistState flag and gets persisted. As the part descriptor is removed, this reference is not valid and causes the workbench model to be invalid and hence the state of the workbench is restore. This change persists also the part descriptor so that the reference remains valid. Change-Id: I219f9c5f5e739b760aada4c7cd15428649f1b2aa Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com> Reviewed-on: https://git.eclipse.org/r/c/pde/eclipse.pde.ui/+/188092 Tested-by: PDE Bot <pde-bot@eclipse.org>
-rw-r--r--ui/org.eclipse.pde.spy.core/src/org/eclipse/pde/spy/core/SpyProcessor.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/org.eclipse.pde.spy.core/src/org/eclipse/pde/spy/core/SpyProcessor.java b/ui/org.eclipse.pde.spy.core/src/org/eclipse/pde/spy/core/SpyProcessor.java
index 026f38a46d..5449e959ea 100644
--- a/ui/org.eclipse.pde.spy.core/src/org/eclipse/pde/spy/core/SpyProcessor.java
+++ b/ui/org.eclipse.pde.spy.core/src/org/eclipse/pde/spy/core/SpyProcessor.java
@@ -238,6 +238,7 @@ public class SpyProcessor {
mp.setCategory(Messages.SpyProcessor_category);
mp.setDescription(desc);
mp.setLabel(partLabel);
+ mp.getPersistedState().remove(IWorkbench.PERSIST_STATE); // see Bug 577275
String bundleId = FrameworkUtil.getBundle(spyPartClass).getSymbolicName();
mp.setContributionURI("bundleclass://" + bundleId + "/" + spyPartClass.getCanonicalName());
String contributorURI = "platform:/plugin/" + bundleId;
@@ -250,7 +251,6 @@ public class SpyProcessor {
// If descriptor not yet in descriptor list, add it now
MPartDescriptor descriptor = modelService.createModelElement(MPartDescriptor.class);
descriptor.setCategory(Messages.SpyProcessor_category);
- descriptor.getPersistedState().put(IWorkbench.PERSIST_STATE, "false");
descriptor.setElementId(partId);
descriptor.setDescription(desc);
descriptor.getTags().add("View");

Back to the top