diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/packageview/WorkingSetDropAdapterTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/packageview/WorkingSetDropAdapterTest.java index a7717ff82a4..dc89651d719 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/packageview/WorkingSetDropAdapterTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/packageview/WorkingSetDropAdapterTest.java @@ -28,6 +28,8 @@ import org.eclipse.swt.dnd.DND; import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.ILogListener; +import org.eclipse.core.runtime.Platform; import org.eclipse.core.resources.IFolder; @@ -60,10 +62,11 @@ public class WorkingSetDropAdapterTest { private PackageExplorerPart fPackageExplorer; private Accessor fPackageExplorerPartAccessor; private WorkingSetDropAdapter fAdapter; - + private ILogListener expectNoLogging= (status, plugin) -> {throw new AssertionError(status.getMessage(), status.getException());}; @BeforeEach public void setUp() throws Exception { + Platform.addLogListener(expectNoLogging); fProject= JavaProjectHelper.createJavaProject("Test", "bin"); IWorkbenchPage activePage= PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); fPackageExplorer= (PackageExplorerPart)activePage.showView(JavaUI.ID_PACKAGES); @@ -77,6 +80,7 @@ public void tearDown() throws Exception { IWorkbenchPage activePage= PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); activePage.hideView(fPackageExplorer); assertTrue(fPackageExplorer.getTreeViewer().getTree().isDisposed()); + Platform.removeLogListener(expectNoLogging); } @Test diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/workingsets/WorkingSetModel.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/workingsets/WorkingSetModel.java index dc6f1eb439c..2737bcc1965 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/workingsets/WorkingSetModel.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/workingsets/WorkingSetModel.java @@ -449,7 +449,9 @@ public void setWorkingSets(IWorkingSet[] allWorkingSets, boolean isSortingEnable * @param workingSets the active working sets to be set */ public void setActiveWorkingSets(IWorkingSet[] workingSets) { + List backup= fAllWorkingSets; // modified by getAllWorkingSets, see gh#1863: Assert.isLegal(Arrays.asList(getAllWorkingSets()).containsAll(Arrays.asList(workingSets))); + fAllWorkingSets= backup; if (fIsSortingEnabled) { Arrays.sort(workingSets, new WorkingSetComparator(true)); }