Skip to content

Commit

Permalink
mac: Random failing CopyMoveElementsTests.testCopyFieldForce
Browse files Browse the repository at this point in the history
  • Loading branch information
stephan-herrmann committed Jun 23, 2024
1 parent a62c379 commit f78489e
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 f78489e

Please sign in to comment.