Skip to content

Commit

Permalink
mac: Random failing CopyMoveElementsTests.testCopyFieldForce (#2629)
Browse files Browse the repository at this point in the history
fixes #2552
  • Loading branch information
stephan-herrmann committed Jun 24, 2024
1 parent 61ab97e commit 92c4a1d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.core.*;
Expand Down Expand Up @@ -58,7 +59,7 @@ public void copyNegative(IJavaElement[] elements, IJavaElement[] destinations, I
* and forcing. The operation should succeed, so any exceptions
* encountered are thrown.
*/
public IJavaElement copyPositive(IJavaElement element, IJavaElement container, IJavaElement sibling, String rename, boolean force) throws JavaModelException {
public IJavaElement copyPositive(IJavaElement element, IJavaElement container, IJavaElement sibling, String rename, boolean force) throws CoreException {
// if forcing, ensure that a name collision exists
if (force) {
IJavaElement collision = generateHandle(element, rename, container);
Expand All @@ -75,6 +76,7 @@ public IJavaElement copyPositive(IJavaElement element, IJavaElement container, I
// ensure the original element still exists
assertTrue("The original element must still exist", element.exists());

element.getJavaProject().getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
waitForAutoBuild();

// generate the new element handle
Expand Down

0 comments on commit 92c4a1d

Please sign in to comment.