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.core.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.core.test/src')
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/models/ModelTestCase.java17
1 files changed, 8 insertions, 9 deletions
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/models/ModelTestCase.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/models/ModelTestCase.java
index fcf0d5559..8812edb71 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/models/ModelTestCase.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/models/ModelTestCase.java
@@ -26,13 +26,12 @@ 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.resources.mapping.ResourceTraversal;
+import org.eclipse.core.runtime.Adapters;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.egit.core.AdapterUtils;
-import org.eclipse.egit.core.internal.Utils;
import org.eclipse.egit.core.op.MergeOperation;
import org.eclipse.egit.core.synchronize.GitResourceVariantTreeSubscriber;
import org.eclipse.egit.core.synchronize.GitSubscriberMergeContext;
@@ -111,7 +110,7 @@ public abstract class ModelTestCase extends GitTestCase {
.getModelProviderDescriptor(
SampleModelProvider.SAMPLE_PROVIDER_ID)
.getModelProvider();
- return Utils.getAdapter(provider, IResourceMappingMerger.class);
+ return Adapters.adapt(provider, IResourceMappingMerger.class);
}
protected IMergeContext prepareContext(Repository repository,
@@ -123,7 +122,7 @@ public abstract class ModelTestCase extends GitTestCase {
gsds);
subscriber.init(new NullProgressMonitor());
- ResourceMapping mapping = AdapterUtils.adapt(workspaceFile,
+ ResourceMapping mapping = Adapters.adapt(workspaceFile,
ResourceMapping.class);
SubscriberScopeManager manager = new SubscriberScopeManager(
subscriber.getName(), new ResourceMapping[] { mapping, },
@@ -139,16 +138,16 @@ public abstract class ModelTestCase extends GitTestCase {
protected IMergeContext prepareModelContext(Repository repository,
IFile workspaceFile, String srcRev, String dstRev) throws Exception {
- Set<IResource> includedResources = new HashSet<IResource>(
+ Set<IResource> includedResources = new HashSet<>(
Arrays.asList(workspaceFile));
- Set<IResource> newResources = new HashSet<IResource>(includedResources);
- Set<ResourceMapping> allMappings = new HashSet<ResourceMapping>();
+ Set<IResource> newResources = new HashSet<>(includedResources);
+ Set<ResourceMapping> allMappings = new HashSet<>();
ResourceMappingContext mappingContext = ResourceMappingContext.LOCAL_CONTEXT;
ModelProvider provider = ModelProvider.getModelProviderDescriptor(
SampleModelProvider.SAMPLE_PROVIDER_ID).getModelProvider();
do {
Set<IResource> copy = newResources;
- newResources = new HashSet<IResource>();
+ newResources = new HashSet<>();
for (IResource resource : copy) {
ResourceMapping[] mappings = provider.getMappings(resource,
mappingContext, new NullProgressMonitor());
@@ -183,7 +182,7 @@ public abstract class ModelTestCase extends GitTestCase {
private static Set<IResource> collectResources(ResourceMapping[] mappings,
ResourceMappingContext mappingContext) throws Exception {
- final Set<IResource> resources = new HashSet<IResource>();
+ final Set<IResource> resources = new HashSet<>();
for (ResourceMapping mapping : mappings) {
ResourceTraversal[] traversals = mapping.getTraversals(
mappingContext, new NullProgressMonitor());

Back to the top