Bug 528719 - Replace usage of IWorkspaceRunnable with ICoreRunnable
diff --git a/org.eclipse.handly.examples.basic.ui.tests/src/org/eclipse/handly/internal/examples/basic/ui/model/FooWorkingCopyNotificationTest.java b/org.eclipse.handly.examples.basic.ui.tests/src/org/eclipse/handly/internal/examples/basic/ui/model/FooWorkingCopyNotificationTest.java
index c4d08c5..86f2a24 100644
--- a/org.eclipse.handly.examples.basic.ui.tests/src/org/eclipse/handly/internal/examples/basic/ui/model/FooWorkingCopyNotificationTest.java
+++ b/org.eclipse.handly.examples.basic.ui.tests/src/org/eclipse/handly/internal/examples/basic/ui/model/FooWorkingCopyNotificationTest.java
@@ -16,8 +16,8 @@
import static org.eclipse.handly.model.IElementDeltaConstants.F_UNDERLYING_RESOURCE;
import static org.eclipse.handly.model.IElementDeltaConstants.F_WORKING_COPY;
-import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ICoreRunnable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.handly.buffer.BufferChange;
import org.eclipse.handly.buffer.IBuffer;
@@ -66,7 +66,7 @@
public void test1() throws Exception
{
- doWithWorkingCopy(new IWorkspaceRunnable()
+ doWithWorkingCopy(new ICoreRunnable()
{
@Override
public void run(IProgressMonitor monitor) throws CoreException
@@ -89,7 +89,7 @@
public void test2() throws Exception
{
- doWithWorkingCopy(new IWorkspaceRunnable()
+ doWithWorkingCopy(new ICoreRunnable()
{
@Override
public void run(IProgressMonitor monitor) throws CoreException
@@ -126,7 +126,7 @@
public void test3() throws Exception
{
- doWithWorkingCopy(new IWorkspaceRunnable()
+ doWithWorkingCopy(new ICoreRunnable()
{
@Override
public void run(IProgressMonitor monitor) throws CoreException
@@ -187,7 +187,7 @@
public void test4() throws Exception
{
- doWithWorkingCopy(new IWorkspaceRunnable()
+ doWithWorkingCopy(new ICoreRunnable()
{
@Override
public void run(IProgressMonitor monitor) throws CoreException
@@ -221,8 +221,7 @@
});
}
- private void doWithWorkingCopy(IWorkspaceRunnable runnable)
- throws CoreException
+ private void doWithWorkingCopy(ICoreRunnable runnable) throws CoreException
{
workingCopy.becomeWorkingCopy_(EMPTY_CONTEXT, null);
try
diff --git a/org.eclipse.handly.examples.basic.ui.tests/src/org/eclipse/handly/internal/examples/basic/ui/model/FooWorkingCopyTest.java b/org.eclipse.handly.examples.basic.ui.tests/src/org/eclipse/handly/internal/examples/basic/ui/model/FooWorkingCopyTest.java
index 1566519..45b5088 100644
--- a/org.eclipse.handly.examples.basic.ui.tests/src/org/eclipse/handly/internal/examples/basic/ui/model/FooWorkingCopyTest.java
+++ b/org.eclipse.handly.examples.basic.ui.tests/src/org/eclipse/handly/internal/examples/basic/ui/model/FooWorkingCopyTest.java
@@ -13,8 +13,8 @@
import static org.eclipse.handly.context.Contexts.EMPTY_CONTEXT;
import static org.eclipse.handly.context.Contexts.of;
-import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ICoreRunnable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.handly.buffer.Buffer;
import org.eclipse.handly.buffer.BufferChange;
@@ -52,7 +52,7 @@
public void test1() throws Exception
{
- doWithWorkingCopy(EMPTY_CONTEXT, new IWorkspaceRunnable()
+ doWithWorkingCopy(EMPTY_CONTEXT, new ICoreRunnable()
{
@Override
public void run(IProgressMonitor monitor) throws CoreException
@@ -89,7 +89,7 @@
public void test2() throws Exception
{
- doWithWorkingCopy(EMPTY_CONTEXT, new IWorkspaceRunnable()
+ doWithWorkingCopy(EMPTY_CONTEXT, new ICoreRunnable()
{
@Override
public void run(IProgressMonitor monitor) throws CoreException
@@ -159,7 +159,7 @@
"var x; var y; def f() {} def f(x) {} def f(x, y) {}"))
{
doWithWorkingCopy(of(ISourceFileImplExtension.WORKING_COPY_BUFFER,
- buffer), new IWorkspaceRunnable()
+ buffer), new ICoreRunnable()
{
@Override
public void run(IProgressMonitor monitor)
@@ -180,7 +180,7 @@
public void testBug480397_2() throws Exception
{
// working copy cannot be closed
- doWithWorkingCopy(EMPTY_CONTEXT, new IWorkspaceRunnable()
+ doWithWorkingCopy(EMPTY_CONTEXT, new ICoreRunnable()
{
@Override
public void run(IProgressMonitor monitor) throws CoreException
@@ -199,7 +199,7 @@
public void testBug480397_3() throws Exception
{
// attempting to close a non-openable element
- IWorkspaceRunnable testRunnable = new IWorkspaceRunnable()
+ ICoreRunnable testRunnable = new ICoreRunnable()
{
@Override
public void run(IProgressMonitor monitor) throws CoreException
@@ -216,8 +216,8 @@
testRunnable.run(null);
}
- private void doWithWorkingCopy(IContext context,
- IWorkspaceRunnable runnable) throws CoreException
+ private void doWithWorkingCopy(IContext context, ICoreRunnable runnable)
+ throws CoreException
{
workingCopy.becomeWorkingCopy_(context, null);
try
diff --git a/org.eclipse.handly.examples.basic.ui/src/org/eclipse/handly/internal/examples/basic/ui/model/FooProject.java b/org.eclipse.handly.examples.basic.ui/src/org/eclipse/handly/internal/examples/basic/ui/model/FooProject.java
index c65081a..9ccebfc 100644
--- a/org.eclipse.handly.examples.basic.ui/src/org/eclipse/handly/internal/examples/basic/ui/model/FooProject.java
+++ b/org.eclipse.handly.examples.basic.ui/src/org/eclipse/handly/internal/examples/basic/ui/model/FooProject.java
@@ -19,8 +19,8 @@
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ICoreRunnable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.handly.context.IContext;
@@ -66,7 +66,7 @@
throws CoreException
{
IWorkspace workspace = getParent().getWorkspace();
- workspace.run(new IWorkspaceRunnable()
+ workspace.run(new ICoreRunnable()
{
@Override
public void run(IProgressMonitor monitor) throws CoreException
diff --git a/org.eclipse.handly.examples.jmodel.tests/src/org/eclipse/handly/internal/examples/jmodel/JavaProjectNotificationTest.java b/org.eclipse.handly.examples.jmodel.tests/src/org/eclipse/handly/internal/examples/jmodel/JavaProjectNotificationTest.java
index 805de6e..4c31427 100644
--- a/org.eclipse.handly.examples.jmodel.tests/src/org/eclipse/handly/internal/examples/jmodel/JavaProjectNotificationTest.java
+++ b/org.eclipse.handly.examples.jmodel.tests/src/org/eclipse/handly/internal/examples/jmodel/JavaProjectNotificationTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015 1C-Soft LLC.
+ * Copyright (c) 2015, 2017 1C-Soft LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,8 +13,8 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ICoreRunnable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.handly.examples.jmodel.IJavaModel;
@@ -113,7 +113,7 @@
public void test003() throws Exception
{
// remove src-gen from classpath and delete the underlying folder
- javaModel.getWorkspace().run(new IWorkspaceRunnable()
+ javaModel.getWorkspace().run(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
@@ -151,7 +151,7 @@
public void test005() throws Exception
{
// rename src to src2
- javaModel.getWorkspace().run(new IWorkspaceRunnable()
+ javaModel.getWorkspace().run(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
diff --git a/org.eclipse.handly.examples.jmodel.tests/src/org/eclipse/handly/internal/examples/jmodel/PackageFragmentNotificationTest.java b/org.eclipse.handly.examples.jmodel.tests/src/org/eclipse/handly/internal/examples/jmodel/PackageFragmentNotificationTest.java
index ea5b596..7c40b5d 100644
--- a/org.eclipse.handly.examples.jmodel.tests/src/org/eclipse/handly/internal/examples/jmodel/PackageFragmentNotificationTest.java
+++ b/org.eclipse.handly.examples.jmodel.tests/src/org/eclipse/handly/internal/examples/jmodel/PackageFragmentNotificationTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015 1C-Soft LLC.
+ * Copyright (c) 2015, 2017 1C-Soft LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,8 +15,8 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ICoreRunnable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.handly.examples.jmodel.IJavaModel;
@@ -88,7 +88,7 @@
public void test002() throws Exception
{
// delete META-INF and abc
- javaModel.getWorkspace().run(new IWorkspaceRunnable()
+ javaModel.getWorkspace().run(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
@@ -109,7 +109,7 @@
//@formatter:on
// (re-)create META-INF and abc
- javaModel.getWorkspace().run(new IWorkspaceRunnable()
+ javaModel.getWorkspace().run(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
@@ -169,7 +169,7 @@
public void test005() throws Exception
{
// move META-INF, abc and A.java
- javaModel.getWorkspace().run(new IWorkspaceRunnable()
+ javaModel.getWorkspace().run(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
diff --git a/org.eclipse.handly.examples.jmodel.tests/src/org/eclipse/handly/internal/examples/jmodel/PackageFragmentRootNotificationTest.java b/org.eclipse.handly.examples.jmodel.tests/src/org/eclipse/handly/internal/examples/jmodel/PackageFragmentRootNotificationTest.java
index ef0b143..1141c91 100644
--- a/org.eclipse.handly.examples.jmodel.tests/src/org/eclipse/handly/internal/examples/jmodel/PackageFragmentRootNotificationTest.java
+++ b/org.eclipse.handly.examples.jmodel.tests/src/org/eclipse/handly/internal/examples/jmodel/PackageFragmentRootNotificationTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015 1C-Soft LLC.
+ * Copyright (c) 2015, 2017 1C-Soft LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,8 +15,8 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ICoreRunnable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.handly.examples.jmodel.IJavaModel;
@@ -87,7 +87,7 @@
public void test002() throws Exception
{
// delete META-INF and abc
- javaModel.getWorkspace().run(new IWorkspaceRunnable()
+ javaModel.getWorkspace().run(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
@@ -107,7 +107,7 @@
//@formatter:on
// (re-)create META-INF and abc
- javaModel.getWorkspace().run(new IWorkspaceRunnable()
+ javaModel.getWorkspace().run(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
@@ -181,7 +181,7 @@
public void test005() throws Exception
{
// move META-INF, abc and A.java
- javaModel.getWorkspace().run(new IWorkspaceRunnable()
+ javaModel.getWorkspace().run(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
diff --git a/org.eclipse.handly.examples.jmodel.tests/src/org/eclipse/handly/internal/examples/jmodel/WorkingCopyNotificationTest.java b/org.eclipse.handly.examples.jmodel.tests/src/org/eclipse/handly/internal/examples/jmodel/WorkingCopyNotificationTest.java
index bd96dc0..6f4475b 100644
--- a/org.eclipse.handly.examples.jmodel.tests/src/org/eclipse/handly/internal/examples/jmodel/WorkingCopyNotificationTest.java
+++ b/org.eclipse.handly.examples.jmodel.tests/src/org/eclipse/handly/internal/examples/jmodel/WorkingCopyNotificationTest.java
@@ -13,8 +13,8 @@
import static org.eclipse.handly.context.Contexts.EMPTY_CONTEXT;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ICoreRunnable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.handly.buffer.BufferChange;
@@ -60,7 +60,7 @@
public void test001() throws Exception
{
- doWithWorkingCopy(new IWorkspaceRunnable()
+ doWithWorkingCopy(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
@@ -100,7 +100,7 @@
public void test002() throws Exception
{
- doWithWorkingCopy(new IWorkspaceRunnable()
+ doWithWorkingCopy(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
@@ -134,7 +134,7 @@
public void test003() throws Exception
{
- doWithWorkingCopy(new IWorkspaceRunnable()
+ doWithWorkingCopy(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
@@ -189,7 +189,7 @@
public void test004() throws Exception
{
- doWithWorkingCopy(new IWorkspaceRunnable()
+ doWithWorkingCopy(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
@@ -224,7 +224,7 @@
public void test005() throws Exception
{
- doWithWorkingCopy(new IWorkspaceRunnable()
+ doWithWorkingCopy(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
@@ -258,7 +258,7 @@
public void test006() throws Exception
{
- doWithWorkingCopy(new IWorkspaceRunnable()
+ doWithWorkingCopy(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
@@ -283,7 +283,7 @@
public void test007() throws Exception
{
- doWithWorkingCopy(new IWorkspaceRunnable()
+ doWithWorkingCopy(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
@@ -296,8 +296,7 @@
});
}
- private void doWithWorkingCopy(IWorkspaceRunnable runnable)
- throws CoreException
+ private void doWithWorkingCopy(ICoreRunnable runnable) throws CoreException
{
workingCopy.becomeWorkingCopy_(EMPTY_CONTEXT, null);
try
diff --git a/org.eclipse.handly.examples.jmodel.tests/src/org/eclipse/handly/internal/examples/jmodel/WorkingCopyTest.java b/org.eclipse.handly.examples.jmodel.tests/src/org/eclipse/handly/internal/examples/jmodel/WorkingCopyTest.java
index f58ecfd..833c730 100644
--- a/org.eclipse.handly.examples.jmodel.tests/src/org/eclipse/handly/internal/examples/jmodel/WorkingCopyTest.java
+++ b/org.eclipse.handly.examples.jmodel.tests/src/org/eclipse/handly/internal/examples/jmodel/WorkingCopyTest.java
@@ -16,8 +16,8 @@
import java.util.List;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ICoreRunnable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.handly.buffer.BufferChange;
@@ -68,7 +68,7 @@
public void test001() throws Exception
{
- doWithWorkingCopy(new IWorkspaceRunnable()
+ doWithWorkingCopy(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
@@ -104,7 +104,7 @@
public void test002() throws Exception
{
- doWithWorkingCopy(new IWorkspaceRunnable()
+ doWithWorkingCopy(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
@@ -156,7 +156,7 @@
public void test003() throws Exception
{
- doWithWorkingCopy(new IWorkspaceRunnable()
+ doWithWorkingCopy(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
@@ -193,7 +193,7 @@
public void test004() throws Exception
{
- doWithWorkingCopy(new IWorkspaceRunnable()
+ doWithWorkingCopy(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
@@ -206,7 +206,7 @@
public void test005() throws Exception
{
- doWithWorkingCopy(new IWorkspaceRunnable()
+ doWithWorkingCopy(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
@@ -220,7 +220,7 @@
public void test006() throws Exception
{
- doWithWorkingCopy(new IWorkspaceRunnable()
+ doWithWorkingCopy(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
@@ -234,7 +234,7 @@
public void test007() throws Exception
{
- doWithWorkingCopy(new IWorkspaceRunnable()
+ doWithWorkingCopy(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
@@ -263,7 +263,7 @@
public void test008() throws Exception
{
- doWithWorkingCopy(new IWorkspaceRunnable()
+ doWithWorkingCopy(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
@@ -295,7 +295,7 @@
public void test009() throws Exception
{
- doWithWorkingCopy(new IWorkspaceRunnable()
+ doWithWorkingCopy(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
@@ -308,7 +308,7 @@
public void test010() throws Exception
{
- doWithWorkingCopy(new IWorkspaceRunnable()
+ doWithWorkingCopy(new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{
@@ -324,7 +324,7 @@
{
doWithWorkingCopy(privateCopy, of(
ISourceFileImplExtension.WORKING_COPY_BUFFER,
- privateBuffer), new IWorkspaceRunnable()
+ privateBuffer), new ICoreRunnable()
{
public void run(IProgressMonitor monitor)
throws CoreException
@@ -367,15 +367,14 @@
});
}
- private void doWithWorkingCopy(IWorkspaceRunnable runnable)
- throws CoreException
+ private void doWithWorkingCopy(ICoreRunnable runnable) throws CoreException
{
doWithWorkingCopy(workingCopy, of(IProblemRequestor.class,
problemRequestor), runnable);
}
private static void doWithWorkingCopy(CompilationUnit cu, IContext context,
- IWorkspaceRunnable runnable) throws CoreException
+ ICoreRunnable runnable) throws CoreException
{
cu.becomeWorkingCopy_(context, null);
try
diff --git a/org.eclipse.handly.junit/src/org/eclipse/handly/junit/WorkspaceTestCase.java b/org.eclipse.handly.junit/src/org/eclipse/handly/junit/WorkspaceTestCase.java
index 769daec..d75cae3 100644
--- a/org.eclipse.handly.junit/src/org/eclipse/handly/junit/WorkspaceTestCase.java
+++ b/org.eclipse.handly.junit/src/org/eclipse/handly/junit/WorkspaceTestCase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2014 1C LLC.
+ * Copyright (c) 2014, 2017 1C-Soft LLC and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,22 +18,22 @@
import java.net.URL;
import java.nio.channels.FileChannel;
-import junit.framework.TestCase;
-
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceDescription;
import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.ICoreRunnable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.jobs.Job;
+import junit.framework.TestCase;
+
/**
* A workspace test case.
* <p>
@@ -157,8 +157,8 @@
copy(source, target);
// create the project
- final IProject project = getProject(name);
- IWorkspaceRunnable runnable = new IWorkspaceRunnable()
+ IProject project = getProject(name);
+ ICoreRunnable runnable = new ICoreRunnable()
{
public void run(IProgressMonitor monitor) throws CoreException
{