Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Keppler2019-05-15 08:43:30 -0400
committerMatthias Sohn2019-06-10 19:13:00 -0400
commitacbd245305eab71839b2b8dbf2cd33737112a179 (patch)
tree3730e4ac4b24aba626d6c4baa9421821e8e34578 /org.eclipse.egit.ui.test/src
parentbfe19a05dd5832e65e97d6dffab8ba96ddebe025 (diff)
downloadegit-acbd245305eab71839b2b8dbf2cd33737112a179.tar.gz
egit-acbd245305eab71839b2b8dbf2cd33737112a179.tar.xz
egit-acbd245305eab71839b2b8dbf2cd33737112a179.zip
Remove pre-Mars adapter workaround
Since our minimum target is Mars, we no longer need the previous workaround for avoiding compiler warnings around adapters. This is not a git revert, but an inline refactoring of the previously introduced method. Also inline AdapterUtils.adapt() in such a way that Adapters.adapt() is called instead. Bug:460685 Change-Id: Idbbe4853f68a9b6d1ffff1f434bdbfb9bc705a80 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.egit.ui.test/src')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/decorators/GitLightweightDecoratorTest.java4
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/selection/SelectionForViewsTest.java4
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/operations/GitScopeUtilTest.java4
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorTest.java4
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java4
5 files changed, 10 insertions, 10 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/decorators/GitLightweightDecoratorTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/decorators/GitLightweightDecoratorTest.java
index d95d9c76c..2f41bf256 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/decorators/GitLightweightDecoratorTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/decorators/GitLightweightDecoratorTest.java
@@ -25,8 +25,8 @@ import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.mapping.ResourceMapping;
+import org.eclipse.core.runtime.Adapters;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.egit.core.AdapterUtils;
import org.eclipse.egit.core.internal.indexdiff.IndexDiffData;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.UIPreferences;
@@ -226,7 +226,7 @@ public abstract class GitLightweightDecoratorTest
protected static IFile findFile(IContainer container, String name) {
IResource resource = findResource(container, name);
- return AdapterUtils.adapt(resource, IFile.class);
+ return Adapters.adapt(resource, IFile.class);
}
protected static RevCommit gitCommit(Git git) throws Exception {
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/selection/SelectionForViewsTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/selection/SelectionForViewsTest.java
index 16db98b62..28e605dd7 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/selection/SelectionForViewsTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/selection/SelectionForViewsTest.java
@@ -20,7 +20,7 @@ import static org.junit.Assert.assertTrue;
import java.io.File;
-import org.eclipse.egit.core.AdapterUtils;
+import org.eclipse.core.runtime.Adapters;
import org.eclipse.egit.core.RepositoryUtil;
import org.eclipse.egit.core.op.CloneOperation;
import org.eclipse.egit.ui.Activator;
@@ -152,7 +152,7 @@ public class SelectionForViewsTest extends GitRepositoriesViewTestBase {
Object firstElement = ((IStructuredSelection) selection)
.getFirstElement();
assertNotNull("Null in selection " + viewId, firstElement);
- Repository repo = AdapterUtils.adapt(firstElement, Repository.class);
+ Repository repo = Adapters.adapt(firstElement, Repository.class);
assertNotNull("Expected a repository " + viewId + ", but "
+ firstElement.getClass().getName()
+ " doesn't adapt to Repository", repo);
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/operations/GitScopeUtilTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/operations/GitScopeUtilTest.java
index 8c7126022..b4ddb4227 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/operations/GitScopeUtilTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/operations/GitScopeUtilTest.java
@@ -29,12 +29,12 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.resources.mapping.ModelProvider;
import org.eclipse.core.resources.mapping.ResourceMapping;
import org.eclipse.core.resources.mapping.ResourceMappingContext;
+import org.eclipse.core.runtime.Adapters;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.egit.core.Activator;
import org.eclipse.egit.core.JobFamilies;
-import org.eclipse.egit.core.internal.Utils;
import org.eclipse.egit.ui.common.LocalRepositoryTestCase;
import org.eclipse.egit.ui.internal.operations.GitScopeOperation;
import org.eclipse.egit.ui.internal.operations.GitScopeOperationFactory;
@@ -235,7 +235,7 @@ public class GitScopeUtilTest extends LocalRepositoryTestCase {
}
private ResourceMapping getMappingAdapter(IResource resource) {
- return Utils.getAdapter(resource, ResourceMapping.class);
+ return Adapters.adapt(resource, ResourceMapping.class);
}
}
}
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorTest.java
index a7b7fe3cd..d8a128a9e 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorTest.java
@@ -20,8 +20,8 @@ import static org.junit.Assert.assertTrue;
import java.io.File;
import java.util.concurrent.atomic.AtomicReference;
+import org.eclipse.core.runtime.Adapters;
import org.eclipse.egit.core.Activator;
-import org.eclipse.egit.core.internal.Utils;
import org.eclipse.egit.ui.JobFamilies;
import org.eclipse.egit.ui.common.LocalRepositoryTestCase;
import org.eclipse.egit.ui.internal.UIText;
@@ -81,7 +81,7 @@ public class CommitEditorTest extends LocalRepositoryTestCase {
assertNotNull(editorRef.get());
IEditorPart editor = editorRef.get();
assertTrue(editor instanceof CommitEditor);
- RepositoryCommit adaptedCommit = Utils.getAdapter(editor,
+ RepositoryCommit adaptedCommit = Adapters.adapt(editor,
RepositoryCommit.class);
assertNotNull(adaptedCommit);
assertEquals(commit, adaptedCommit.getRevCommit());
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java
index bee72f3e0..94c0bd1b7 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java
@@ -31,8 +31,8 @@ import java.util.List;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Adapters;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.egit.core.internal.Utils;
import org.eclipse.egit.core.project.RepositoryMapping;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.JobFamilies;
@@ -471,7 +471,7 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
IAdaptable[] elements = workingSet.getElements();
assertEquals("Wrong number of projects in working set", 1,
elements.length);
- IProject project = Utils.getAdapter(elements[0], IProject.class);
+ IProject project = Adapters.adapt(elements[0], IProject.class);
assertEquals("Wrong project in working set", projectName,
project.getName());
}

Back to the top