Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlgoubet2011-03-24 10:14:44 +0000
committerlgoubet2011-03-24 10:14:44 +0000
commita0135f09a7210b1c829bd1c90148e3e9a645eccd (patch)
tree3bc77196ad43a34b0a6a9a85960c8954c4d9d74b
parentc58672dd5a72a812d2c31e2adc86253f7928bed9 (diff)
downloadorg.eclipse.emf.compare-a0135f09a7210b1c829bd1c90148e3e9a645eccd.tar.gz
org.eclipse.emf.compare-a0135f09a7210b1c829bd1c90148e3e9a645eccd.tar.xz
org.eclipse.emf.compare-a0135f09a7210b1c829bd1c90148e3e9a645eccd.zip
Revert "Adding project for logical resource testing"
-rw-r--r--plugins/org.eclipse.emf.compare.logical/.gitignore4
-rw-r--r--plugins/org.eclipse.emf.compare.logical/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--plugins/org.eclipse.emf.compare.logical/META-INF/MANIFEST.MF12
-rw-r--r--plugins/org.eclipse.emf.compare.logical/build.properties5
-rw-r--r--plugins/org.eclipse.emf.compare.logical/plugin.xml43
-rw-r--r--plugins/org.eclipse.emf.compare.logical/src/org/eclipse/emf/compare/logical/Activator.java23
-rw-r--r--plugins/org.eclipse.emf.compare.logical/src/org/eclipse/emf/compare/logical/ContentTypePropertyTester.java55
-rw-r--r--plugins/org.eclipse.emf.compare.logical/src/org/eclipse/emf/compare/logical/EMFAdapterFactory.java29
-rw-r--r--plugins/org.eclipse.emf.compare.logical/src/org/eclipse/emf/compare/logical/EMFModelProvider.java41
-rw-r--r--plugins/org.eclipse.emf.compare.logical/src/org/eclipse/emf/compare/logical/EMFResourceMapping.java54
-rw-r--r--plugins/org.eclipse.emf.compare.match/src/org/eclipse/emf/compare/match/service/MatchService.java16
-rw-r--r--plugins/org.eclipse.emf.compare.mpatch.test/org.eclipse.emf.compare.mpatch.test.launch3
-rw-r--r--plugins/org.eclipse.emf.compare.source/.project11
-rw-r--r--plugins/org.eclipse.emf.compare/.checkstyle9
-rw-r--r--plugins/org.eclipse.emf.compare/.classpath (renamed from plugins/org.eclipse.emf.compare.logical/.classpath)14
-rw-r--r--plugins/org.eclipse.emf.compare/.project (renamed from plugins/org.eclipse.emf.compare.logical/.project)68
-rw-r--r--plugins/org.eclipse.emf.compare/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--plugins/org.eclipse.emf.compare/.settings/org.eclipse.jdt.core.prefs333
-rw-r--r--plugins/org.eclipse.emf.compare/.settings/org.eclipse.jdt.ui.prefs56
-rw-r--r--plugins/org.eclipse.emf.compare/.settings/org.eclipse.pde.api.tools.prefs150
-rw-r--r--plugins/org.eclipse.emf.compare/META-INF/MANIFEST.MF19
-rw-r--r--plugins/org.eclipse.emf.compare/TASKS55
-rwxr-xr-xplugins/org.eclipse.emf.compare/about.html106
-rwxr-xr-xplugins/org.eclipse.emf.compare/about.ini14
-rwxr-xr-xplugins/org.eclipse.emf.compare/about.mappings6
-rwxr-xr-xplugins/org.eclipse.emf.compare/about.properties27
-rw-r--r--plugins/org.eclipse.emf.compare/build.properties23
-rw-r--r--plugins/org.eclipse.emf.compare/codeStyle/API.txt5
-rwxr-xr-xplugins/org.eclipse.emf.compare/codeStyle/EMFCompareCheckstyleConfiguration.xml342
-rwxr-xr-xplugins/org.eclipse.emf.compare/codeStyle/EMFCompareCodeTemplates.xml27
-rw-r--r--plugins/org.eclipse.emf.compare/codeStyle/EMFCompareFormatter.xml264
-rwxr-xr-xplugins/org.eclipse.emf.compare/modeling32.pngbin0 -> 2414 bytes
-rw-r--r--plugins/org.eclipse.emf.compare/plugin.properties13
-rw-r--r--plugins/org.eclipse.emf.compare/psf/emf_compare.psf65
-rw-r--r--plugins/org.eclipse.emf.compare/psf/emf_compare_extssh.psf65
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompareException.java42
-rwxr-xr-xplugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompareMessages.java66
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFComparePlugin.java192
-rwxr-xr-xplugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/FactoryException.java41
-rwxr-xr-xplugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/emfcomparemessages.properties38
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/package-info.java15
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/AdapterUtils.java122
-rwxr-xr-xplugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/ClassUtils.java168
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/EFactory.java328
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/EMFCompareMap.java1254
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/EMFComparePreferenceConstants.java44
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/EclipseModelUtils.java205
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/EngineConstants.java33
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/ModelIdentifier.java98
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/ModelUtils.java454
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/package-info.java15
51 files changed, 4766 insertions, 317 deletions
diff --git a/plugins/org.eclipse.emf.compare.logical/.gitignore b/plugins/org.eclipse.emf.compare.logical/.gitignore
deleted file mode 100644
index 2db576b4a..000000000
--- a/plugins/org.eclipse.emf.compare.logical/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-bin/
-*~
-*.rej
-*.bak
diff --git a/plugins/org.eclipse.emf.compare.logical/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.compare.logical/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d985ed6cb..000000000
--- a/plugins/org.eclipse.emf.compare.logical/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-#Wed Mar 16 16:04:49 CET 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/org.eclipse.emf.compare.logical/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.logical/META-INF/MANIFEST.MF
deleted file mode 100644
index 2740060ca..000000000
--- a/plugins/org.eclipse.emf.compare.logical/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,12 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Logical Resources Mapping
-Bundle-SymbolicName: org.eclipse.emf.compare.logical;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.emf.compare.logical.Activator
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.core.resources;bundle-version="3.7.100",
- org.eclipse.emf.ecore;bundle-version="2.7.0",
- org.eclipse.core.expressions;bundle-version="3.4.200"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/plugins/org.eclipse.emf.compare.logical/build.properties b/plugins/org.eclipse.emf.compare.logical/build.properties
deleted file mode 100644
index 6f20375d6..000000000
--- a/plugins/org.eclipse.emf.compare.logical/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml
diff --git a/plugins/org.eclipse.emf.compare.logical/plugin.xml b/plugins/org.eclipse.emf.compare.logical/plugin.xml
deleted file mode 100644
index 5cb321a8e..000000000
--- a/plugins/org.eclipse.emf.compare.logical/plugin.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- id="org.eclipse.emf.compare.model.provider"
- name="EMF Compare Model Provider"
- point="org.eclipse.core.resources.modelProviders">
- <modelProvider
- class="org.eclipse.emf.compare.logical.EMFModelProvider">
- </modelProvider>
- <enablement>
- <and>
- <adapt
- type="org.eclipse.core.resources.IFile">
- </adapt>
- <or>
- <test
- property="org.eclipse.emf.compare.contentType.contentTypeId"
- value="org.eclipse.emf.compare.ui.contenttype.ModelContentType">
- </test>
- <test
- property="org.eclipse.emf.compare.contentType.contentTypeId"
- value="org.eclipse.emf.ecore">
- </test>
- <test
- property="org.eclipse.emf.compare.contentType.contentTypeId"
- value="org.eclipse.emf.ecore.xmi">
- </test>
- </or>
- </and>
- </enablement>
- </extension>
- <extension
- point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
- class="org.eclipse.emf.compare.logical.ContentTypePropertyTester"
- id="org.eclipse.emf.compare.contentTypeTester"
- namespace="org.eclipse.emf.compare.contentType"
- properties="contentTypeId"
- type="org.eclipse.core.resources.IResource">
- </propertyTester>
- </extension>
-</plugin>
diff --git a/plugins/org.eclipse.emf.compare.logical/src/org/eclipse/emf/compare/logical/Activator.java b/plugins/org.eclipse.emf.compare.logical/src/org/eclipse/emf/compare/logical/Activator.java
deleted file mode 100644
index c4ccc9521..000000000
--- a/plugins/org.eclipse.emf.compare.logical/src/org/eclipse/emf/compare/logical/Activator.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.eclipse.emf.compare.logical;
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-public class Activator implements BundleActivator {
-
- public static final String PLUGIN_ID = "org.eclipse.emf.compare.logical"; //$NON-NLS-1$
-
- private static BundleContext context;
-
- public void start(BundleContext bundleContext) throws Exception {
- Activator.context = bundleContext;
- }
-
- public void stop(BundleContext bundleContext) throws Exception {
- Activator.context = null;
- }
-
- static BundleContext getContext() {
- return context;
- }
-}
diff --git a/plugins/org.eclipse.emf.compare.logical/src/org/eclipse/emf/compare/logical/ContentTypePropertyTester.java b/plugins/org.eclipse.emf.compare.logical/src/org/eclipse/emf/compare/logical/ContentTypePropertyTester.java
deleted file mode 100644
index 3e92aa341..000000000
--- a/plugins/org.eclipse.emf.compare.logical/src/org/eclipse/emf/compare/logical/ContentTypePropertyTester.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.eclipse.emf.compare.logical;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-
-public class ContentTypePropertyTester extends PropertyTester {
- private static final String PROPERTY_CONTENT_TYPE_ID = "contentTypeId"; //$NON-NLS-1$
-
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if (receiver instanceof IFile && expectedValue instanceof String) {
- if (PROPERTY_CONTENT_TYPE_ID.equals(property)) {
- return hasContentType((IFile)receiver, (String)expectedValue);
- }
- }
- return false;
- }
-
- private boolean hasContentType(IFile resource, String contentTypeId) {
- IContentTypeManager ctManager = Platform.getContentTypeManager();
- InputStream resourceContent = null;
- IContentType[] contentTypes = null;
- try {
- resourceContent = resource.getContents();
- contentTypes = ctManager.findContentTypesFor(resourceContent, resource.getName());
- } catch (CoreException e) {
- ctManager.findContentTypesFor(resource.getName());
- } catch (IOException e) {
- ctManager.findContentTypesFor(resource.getName());
- } finally {
- if (resourceContent != null) {
- try {
- resourceContent.close();
- } catch (IOException e) {
- // would have already been catched by the outer try, leave the stream open
- }
- }
- }
-
- if (contentTypes != null) {
- for (IContentType type : contentTypes) {
- if (type.getId().equals(contentTypeId)) {
- return true;
- }
- }
- }
- return false;
- }
-}
diff --git a/plugins/org.eclipse.emf.compare.logical/src/org/eclipse/emf/compare/logical/EMFAdapterFactory.java b/plugins/org.eclipse.emf.compare.logical/src/org/eclipse/emf/compare/logical/EMFAdapterFactory.java
deleted file mode 100644
index d4dc96cfa..000000000
--- a/plugins/org.eclipse.emf.compare.logical/src/org/eclipse/emf/compare/logical/EMFAdapterFactory.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.eclipse.emf.compare.logical;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.mapping.ResourceMapping;
-import org.eclipse.core.runtime.IAdapterFactory;
-
-public class EMFAdapterFactory implements IAdapterFactory {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adapterType == ResourceMapping.class && adaptableObject instanceof IResource) {
- new EMFResourceMapping((IResource)adaptableObject);
- }
-
- return null;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- public Class[] getAdapterList() {
- return new Class[] {ResourceMapping.class,};
- }
-}
diff --git a/plugins/org.eclipse.emf.compare.logical/src/org/eclipse/emf/compare/logical/EMFModelProvider.java b/plugins/org.eclipse.emf.compare.logical/src/org/eclipse/emf/compare/logical/EMFModelProvider.java
deleted file mode 100644
index f1a0df711..000000000
--- a/plugins/org.eclipse.emf.compare.logical/src/org/eclipse/emf/compare/logical/EMFModelProvider.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.eclipse.emf.compare.logical;
-
-import org.eclipse.core.resources.IResource;
-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.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-public class EMFModelProvider extends ModelProvider {
- public static final String PROVIDER_ID = "org.eclipse.emf.compare.model.provider"; //$NON-NLS-1$
-
- public EMFModelProvider() {
- System.out.println();
- }
-
- @Override
- public ResourceMapping[] getMappings(IResource resource, ResourceMappingContext context,
- IProgressMonitor monitor) throws CoreException {
- return super.getMappings(resource, context, monitor);
- }
-
- @Override
- public ResourceMapping[] getMappings(IResource[] resources, ResourceMappingContext context,
- IProgressMonitor monitor) throws CoreException {
- return super.getMappings(resources, context, monitor);
- }
-
- @Override
- public ResourceMapping[] getMappings(ResourceTraversal[] traversals, ResourceMappingContext context,
- IProgressMonitor monitor) throws CoreException {
- return super.getMappings(traversals, context, monitor);
- }
-
- @Override
- public ResourceTraversal[] getTraversals(ResourceMapping[] mappings, ResourceMappingContext context,
- IProgressMonitor monitor) throws CoreException {
- return super.getTraversals(mappings, context, monitor);
- }
-}
diff --git a/plugins/org.eclipse.emf.compare.logical/src/org/eclipse/emf/compare/logical/EMFResourceMapping.java b/plugins/org.eclipse.emf.compare.logical/src/org/eclipse/emf/compare/logical/EMFResourceMapping.java
deleted file mode 100644
index 2beb01f64..000000000
--- a/plugins/org.eclipse.emf.compare.logical/src/org/eclipse/emf/compare/logical/EMFResourceMapping.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.eclipse.emf.compare.logical;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-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.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-public class EMFResourceMapping extends ResourceMapping {
- private final IResource resource;
-
- public EMFResourceMapping(IResource resource) {
- this.resource = resource;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.core.resources.mapping.ResourceMapping#getModelObject()
- */
- @Override
- public Object getModelObject() {
- return resource;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.core.resources.mapping.ResourceMapping#getModelProviderId()
- */
- @Override
- public String getModelProviderId() {
- return EMFModelProvider.PROVIDER_ID;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.core.resources.mapping.ResourceMapping#getProjects()
- */
- @Override
- public IProject[] getProjects() {
- return new IProject[] {resource.getProject(),};
- }
-
- @Override
- public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor)
- throws CoreException {
- return new ResourceTraversal[] {new ResourceTraversal(new IResource[] {resource,},
- IResource.DEPTH_INFINITE, IResource.NONE)};
- }
-}
diff --git a/plugins/org.eclipse.emf.compare.match/src/org/eclipse/emf/compare/match/service/MatchService.java b/plugins/org.eclipse.emf.compare.match/src/org/eclipse/emf/compare/match/service/MatchService.java
index f4e06e7aa..7be90979c 100644
--- a/plugins/org.eclipse.emf.compare.match/src/org/eclipse/emf/compare/match/service/MatchService.java
+++ b/plugins/org.eclipse.emf.compare.match/src/org/eclipse/emf/compare/match/service/MatchService.java
@@ -127,8 +127,8 @@ public final class MatchService {
*/
public static MatchModel doMatch(EObject leftRoot, EObject rightRoot, EObject ancestor,
Map<String, Object> options) throws InterruptedException {
- final IMatchEngine engine = getBestMatchEngine(leftRoot.eResource(), rightRoot.eResource(),
- ancestor.eResource());
+ final IMatchEngine engine = getBestMatchEngine(leftRoot.eResource(), rightRoot.eResource(), ancestor
+ .eResource());
final MatchModel result = engine.modelMatch(leftRoot, rightRoot, ancestor, options);
engine.reset();
return result;
@@ -241,8 +241,8 @@ public final class MatchService {
applyExternalFilter(scopeProvider);
final List<Resource> remainingLeftResources = new ArrayList<Resource>(leftResourceSet.getResources());
- final List<Resource> remainingRightResources = new ArrayList<Resource>(
- rightResourceSet.getResources());
+ final List<Resource> remainingRightResources = new ArrayList<Resource>(rightResourceSet
+ .getResources());
applyScopeFilter(leftScope, remainingLeftResources);
applyScopeFilter(rightScope, remainingRightResources);
@@ -329,10 +329,10 @@ public final class MatchService {
final IMatchScope ancestorScope = scopeProvider.getAncestorScope();
applyExternalFilter(scopeProvider);
final List<Resource> remainingLeftResources = new ArrayList<Resource>(leftResourceSet.getResources());
- final List<Resource> remainingRightResources = new ArrayList<Resource>(
- rightResourceSet.getResources());
- final List<Resource> remainingAncestorResources = new ArrayList<Resource>(
- ancestorResourceSet.getResources());
+ final List<Resource> remainingRightResources = new ArrayList<Resource>(rightResourceSet
+ .getResources());
+ final List<Resource> remainingAncestorResources = new ArrayList<Resource>(ancestorResourceSet
+ .getResources());
applyScopeFilter(leftScope, remainingLeftResources);
applyScopeFilter(rightScope, remainingRightResources);
applyScopeFilter(ancestorScope, remainingAncestorResources);
diff --git a/plugins/org.eclipse.emf.compare.mpatch.test/org.eclipse.emf.compare.mpatch.test.launch b/plugins/org.eclipse.emf.compare.mpatch.test/org.eclipse.emf.compare.mpatch.test.launch
index a19d836ae..4ca3b2606 100644
--- a/plugins/org.eclipse.emf.compare.mpatch.test/org.eclipse.emf.compare.mpatch.test.launch
+++ b/plugins/org.eclipse.emf.compare.mpatch.test/org.eclipse.emf.compare.mpatch.test.launch
@@ -19,6 +19,9 @@
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+</listAttribute>
<booleanAttribute key="org.eclipse.hyades.trace.ui.ATTR_AUTO_FILTER_CRITERIA" value="false"/>
<booleanAttribute key="org.eclipse.hyades.trace.ui.ATTR_AUTO_MONITORING" value="true"/>
<stringAttribute key="org.eclipse.hyades.trace.ui.ATTR_DATA_COLLECTOR" value="org.eclipse.tptp.trace.jvmti.jvmtiMechanism:org.eclipse.tptp.analysisType.jvmti.execution"/>
diff --git a/plugins/org.eclipse.emf.compare.source/.project b/plugins/org.eclipse.emf.compare.source/.project
new file mode 100644
index 000000000..a9a63dbaa
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.source/.project
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.compare.source</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.emf.compare/.checkstyle b/plugins/org.eclipse.emf.compare/.checkstyle
new file mode 100644
index 000000000..6dc7fd7fe
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/.checkstyle
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<fileset-config file-format-version="1.2.0" simple-config="true">
+ <local-check-config name="EMF Compare" location="codeStyle/EMFCompareCheckstyleConfiguration.xml" type="project" description="">
+ <additional-data name="protect-config-file" value="false"/>
+ </local-check-config>
+ <fileset name="tous" enabled="true" check-config-name="EMF Compare" local="true">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+</fileset-config>
diff --git a/plugins/org.eclipse.emf.compare.logical/.classpath b/plugins/org.eclipse.emf.compare/.classpath
index 2d1a4302f..304e86186 100644
--- a/plugins/org.eclipse.emf.compare.logical/.classpath
+++ b/plugins/org.eclipse.emf.compare/.classpath
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.emf.compare.logical/.project b/plugins/org.eclipse.emf.compare/.project
index 1f1aead90..2add6f944 100644
--- a/plugins/org.eclipse.emf.compare.logical/.project
+++ b/plugins/org.eclipse.emf.compare/.project
@@ -1,28 +1,40 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.emf.compare.logical</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.compare</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.emf.compare/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.emf.compare/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 000000000..6801a3145
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+#Wed Oct 31 16:57:40 CET 2007
+eclipse.preferences.version=1
+encoding//src/org/eclipse/emf/compare/emfcomparemessages.properties=8859_1
diff --git a/plugins/org.eclipse.emf.compare/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.compare/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..88e328d19
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,333 @@
+#Tue Mar 08 11:25:35 CET 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=error
+org.eclipse.jdt.core.compiler.problem.emptyStatement=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=error
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=error
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=error
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=1
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=110
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
+org.eclipse.jdt.core.formatter.indentation.size=8
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=110
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
diff --git a/plugins/org.eclipse.emf.compare/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.emf.compare/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 000000000..1d071ef31
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,56 @@
+#Fri Mar 13 15:45:57 CET 2009
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_EMF Compare
+formatter_settings_version=11
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=true
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=false
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=true
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/plugins/org.eclipse.emf.compare/.settings/org.eclipse.pde.api.tools.prefs b/plugins/org.eclipse.emf.compare/.settings/org.eclipse.pde.api.tools.prefs
new file mode 100644
index 000000000..70372ba8d
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/.settings/org.eclipse.pde.api.tools.prefs
@@ -0,0 +1,150 @@
+#Wed Apr 08 15:05:52 CEST 2009
+ANNOTATION_ELEMENT_TYPE_ADDED_CLASS_BOUND=Warning
+ANNOTATION_ELEMENT_TYPE_ADDED_FIELD=Warning
+ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Warning
+ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Warning
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD=Warning
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Warning
+ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Warning
+ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Warning
+ANNOTATION_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Warning
+ANNOTATION_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Warning
+ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Warning
+ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Warning
+ANNOTATION_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Warning
+ANNOTATION_ELEMENT_TYPE_CHANGED_TO_CLASS=Warning
+ANNOTATION_ELEMENT_TYPE_CHANGED_TO_ENUM=Warning
+ANNOTATION_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Warning
+ANNOTATION_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Warning
+ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Warning
+ANNOTATION_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Warning
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITHOUT_DEFAULT_VALUE=Warning
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITH_DEFAULT_VALUE=Warning
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Warning
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Warning
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Warning
+API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Warning
+API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Warning
+CLASS_ELEMENT_TYPE_ADDED_CLASS_BOUND=Warning
+CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Warning
+CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Warning
+CLASS_ELEMENT_TYPE_ADDED_METHOD=Warning
+CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Warning
+CLASS_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Warning
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERCLASS_SET=Warning
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Warning
+CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Warning
+CLASS_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Warning
+CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Warning
+CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Warning
+CLASS_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Warning
+CLASS_ELEMENT_TYPE_CHANGED_SUPERCLASS=Warning
+CLASS_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Warning
+CLASS_ELEMENT_TYPE_CHANGED_TO_ENUM=Warning
+CLASS_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Warning
+CLASS_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Warning
+CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Warning
+CLASS_ELEMENT_TYPE_REMOVED_FIELD=Warning
+CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Warning
+CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Warning
+CLASS_ELEMENT_TYPE_REMOVED_METHOD=Warning
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Warning
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Warning
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Warning
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_CLASS_BOUND=Warning
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Warning
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Warning
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Warning
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Warning
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Warning
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Warning
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Warning
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Warning
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Warning
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Warning
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Warning
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Warning
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Warning
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Warning
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Warning
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Warning
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Warning
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Warning
+ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Warning
+ENUM_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Warning
+ENUM_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Warning
+ENUM_ELEMENT_TYPE_CHANGED_TO_CLASS=Warning
+ENUM_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Warning
+ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Warning
+ENUM_ELEMENT_TYPE_REMOVED_FIELD=Warning
+ENUM_ELEMENT_TYPE_REMOVED_METHOD=Warning
+ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Warning
+FIELD_ELEMENT_TYPE_ADDED_VALUE=Warning
+FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Warning
+FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Warning
+FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Warning
+FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Warning
+FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Warning
+FIELD_ELEMENT_TYPE_CHANGED_TYPE=Warning
+FIELD_ELEMENT_TYPE_CHANGED_VALUE=Warning
+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENTS=Warning
+FIELD_ELEMENT_TYPE_REMOVED_VALUE=Warning
+ILLEGAL_EXTEND=Warning
+ILLEGAL_IMPLEMENT=Warning
+ILLEGAL_INSTANTIATE=Warning
+ILLEGAL_OVERRIDE=Warning
+ILLEGAL_REFERENCE=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_CLASS_BOUND=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETERS=Warning
+INTERFACE_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Warning
+INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Warning
+INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Warning
+INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Warning
+INTERFACE_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Warning
+INTERFACE_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Warning
+INTERFACE_ELEMENT_TYPE_CHANGED_TO_CLASS=Warning
+INTERFACE_ELEMENT_TYPE_CHANGED_TO_ENUM=Warning
+INTERFACE_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Warning
+INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Warning
+INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Warning
+INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Warning
+INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Warning
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Warning
+INVALID_JAVADOC_TAG=Ignore
+LEAK_EXTEND=Warning
+LEAK_FIELD_DECL=Warning
+LEAK_IMPLEMENT=Warning
+LEAK_METHOD_PARAM=Warning
+LEAK_METHOD_RETURN_TYPE=Warning
+METHOD_ELEMENT_TYPE_ADDED_CLASS_BOUND=Warning
+METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Warning
+METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Warning
+METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Warning
+METHOD_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Warning
+METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Warning
+METHOD_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Warning
+METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Warning
+METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Warning
+METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Warning
+METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Warning
+METHOD_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Warning
+METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Warning
+METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Warning
+METHOD_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Warning
+METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Warning
+METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Warning
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Warning
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Warning
+eclipse.preferences.version=1
+incompatible_api_component_version=Warning
+incompatible_api_component_version_include_major_without_breaking_change=Disabled
+incompatible_api_component_version_include_minor_without_api_change=Disabled
+invalid_since_tag_version=Error
+malformed_since_tag=Error
+missing_since_tag=Error
diff --git a/plugins/org.eclipse.emf.compare/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..34f8f4bd9
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/META-INF/MANIFEST.MF
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.emf.compare;singleton:=true
+Bundle-Version: 1.2.0.qualifier
+Bundle-ClassPath: .
+Bundle-Activator: org.eclipse.emf.compare.EMFComparePlugin
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.resources;resolution:=optional,
+ org.eclipse.core.runtime;resolution:=optional,
+ org.eclipse.emf.ecore,
+ org.eclipse.emf.ecore.xmi,
+ org.eclipse.emf.edit
+Export-Package: org.eclipse.emf.compare,
+ org.eclipse.emf.compare.util
+Bundle-Vendor: %providerName
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Eclipse-LazyStart: true
diff --git a/plugins/org.eclipse.emf.compare/TASKS b/plugins/org.eclipse.emf.compare/TASKS
new file mode 100644
index 000000000..b0c70735a
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/TASKS
@@ -0,0 +1,55 @@
+___ TODO ___
+ - complete documentation and tutorials
+ - coding a match engine
+ - extending diff metamodel
+ - cleaning up API, Extensible Factor system for generic engine
+ - supporting dependencies design for merging
+ - weight annotations for metamodels
+
+___ DONE ___
+27/11/2007 - API broken for match engines : added method in interface org.eclipse.emf.compare.match.api.MatchEngine for content comparison.
+07/11/2007 - DiffService, MatchService and MergeService modified to allow full standalone usage
+05/11/2007 - Enabled internationalization
+29/10/2007 - Merger API greatly modified. A new extension point appears to provide a list of merger associated to DiffElements.
+ - org.eclipse.emf.compare.diff.merge.service.MergeService has been modified and is now the main mean of merging.
+ - Events are now fired before and after 1) a merge operation (merging of one or more diffs) and 2) a diff merge (for each difference).
+ Clients can register listeners for these event via MergeService#addMergeListener(IMergeListener).
+ - org.eclipse.emf.compare.diff.merge.service.MergeFactory has been modified and will now parse registered extensions to check for provided mergers.
+ - about MergerProviders and priorities, priority takes precedence over file extension :
+ - plugin A provides mergers for its own DiffElements (DiffB, DiffC) and overrides the behavior of core DiffElement (DiffA), all with "normal" priority and targeted to uml extensions (.uml)
+ - plugin B provides mergers overriding the behavior of core DiffElements (DiffA) with priority "high" and target to all file extensions (*)
+ - for an uml model (model.uml) the merger used for DiffB and DiffC will be the ones provided by plugin A, whereas DiffA will be merged with the merger provided by plugin B
+ - when two plugins provide distinct mergers for the same DiffElement with the same priority, file extension takes precedence
+26/10/2007 - priorities of all contributed extensions (match engine, diff engine, ...) is now "lowest"
+18/10/2007 - created preferences to ignore XMI ID when comparing and to supress drawing of differences markers
+16/10/2007 - modified match to allow an options map to be passed as argument
+04/10/2007 - UI package refactoring
+ org.eclipse.emf.compare.ui.contentmergeviewer.* => org.eclipse.emf.compare.ui.viewer.content.*
+ org.eclipse.emf.compare.ui.contentprovider.PropertyContentProvider => org.eclipse.emf.compare.ui.viewer.content.part.property.PropertyContentProvider
+ org.eclipse.emf.compare.ui.contentprovider.ModelStructureMergeContentProvider => org.eclipse.emf.compare.ui.viewer.structure.ModelStructureMergeContentProvider
+ org.eclipse.emf.compare.ui.contentprovider.ModelContentMergeContentProvider => org.eclipse.emf.compare.ui.viewer.content.ModelContentMergeContentProvider
+ org.eclipse.emf.compare.ui.structuremergeviewer.* => org.eclipse.emf.compare.ui.viewer.structure.*
+ org.eclipse.emf.compare.ui.viewerparts.ModelContentMergeViewerPart => org.eclipse.emf.compare.ui.viewer.content.part.ModelContentMergeViewerPart
+ org.eclipse.emf.compare.ui.viewerparts.ModelContentMergeTreePart => org.eclipse.emf.compare.ui.viewer.content.part.tree.ModelContentMergeTreePart
+ org.eclipse.emf.compare.ui.viewerparts.ModelContentMergePropertyPart => org.eclipse.emf.compare.ui.viewer.content.part.property.ModelContentMergePropertyPart
+14/08/2007 - using functional ID through Ecore ID
+14/08/2007 - diff extension API
+14/08/2007 - export diff as API
+30/07/2007 - (DRAFT) - export diff as... extension point
+30/07/2007 - 3 Way compare
+10/07/2007 - suppress unused code
+05/07/2007 - better browsing when using XMI_ID
+28/06/2007 - merge on moveoperation
+14/06/2007 - cleanup GUI
+07/06/2007 - open .diff files with compare editor
+10/05/2007 - (LAURENT) dynamic icons for diff model using the element icons
+23/04/2007 - remove UML2 dependencie for icons and use item providers for others
+17/04/2007 - hierarchy in diff model
+16/04/2007 - handle the case where many elements still need to be mapped
+ without reaching a n^n complexity => using a max window
+16/04/2007 - use StringBuffer
+13/04/2007 - maplists should map with the best matching of the list (not the first)
+13/04/2007 - filter unused metamodel elements (for instance many stuffs in UML are not really used in models..)
+12/04/2007 - progress monitor and cancel support
+12/04/2007 - cleaning up UI (remove uneeded buttons, diagram tabs...)
+12/04/2007 - save diff action
diff --git a/plugins/org.eclipse.emf.compare/about.html b/plugins/org.eclipse.emf.compare/about.html
new file mode 100755
index 000000000..670d10856
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/about.html
@@ -0,0 +1,106 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>April 14, 2010</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+ (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+ repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+ Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+ other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+ href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+ (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+ applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+ in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+ Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+ <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+ on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+ product.</li>
+ <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.</li>
+ <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+ Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+ the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+ indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.compare/about.ini b/plugins/org.eclipse.emf.compare/about.ini
new file mode 100755
index 000000000..eec22440e
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/about.ini
@@ -0,0 +1,14 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%featureText
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=modeling32.png
+
+# Property "appName" contains name of the application (translated)
+appName=%featureName
diff --git a/plugins/org.eclipse.emf.compare/about.mappings b/plugins/org.eclipse.emf.compare/about.mappings
new file mode 100755
index 000000000..a28390a75
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/about.mappings
@@ -0,0 +1,6 @@
+# about.mappings
+# contains fill-ins for about.properties
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file does not need to be translated.
+
+0=@build@
diff --git a/plugins/org.eclipse.emf.compare/about.properties b/plugins/org.eclipse.emf.compare/about.properties
new file mode 100755
index 000000000..0c7a23c4e
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/about.properties
@@ -0,0 +1,27 @@
+# /**
+# * <copyright>
+# *
+# * Copyright (c) 2006-2009 Obeo 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
+# * http://www.eclipse.org/legal/epl-v10.html
+# *
+# * Contributors:
+# * Obeo - Initial API and implementation
+# *
+# * </copyright>
+# */
+
+# NLS_MESSAGEFORMAT_VAR
+
+featureName=EMF Compare
+
+featureText=EMF Compare - Model Comparison\n\
+Version: {featureVersion}\n\
+Build id: {0}\n\
+\n\
+(c) Copyright Obeo and others. 2006, 2009. All rights reserved.\n\
+\n\
+EMF Compare brings comparison to the Eclipse Modeling Framework\n\
+Visit http://www.eclipse.org/modeling/emft/?project=compare
diff --git a/plugins/org.eclipse.emf.compare/build.properties b/plugins/org.eclipse.emf.compare/build.properties
new file mode 100644
index 000000000..0e22d9c79
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/build.properties
@@ -0,0 +1,23 @@
+###############################################################################
+# Copyright (c) 2006, 2011 Obeo.
+# 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
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Obeo - initial API and implementation
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html,\
+ plugin.properties,\
+ about.ini,\
+ about.mappings,\
+ about.properties,\
+ modeling32.png
+src.includes = META-INF/,\
+ about.html,\
+ plugin.properties
diff --git a/plugins/org.eclipse.emf.compare/codeStyle/API.txt b/plugins/org.eclipse.emf.compare/codeStyle/API.txt
new file mode 100644
index 000000000..64caa2b45
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/codeStyle/API.txt
@@ -0,0 +1,5 @@
+All the code exported by a plugin is considered API and the non-exported
+code is considered internal.
+
+EMF Compare will kept being API compatible for every planned minor release.
+ \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.compare/codeStyle/EMFCompareCheckstyleConfiguration.xml b/plugins/org.eclipse.emf.compare/codeStyle/EMFCompareCheckstyleConfiguration.xml
new file mode 100755
index 000000000..987692ccf
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/codeStyle/EMFCompareCheckstyleConfiguration.xml
@@ -0,0 +1,342 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ This configuration file was written by the eclipse-cs plugin configuration editor
+-->
+<!--
+ Checkstyle-Configuration: EMF Compare
+ Description: none
+-->
+<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+<module name="Checker">
+ <property name="severity" value="warning"/>
+ <module name="TreeWalker">
+ <module name="FileContentsHolder"/>
+ <module name="JavadocMethod">
+ <property name="severity" value="error"/>
+ <property name="allowMissingPropertyJavadoc" value="true"/>
+ <property name="logLoadErrors" value="true"/>
+ <property name="suppressLoadErrors" value="true"/>
+ </module>
+ <module name="JavadocStyle">
+ <property name="severity" value="error"/>
+ <property name="checkEmptyJavadoc" value="true"/>
+ </module>
+ <module name="JavadocType">
+ <property name="severity" value="error"/>
+ <property name="authorFormat" value="(&lt;a\shref=\&quot;mailto:[a-z.]+@[a-z.]+\.[a-z]{2,4}\&quot;&gt;)?[A-Z][a-z]+\s[A-Z][a-z]+(&lt;/a&gt;)?"/>
+ </module>
+ <module name="JavadocVariable">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="AbstractClassName">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="ConstantName">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="LocalFinalVariableName">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="LocalVariableName">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="MemberName">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="MethodName">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="PackageName">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="ParameterName">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="StaticVariableName">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="TypeName">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="AvoidStarImport">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="IllegalImport">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="ImportOrder">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="RedundantImport">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="UnusedImports">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="AnonInnerLength">
+ <property name="severity" value="error"/>
+ <property name="max" value="25"/>
+ </module>
+ <module name="ExecutableStatementCount">
+ <property name="severity" value="error"/>
+ <property name="max" value="60"/>
+ <property name="tokens" value="INSTANCE_INIT,STATIC_INIT,METHOD_DEF,CTOR_DEF"/>
+ </module>
+ <module name="FileLength">
+ <property name="severity" value="error"/>
+ <property name="max" value="2100"/>
+ </module>
+ <module name="MethodLength">
+ <property name="severity" value="error"/>
+ <property name="max" value="100"/>
+ </module>
+ <module name="ParameterNumber">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="EmptyForInitializerPad">
+ <property name="severity" value="error"/>
+ <property name="option" value="space"/>
+ </module>
+ <module name="EmptyForIteratorPad">
+ <property name="severity" value="error"/>
+ <property name="option" value="space"/>
+ </module>
+ <module name="NoWhitespaceBefore">
+ <property name="severity" value="error"/>
+ <property name="allowLineBreaks" value="true"/>
+ <property name="tokens" value="SEMI,DOT,POST_DEC,POST_INC"/>
+ </module>
+ <module name="MethodParamPad">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="ParenPad">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="TypecastParenPad">
+ <property name="severity" value="error"/>
+ <property name="tokens" value="RPAREN,TYPECAST"/>
+ </module>
+ <module name="WhitespaceAfter">
+ <property name="severity" value="error"/>
+ <property name="tokens" value="COMMA,SEMI"/>
+ </module>
+ <module name="WhitespaceAround">
+ <property name="severity" value="error"/>
+ <property name="tokens" value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV,DIV_ASSIGN,EQUAL,GE,GT,LAND,LCURLY,LE,LITERAL_ASSERT,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,RCURLY,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,LITERAL_ASSERT,TYPE_EXTENSION_AND"/>
+ </module>
+ <module name="ModifierOrder">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="RedundantModifier">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="AvoidNestedBlocks">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="EmptyBlock">
+ <property name="severity" value="error"/>
+ <property name="option" value="text"/>
+ </module>
+ <module name="LeftCurly">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="RightCurly">
+ <property name="severity" value="error"/>
+ <property name="tokens" value="LITERAL_CATCH,LITERAL_FINALLY,LITERAL_ELSE"/>
+ </module>
+ <module name="AvoidInlineConditionals">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="NoWhitespaceAfter">
+ <property name="severity" value="error"/>
+ <property name="tokens" value="BNOT,DEC,DOT,INC,LNOT,UNARY_MINUS,UNARY_PLUS,TYPECAST"/>
+ </module>
+ <module name="CovariantEquals">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="DefaultComesLast">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="DeclarationOrder">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="DoubleCheckedLocking">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="EmptyStatement">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="EqualsHashCode">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="ExplicitInitialization">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="FallThrough">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="FinalLocalVariable">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="HiddenField">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="IllegalCatch">
+ <property name="severity" value="error"/>
+ <property name="illegalClassNames" value="java.lang.Exception, java.lang.Throwable, java.lang.RuntimeException, java.lang.Error"/>
+ </module>
+ <module name="IllegalThrows">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="InnerAssignment">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="JUnitTestCase">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="MagicNumber">
+ <property name="severity" value="error"/>
+ <property name="ignoreNumbers" value="-100, -10, -1, -0.75, -0.5, -0.1, 0, 0.1, 0.5, 0.75, 1, 2, 3, 4, 5, 6, 10, 11, 13, 100, 1000"/>
+ </module>
+ <module name="MissingSwitchDefault">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="ModifiedControlVariable">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="MultipleStringLiterals">
+ <property name="severity" value="error"/>
+ <property name="allowedDuplicates" value="2"/>
+ </module>
+ <module name="MultipleVariableDeclarations">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="NestedIfDepth">
+ <property name="severity" value="error"/>
+ <property name="max" value="3"/>
+ </module>
+ <module name="NestedTryDepth">
+ <property name="severity" value="error"/>
+ <property name="max" value="2"/>
+ </module>
+ <module name="PackageDeclaration">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="ParameterAssignment">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="RedundantThrows">
+ <property name="severity" value="error"/>
+ <property name="allowUnchecked" value="true"/>
+ <property name="allowSubclasses" value="true"/>
+ <property name="logLoadErrors" value="true"/>
+ <property name="suppressLoadErrors" value="true"/>
+ </module>
+ <module name="ReturnCount">
+ <property name="severity" value="error"/>
+ <property name="format" value="^insertionIndexFor$"/>
+ </module>
+ <module name="SimplifyBooleanExpression">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="SimplifyBooleanReturn">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="StringLiteralEquality">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="SuperClone">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="SuperFinalize">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="ArrayTrailingComma">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="UnnecessaryParentheses">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="FinalClass">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="HideUtilityClassConstructor">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="MutableException">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="ThrowsCount">
+ <property name="severity" value="error"/>
+ <property name="max" value="3"/>
+ </module>
+ <module name="VisibilityModifier">
+ <property name="severity" value="error"/>
+ <property name="packageAllowed" value="true"/>
+ <property name="protectedAllowed" value="true"/>
+ </module>
+ <module name="BooleanExpressionComplexity">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="ClassDataAbstractionCoupling">
+ <property name="severity" value="info"/>
+ <property name="max" value="12"/>
+ </module>
+ <module name="ClassFanOutComplexity">
+ <property name="severity" value="info"/>
+ <property name="max" value="30"/>
+ </module>
+ <module name="CyclomaticComplexity">
+ <property name="severity" value="info"/>
+ </module>
+ <module name="NPathComplexity">
+ <property name="severity" value="info"/>
+ </module>
+ <module name="ArrayTypeStyle">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="UpperEll">
+ <property name="severity" value="error"/>
+ </module>
+ <module name="j2ee.EntityBean"/>
+ <module name="j2ee.FinalStatic"/>
+ <module name="j2ee.LocalHomeInterface"/>
+ <module name="j2ee.LocalInterface"/>
+ <module name="j2ee.MessageBean"/>
+ <module name="j2ee.RemoteHomeInterface"/>
+ <module name="j2ee.RemoteInterface"/>
+ <module name="j2ee.SessionBean"/>
+ <module name="j2ee.ThisParameter"/>
+ <module name="j2ee.ThisReturn"/>
+ <module name="RequiredRegexp">
+ <metadata name="com.atlassw.tools.eclipse.checkstyle.customMessage" value="Le copyright doit figurer dans le fichier sous la forme &quot;Copyright (c) 2006, 2009 Obeo.&quot;"/>
+ <property name="severity" value="error"/>
+ <property name="format" value="Copyright\s\(c\)\s(20[0-9]{2},?\s)+"/>
+ </module>
+ <module name="GenericIllegalRegexp">
+ <property name="severity" value="error"/>
+ <property name="id" value="illegal.regex.encoding"/>
+ <property name="format" value="[^a-zA-Z0-9_!:;,\.\+\(\)/\\\]\[{}\-\*&lt;&gt;%@\&amp; \|\t\n&quot;' =$#\r\?éèàê\^]"/>
+ <property name="message" value="Character could cause encoding issue."/>
+ </module>
+ <module name="GenericIllegalRegexp">
+ <property name="id" value="illegal.regex.equals"/>
+ <property name="format" value="[^&quot;]\.equals\(&quot;"/>
+ <property name="ignoreComments" value="true"/>
+ <property name="message" value="This kind of expression can easily throw NPEs. Receiver and argument should be inverted."/>
+ </module>
+ <module name="GenericIllegalRegexp">
+ <property name="id" value="illegal.regex.redundantnullcheck"/>
+ <property name="format" value="([^\n]*?) != null &amp;&amp; \1 instanceof [^\n]*?"/>
+ <property name="ignoreComments" value="true"/>
+ <property name="message" value="redundant null check"/>
+ </module>
+ <module name="GenericIllegalRegexp">
+ <property name="id" value="illegal.regex.badpractices"/>
+ <property name="format" value="^.*?(System\.(out|err)\.print|printStackTrace).*?$"/>
+ <property name="ignoreComments" value="true"/>
+ <property name="message" value="These are for debug/batch applications launches only. Remove them from production build."/>
+ </module>
+ </module>
+ <module name="SuppressionCommentFilter"/>
+</module>
diff --git a/plugins/org.eclipse.emf.compare/codeStyle/EMFCompareCodeTemplates.xml b/plugins/org.eclipse.emf.compare/codeStyle/EMFCompareCodeTemplates.xml
new file mode 100755
index 000000000..aa4df7c0b
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/codeStyle/EMFCompareCodeTemplates.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?><templates><template autoinsert="false" context="typecomment_context" deleted="false" description="Comment for created types" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.typecomment" name="typecomment">/**
+ *
+ * @author Laurent Goubet &lt;a href="mailto:laurent.goubet@obeo.fr"&gt;laurent.goubet@obeo.fr&lt;/a&gt;
+ */</template><template autoinsert="true" context="delegatecomment_context" deleted="false" description="Comment for delegate methods" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name="delegatecomment">/**
+ * ${tags}
+ * ${see_to_target}
+ */</template><template autoinsert="false" context="overridecomment_context" deleted="false" description="Comment for overriding methods" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name="overridecomment">/**
+ * {@inheritDoc}
+ *
+ * ${see_to_overridden}
+ */</template><template autoinsert="true" context="fieldcomment_context" deleted="false" description="Comment for fields" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name="fieldcomment">/**
+ *
+ */</template><template autoinsert="true" context="methodcomment_context" deleted="false" description="Comment for non-overriding methods" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name="methodcomment">/**
+ * ${tags}
+ */</template><template autoinsert="false" context="settercomment_context" deleted="false" description="Comment for setter method" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.settercomment" name="settercomment">/**
+ * Sets the value of ${bare_field_name} to ${param}.
+ *
+ * @param ${param} The ${bare_field_name} to set.
+ */</template><template autoinsert="true" context="constructorcomment_context" deleted="false" description="Comment for created constructors" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name="constructorcomment">/**
+ * ${tags}
+ */</template><template autoinsert="true" context="filecomment_context" deleted="false" description="Comment for created Java files" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.filecomment" name="filecomment">/**
+ *
+ */</template><template autoinsert="false" context="gettercomment_context" deleted="false" description="Comment for getter method" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name="gettercomment">/**
+ * Returns the ${bare_field_name}.
+ *
+ * @return The ${bare_field_name}.
+ */</template></templates> \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.compare/codeStyle/EMFCompareFormatter.xml b/plugins/org.eclipse.emf.compare/codeStyle/EMFCompareFormatter.xml
new file mode 100644
index 000000000..f2b06b3b3
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/codeStyle/EMFCompareFormatter.xml
@@ -0,0 +1,264 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<profiles version="11">
+<profile kind="CodeFormatterProfile" name="EMF Compare" version="11">
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="8"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="110"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.compiler.source" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="110"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="tab"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
+</profile>
+</profiles>
diff --git a/plugins/org.eclipse.emf.compare/modeling32.png b/plugins/org.eclipse.emf.compare/modeling32.png
new file mode 100755
index 000000000..6b08de2ad
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/modeling32.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.compare/plugin.properties b/plugins/org.eclipse.emf.compare/plugin.properties
new file mode 100644
index 000000000..8525577d8
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/plugin.properties
@@ -0,0 +1,13 @@
+################################################################################
+# Copyright (c) 2006, 2011 Obeo.
+# 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
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Obeo - initial API and implementation
+################################################################################
+pluginName = EMF Compare core
+providerName = Eclipse Modeling Project
+
diff --git a/plugins/org.eclipse.emf.compare/psf/emf_compare.psf b/plugins/org.eclipse.emf.compare/psf/emf_compare.psf
new file mode 100644
index 000000000..227cfc178
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/psf/emf_compare.psf
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<psf version="2.0">
+<provider id="org.eclipse.team.cvs.core.cvsnature">
+<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/plugins/org.eclipse.emf.compare,org.eclipse.emf.compare"/>
+<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/plugins/org.eclipse.emf.compare-feature,org.eclipse.emf.compare-feature"/>
+<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/plugins/org.eclipse.emf.compare.all-feature,org.eclipse.emf.compare.all-feature"/>
+<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/plugins/org.eclipse.emf.compare.diff,org.eclipse.emf.compare.diff"/>
+<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/plugins/org.eclipse.emf.compare.diff.edit,org.eclipse.emf.compare.diff.edit"/>
+<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/doc/org.eclipse.emf.compare.doc,org.eclipse.emf.compare.doc"/>
+<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/doc/org.eclipse.emf.compare.doc-feature,org.eclipse.emf.compare.doc-feature"/>
+<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/examples/org.eclipse.emf.compare.examples,org.eclipse.emf.compare.examples"/>
+<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/examples/org.eclipse.emf.compare.examples-feature,org.eclipse.emf.compare.examples-feature"/>
+<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/examples/org.eclipse.emf.compare.examples.addressbook,org.eclipse.emf.compare.examples.addressbook"/>
+<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/examples/org.eclipse.emf.compare.examples.diff.extension,org.eclipse.emf.compare.examples.diff.extension"/>
+<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/examples/org.eclipse.emf.compare.examples.export.library,org.eclipse.emf.compare.examples.export.library"/>
+<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/examples/org.eclipse.emf.compare.examples.export.xslt,org.eclipse.emf.compare.examples.export.xslt"/>
+<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/examples/org.eclipse.emf.compare.examples.standalone,org.eclipse.emf.compare.examples.standalone"/>
+<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/plugins/org.eclipse.emf.compare.match,org.eclipse.emf.compare.match"/>
+<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare.releng,org.eclipse.emf.compare.releng"/>
+<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/plugins/org.eclipse.emf.compare.sdk-feature,org.eclipse.emf.compare.sdk-feature"/>
+<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/plugins/org.eclipse.emf.compare.team.subversive,org.eclipse.emf.compare.team.subversive"/>
+<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/plugins/org.eclipse.emf.compare.team.subversive-feature,org.eclipse.emf.compare.team.subversive-feature"/>
+<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/tests/org.eclipse.emf.compare.tests,org.eclipse.emf.compare.tests"/>
+<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/tests/org.eclipse.emf.compare.tests-feature,org.eclipse.emf.compare.tests-feature"/>
+<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/plugins/org.eclipse.emf.compare.ui,org.eclipse.emf.compare.ui"/>
+<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/plugins/org.eclipse.emf.compare.ui.capabilities,org.eclipse.emf.compare.ui.capabilities"/>
+<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/plugins/org.eclipse.emf.compare.ui.capabilities-feature,org.eclipse.emf.compare.ui.capabilities-feature"/>
+</provider>
+<workingSets editPageId="org.eclipse.jdt.ui.JavaWorkingSetPage" label="Build" name="Build">
+<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/org.eclipse.emf.compare.releng" type="4"/>
+</workingSets>
+<workingSets editPageId="org.eclipse.jdt.ui.JavaWorkingSetPage" label="EMF Compare" name="EMF Compare">
+<item elementID="=org.eclipse.emf.compare.doc" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+<item elementID="=org.eclipse.emf.compare.ui.capabilities" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+<item elementID="=org.eclipse.emf.compare.match" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+<item elementID="=org.eclipse.emf.compare.diff" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+<item elementID="=org.eclipse.emf.compare" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+<item elementID="=org.eclipse.emf.compare.diff.edit" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+<item elementID="=org.eclipse.emf.compare.ui" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+</workingSets>
+<workingSets editPageId="org.eclipse.jdt.ui.JavaWorkingSetPage" label="Examples" name="Examples">
+<item elementID="=org.eclipse.emf.compare.examples.standalone" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+<item elementID="=org.eclipse.emf.compare.examples.export.library" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+<item elementID="=org.eclipse.emf.compare.examples.diff.extension" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+<item elementID="=org.eclipse.emf.compare.examples" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+<item elementID="=org.eclipse.emf.compare.examples.addressbook" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+<item elementID="=org.eclipse.emf.compare.examples.export.xslt" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+</workingSets>
+<workingSets editPageId="org.eclipse.jdt.ui.JavaWorkingSetPage" label="Features" name="Features">
+<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/org.eclipse.emf.compare.sdk-feature" type="4"/>
+<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/org.eclipse.emf.compare.team.subversive-feature" type="4"/>
+<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/org.eclipse.emf.compare.ui.capabilities-feature" type="4"/>
+<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/org.eclipse.emf.compare-feature" type="4"/>
+<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/org.eclipse.emf.compare.tests-feature" type="4"/>
+<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/org.eclipse.emf.compare.doc-feature" type="4"/>
+<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/org.eclipse.emf.compare.examples-feature" type="4"/>
+<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/org.eclipse.emf.compare.all-feature" type="4"/>
+</workingSets>
+<workingSets editPageId="org.eclipse.jdt.ui.JavaWorkingSetPage" label="Team Integration" name="Team Integration">
+<item elementID="=org.eclipse.emf.compare.team.subversive" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+</workingSets>
+<workingSets editPageId="org.eclipse.jdt.ui.JavaWorkingSetPage" label="Tests" name="Tests">
+<item elementID="=org.eclipse.emf.compare.tests" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+</workingSets>
+</psf>
diff --git a/plugins/org.eclipse.emf.compare/psf/emf_compare_extssh.psf b/plugins/org.eclipse.emf.compare/psf/emf_compare_extssh.psf
new file mode 100644
index 000000000..aebca7a73
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/psf/emf_compare_extssh.psf
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<psf version="2.0">
+<provider id="org.eclipse.team.cvs.core.cvsnature">
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/plugins/org.eclipse.emf.compare,org.eclipse.emf.compare"/>
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/plugins/org.eclipse.emf.compare-feature,org.eclipse.emf.compare-feature"/>
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/plugins/org.eclipse.emf.compare.all-feature,org.eclipse.emf.compare.all-feature"/>
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/plugins/org.eclipse.emf.compare.diff,org.eclipse.emf.compare.diff"/>
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/plugins/org.eclipse.emf.compare.diff.edit,org.eclipse.emf.compare.diff.edit"/>
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/doc/org.eclipse.emf.compare.doc,org.eclipse.emf.compare.doc"/>
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/doc/org.eclipse.emf.compare.doc-feature,org.eclipse.emf.compare.doc-feature"/>
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/examples/org.eclipse.emf.compare.examples,org.eclipse.emf.compare.examples"/>
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/examples/org.eclipse.emf.compare.examples-feature,org.eclipse.emf.compare.examples-feature"/>
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/examples/org.eclipse.emf.compare.examples.addressbook,org.eclipse.emf.compare.examples.addressbook"/>
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/examples/org.eclipse.emf.compare.examples.diff.extension,org.eclipse.emf.compare.examples.diff.extension"/>
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/examples/org.eclipse.emf.compare.examples.export.library,org.eclipse.emf.compare.examples.export.library"/>
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/examples/org.eclipse.emf.compare.examples.export.xslt,org.eclipse.emf.compare.examples.export.xslt"/>
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/examples/org.eclipse.emf.compare.examples.standalone,org.eclipse.emf.compare.examples.standalone"/>
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/plugins/org.eclipse.emf.compare.match,org.eclipse.emf.compare.match"/>
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare.releng,org.eclipse.emf.compare.releng"/>
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/plugins/org.eclipse.emf.compare.sdk-feature,org.eclipse.emf.compare.sdk-feature"/>
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/plugins/org.eclipse.emf.compare.team.subversive,org.eclipse.emf.compare.team.subversive"/>
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/plugins/org.eclipse.emf.compare.team.subversive-feature,org.eclipse.emf.compare.team.subversive-feature"/>
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/tests/org.eclipse.emf.compare.tests,org.eclipse.emf.compare.tests"/>
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/tests/org.eclipse.emf.compare.tests-feature,org.eclipse.emf.compare.tests-feature"/>
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/plugins/org.eclipse.emf.compare.ui,org.eclipse.emf.compare.ui"/>
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/plugins/org.eclipse.emf.compare.ui.capabilities,org.eclipse.emf.compare.ui.capabilities"/>
+<project reference="1.0,:extssh:dev.eclipse.org:/cvsroot/modeling,org.eclipse.emf/org.eclipse.emf.compare/plugins/org.eclipse.emf.compare.ui.capabilities-feature,org.eclipse.emf.compare.ui.capabilities-feature"/>
+</provider>
+<workingSets editPageId="org.eclipse.jdt.ui.JavaWorkingSetPage" label="Build" name="Build">
+<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/org.eclipse.emf.compare.releng" type="4"/>
+</workingSets>
+<workingSets editPageId="org.eclipse.jdt.ui.JavaWorkingSetPage" label="EMF Compare" name="EMF Compare">
+<item elementID="=org.eclipse.emf.compare.doc" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+<item elementID="=org.eclipse.emf.compare.ui.capabilities" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+<item elementID="=org.eclipse.emf.compare.match" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+<item elementID="=org.eclipse.emf.compare.diff" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+<item elementID="=org.eclipse.emf.compare" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+<item elementID="=org.eclipse.emf.compare.diff.edit" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+<item elementID="=org.eclipse.emf.compare.ui" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+</workingSets>
+<workingSets editPageId="org.eclipse.jdt.ui.JavaWorkingSetPage" label="Examples" name="Examples">
+<item elementID="=org.eclipse.emf.compare.examples.standalone" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+<item elementID="=org.eclipse.emf.compare.examples.export.library" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+<item elementID="=org.eclipse.emf.compare.examples.diff.extension" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+<item elementID="=org.eclipse.emf.compare.examples" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+<item elementID="=org.eclipse.emf.compare.examples.addressbook" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+<item elementID="=org.eclipse.emf.compare.examples.export.xslt" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+</workingSets>
+<workingSets editPageId="org.eclipse.jdt.ui.JavaWorkingSetPage" label="Features" name="Features">
+<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/org.eclipse.emf.compare.sdk-feature" type="4"/>
+<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/org.eclipse.emf.compare.team.subversive-feature" type="4"/>
+<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/org.eclipse.emf.compare.ui.capabilities-feature" type="4"/>
+<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/org.eclipse.emf.compare-feature" type="4"/>
+<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/org.eclipse.emf.compare.tests-feature" type="4"/>
+<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/org.eclipse.emf.compare.doc-feature" type="4"/>
+<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/org.eclipse.emf.compare.examples-feature" type="4"/>
+<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/org.eclipse.emf.compare.all-feature" type="4"/>
+</workingSets>
+<workingSets editPageId="org.eclipse.jdt.ui.JavaWorkingSetPage" label="Team Integration" name="Team Integration">
+<item elementID="=org.eclipse.emf.compare.team.subversive" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+</workingSets>
+<workingSets editPageId="org.eclipse.jdt.ui.JavaWorkingSetPage" label="Tests" name="Tests">
+<item elementID="=org.eclipse.emf.compare.tests" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+</workingSets>
+</psf> \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompareException.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompareException.java
new file mode 100644
index 000000000..edb478812
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompareException.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2011 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare;
+
+/**
+ * Exception thrown when a comparison launched from the GUI fails.
+ *
+ * @author <a href="mailto:cedric.brun@obeo.fr">Cedric Brun</a>
+ */
+public class EMFCompareException extends RuntimeException {
+ /** Serial used for unserialization checks. */
+ private static final long serialVersionUID = 5727212239745736313L;
+
+ /**
+ * Constructs a new runtime exception with the specified detail message.
+ *
+ * @param message
+ * The detail message. The detail message is saved for later retrieval by the
+ * {@link #getMessage()} method.
+ */
+ public EMFCompareException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new runtime exception wrapped around another exception.
+ *
+ * @param exception
+ * Exception to wrap within this new one.
+ */
+ public EMFCompareException(Throwable exception) {
+ super(exception);
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompareMessages.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompareMessages.java
new file mode 100755
index 000000000..19335c046
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompareMessages.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2011 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare;
+
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * Utility class to access externalized Strings for EMF Compare's core.
+ *
+ * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
+ */
+public final class EMFCompareMessages {
+ /** Full qualified path to the properties file in which to seek the keys. */
+ private static final String BUNDLE_NAME = "org.eclipse.emf.compare.emfcomparemessages"; //$NON-NLS-1$
+
+ /** Contains the locale specific {@link String}s needed by this plug-in. */
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
+
+ /**
+ * Utility classes don't need to (and shouldn't) be instantiated.
+ */
+ private EMFCompareMessages() {
+ // prevents instantiation
+ }
+
+ /**
+ * Returns a specified {@link String} from the resource bundle.
+ *
+ * @param key
+ * Key of the String we seek.
+ * @return The String from the resource bundle associated with <code>key</code>.
+ */
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+
+ /**
+ * Returns a String from the resource bundle bound with the given arguments.
+ *
+ * @param key
+ * Key of the String we seek.
+ * @param arguments
+ * Arguments for the String formatting.
+ * @return formatted {@link String}.
+ * @see MessageFormat#format(String, Object[])
+ */
+ public static String getString(String key, Object... arguments) {
+ if (arguments == null)
+ return getString(key);
+ return MessageFormat.format(getString(key), arguments);
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFComparePlugin.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFComparePlugin.java
new file mode 100644
index 000000000..ef96dd26c
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFComparePlugin.java
@@ -0,0 +1,192 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2011 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.emf.compare.util.EMFComparePreferenceConstants;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class, controls the plug-in life cycle.
+ *
+ * @author <a href="mailto:cedric.brun@obeo.fr">Cedric Brun</a>
+ */
+public class EMFComparePlugin extends Plugin {
+ /** The plugin ID. */
+ public static final String PLUGIN_ID = "org.eclipse.emf.compare"; //$NON-NLS-1$
+
+ /** Plug-in's shared instance. */
+ private static EMFComparePlugin plugin;
+
+ /**
+ * Default constructor.
+ */
+ public EMFComparePlugin() {
+ plugin = this;
+ }
+
+ /**
+ * Returns the plugin's shared instance.
+ *
+ * @return The plugin's shared instance.
+ */
+ public static EMFComparePlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Trace an Exception in the error log.
+ *
+ * @param e
+ * Exception to log.
+ * @param blocker
+ * <code>True</code> if the exception must be logged as error, <code>False</code> to log it as
+ * a warning.
+ */
+ public static void log(Exception e, boolean blocker) {
+ if (e == null) {
+ throw new NullPointerException(EMFCompareMessages.getString("EMFComparePlugin.LogNullException")); //$NON-NLS-1$
+ }
+
+ if (plugin == null) {
+ // We are out of eclipse. Prints the stack trace on standard error.
+ // CHECKSTYLE:OFF
+ e.printStackTrace();
+ // CHECKSTYLE:ON
+ } else if (e instanceof CoreException) {
+ log(((CoreException)e).getStatus());
+ } else if (e instanceof NullPointerException) {
+ int severity = IStatus.WARNING;
+ if (blocker) {
+ severity = IStatus.ERROR;
+ }
+ log(new Status(severity, PLUGIN_ID, severity,
+ EMFCompareMessages.getString("EMFComparePlugin.ElementNotFound"), e)); //$NON-NLS-1$
+ } else {
+ int severity = IStatus.WARNING;
+ if (blocker) {
+ severity = IStatus.ERROR;
+ }
+ log(new Status(severity, PLUGIN_ID, severity,
+ EMFCompareMessages.getString("EMFComparePlugin.JavaException"), e)); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Puts the given status in the error log view.
+ *
+ * @param status
+ * Error Status.
+ */
+ public static void log(IStatus status) {
+ // Eclipse platform displays NullPointer on standard error instead of throwing it.
+ // We'll handle this by throwing it ourselves.
+ if (status == null) {
+ throw new NullPointerException(EMFCompareMessages.getString("EMFComparePlugin.LogNullStatus")); //$NON-NLS-1$
+ }
+
+ if (getDefault() != null) {
+ getDefault().getLog().log(status);
+ } else
+ throw new EMFCompareException(status.getException());
+ }
+
+ /**
+ * Puts the given message in the error log view, as error or warning.
+ *
+ * @param message
+ * The message to put in the error log view.
+ * @param blocker
+ * <code>True</code> if the message must be logged as error, <code>False</code> to log it as a
+ * warning.
+ */
+ public static void log(String message, boolean blocker) {
+ if (plugin == null) {
+ // We are out of eclipse. Prints the message on standard error.
+ // CHECKSTYLE:OFF
+ System.err.println(message);
+ // CHECKSTYLE:ON
+ } else {
+ int severity = IStatus.WARNING;
+ if (blocker) {
+ severity = IStatus.ERROR;
+ }
+ String errorMessage = message;
+ if (errorMessage == null || "".equals(errorMessage)) { //$NON-NLS-1$
+ errorMessage = EMFCompareMessages.getString("EMFComparePlugin.UnexpectedException"); //$NON-NLS-1$
+ }
+ log(new Status(severity, PLUGIN_ID, errorMessage));
+ }
+ }
+
+ /**
+ * Returns the current value of the boolean-valued preference with the given key.
+ *
+ * @param preferenceKey
+ * Name of the property which value is to be retrieved.
+ * @return Current value of the boolean-valued preference with the given key.
+ */
+ public boolean getBoolean(String preferenceKey) {
+ return Platform.getPreferencesService().getBoolean(PLUGIN_ID, preferenceKey, false, null);
+ }
+
+ /**
+ * Returns the current value of the integer-valued preference with the given key.
+ *
+ * @param preferenceKey
+ * Name of the property which value is to be retrieved.
+ * @return Current value of the integer-valued preference with the given key.
+ */
+ public int getInt(String preferenceKey) {
+ return Platform.getPreferencesService().getInt(PLUGIN_ID, preferenceKey, 0, null);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see Plugin#start(BundleContext)
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ initializeDefaultPreferences();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see Plugin#stop(BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * This will initialize the core preferences to their default values.
+ */
+ private void initializeDefaultPreferences() {
+ final IEclipsePreferences defaultCorePreferences = new DefaultScope().getNode(PLUGIN_ID);
+ defaultCorePreferences.putInt(EMFComparePreferenceConstants.PREFERENCES_KEY_SEARCH_WINDOW,
+ EMFComparePreferenceConstants.PREFERENCES_DEFAULT_SEARCH_WINDOW);
+ /*
+ * "ignore ID", "ignore XMI ID", "distinct metamodel" and "Engine selection" are all initialized to
+ * false and don't need a default
+ */
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/FactoryException.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/FactoryException.java
new file mode 100755
index 000000000..5217700e3
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/FactoryException.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2011 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare;
+
+/**
+ * Factory Exception, indicates that an error occured during an {@link EFactory} operation.
+ *
+ * @author <a href="mailto:cedric.brun@obeo.fr">Cedric Brun</a>
+ */
+public class FactoryException extends Exception {
+ /** Serial used for unserialization checks. */
+ private static final long serialVersionUID = 51499898584684757L;
+
+ /**
+ * Instantiates a FactoryException given its error message.
+ *
+ * @param message
+ * Message associated to the exception.
+ */
+ public FactoryException(String message) {
+ super(message);
+ }
+
+ /**
+ * Instantiates a FactoryException wrapped around another exception.
+ *
+ * @param exception
+ * Exception to wrap within this new one.
+ */
+ public FactoryException(Throwable exception) {
+ super(exception);
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/emfcomparemessages.properties b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/emfcomparemessages.properties
new file mode 100755
index 000000000..80b4ec5b3
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/emfcomparemessages.properties
@@ -0,0 +1,38 @@
+################################################################################
+# Copyright (c) 2006, 2011 Obeo.
+# 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
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Obeo - initial API and implementation
+################################################################################
+## ! note ! The two parameterisable keys (EFactory.FeatureNotFound and
+## EMFCompareMap.IllegalLoadFactor) as well as 'EMFComparePlugin.ElementNotFound',
+## EMFComparePlugin.JavaException and EMFComparePlugin.UnexpectedException are used
+## by the core test suite and considered valid keys.
+## Update TestMessages test case accordingly if those keys are to be modified.
+
+# org.eclipse.emf.compare
+EMFComparePlugin.ElementNotFound=Required element not found.
+EMFComparePlugin.JavaException=A java exception has been thrown.
+EMFComparePlugin.LogNullStatus=Status to be logged cannot be null.
+EMFComparePlugin.LogNullException=Exception to be logged cannot be null.
+EMFComparePlugin.UnexpectedException=Unknown EMF Compare problem.
+
+# org.eclipse.emf.compare.util
+ClassUtils.NullArguments=Cannot test equality of null objects.
+
+EFactory.FactoryError=Factory error.
+EFactory.FeatureNotFound=The feature {0} does not exist in {1}.
+EFactory.UnSettableFeature=The feature {0} cannot be set.
+
+EMFCompareMap.NegativeCapacity=Cannot instantiate map with negative capacity.
+EMFCompareMap.IllegalLoadFactor=Illegal load factor for map: {0}.
+
+ModelUtils.LoadFailure=Unable to load model at {0}.
+ModelUtils.NullInputStream=Input Stream for the model to load cannot be null.
+ModelUtils.NullPath=Path cannot be null or empty.
+ModelUtils.NullSaveRoot=Cannot serialize null object.
+ModelUtils.NullRoot=Cannot attach 'null' to a resource. \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/package-info.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/package-info.java
new file mode 100644
index 000000000..ac0b381dc
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/package-info.java
@@ -0,0 +1,15 @@
+/*
+ * (non-javadoc)
+ * Copyright (c) 2006, 2011 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ */
+/**
+ * This package contains EMF Compare's core plug-in classes.
+ */
+package org.eclipse.emf.compare; \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/AdapterUtils.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/AdapterUtils.java
new file mode 100644
index 000000000..f65399158
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/AdapterUtils.java
@@ -0,0 +1,122 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2011 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
+
+/**
+ * Useful methods for EMF adapter factories handling.
+ *
+ * @author <a href="mailto:cedric.brun@obeo.fr">Cedric Brun</a>
+ */
+public final class AdapterUtils {
+ /**
+ * Adapter factory instance. This contains all factories registered in the global registry.
+ */
+ private static final ComposedAdapterFactory FACTORY = createAdapterFactory();
+
+ /**
+ * Utility classes don't need to (and shouldn't) be instantiated.
+ */
+ private AdapterUtils() {
+ // prevents instantiation.
+ }
+
+ /**
+ * This will try and return an adapter of the given type associated to the given EObject.
+ *
+ * @param <T>
+ * Type of the adapter to return.
+ * @param eObj
+ * The EObject we seek an adapter for.
+ * @param type
+ * The sought adapter's type.
+ * @return An associated adapter.
+ * @see AdapterFactory#adapt(Object, Object)
+ * @since 0.8
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> T adapt(EObject eObj, Class<? extends T> type) {
+ return (T)getAdapterFactory().adapt(eObj, type);
+ }
+
+ /**
+ * Returns a factory built with all the {@link AdapterFactory} instances available in the global registry.
+ *
+ * @return A factory built with all the {@link AdapterFactory} instances available in the global registry.
+ */
+ public static AdapterFactory getAdapterFactory() {
+ return FACTORY;
+ }
+
+ /**
+ * This will try and get the IItemLabelProvider associated to the given EObject if its ItemProviderFactory
+ * is registered, then return the image it provides.
+ *
+ * @param eObj
+ * EObject we need an image for.
+ * @return The Image provided by the IItemLabelProvider associated with <tt>eObj</tt>, <code>null</code>
+ * if it cannot be found.
+ * @see IItemLabelProvider#getImage(Object)
+ * @since 0.8
+ */
+ public static Object getItemProviderImage(EObject eObj) {
+ final IItemLabelProvider labelProvider = adapt(eObj, IItemLabelProvider.class);
+ if (labelProvider != null)
+ return labelProvider.getImage(eObj);
+ return null;
+ }
+
+ /**
+ * This will try and get the IItemLabelProvider associated to the given EObject if its ItemProviderFactory
+ * is registered, then return the text it provides.
+ *
+ * @param eObj
+ * EObject we need the text of.
+ * @return The text provided by the IItemLabelProvider associated with <tt>eObj</tt>, <code>null</code> if
+ * it cannot be found.
+ * @see IItemLabelProvider#getText(Object)
+ * @since 0.8
+ */
+ public static String getItemProviderText(EObject eObj) {
+ final String text;
+ if (eObj == null) {
+ text = "null"; //$NON-NLS-1$
+ } else {
+ final IItemLabelProvider labelProvider = adapt(eObj, IItemLabelProvider.class);
+ if (labelProvider != null) {
+ text = labelProvider.getText(eObj);
+ } else {
+ text = ""; //$NON-NLS-1$
+ }
+ }
+ return text;
+ }
+
+ /**
+ * Returns an adapter factory containing all the global EMF registry's factories.
+ *
+ * @return An adapter factory made of all the adapter factories declared in the registry.
+ */
+ private static ComposedAdapterFactory createAdapterFactory() {
+ final List<AdapterFactory> factories = new ArrayList<AdapterFactory>();
+ factories.add(new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE));
+ factories.add(new ReflectiveItemProviderAdapterFactory());
+ return new ComposedAdapterFactory(factories);
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/ClassUtils.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/ClassUtils.java
new file mode 100755
index 000000000..182323871
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/ClassUtils.java
@@ -0,0 +1,168 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2011 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.util;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import org.eclipse.emf.compare.EMFCompareMessages;
+
+/**
+ * Provides utility methods to get information on {@link Class} objects.
+ *
+ * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
+ */
+public final class ClassUtils {
+ /** These are all the primitive classes. */
+ private static final Class<?>[] PRIMITIVES = {short.class, int.class, long.class, byte.class, char.class,
+ boolean.class, float.class, double.class, void.class, };
+
+ /** These are all the wrapper classes for primitive types. */
+ private static final Class<?>[] WRAPPERS = {Short.class, Integer.class, Long.class, Byte.class,
+ Character.class, Boolean.class, Float.class, Double.class, Void.class, };
+
+ /**
+ * Utility classes don't need to (and shouldn't) be instantiated.
+ */
+ private ClassUtils() {
+ // prevents instantiation
+ }
+
+ /**
+ * This will test equality between two classes.
+ * <p>
+ * We'll assume that primitives types are equal to their wrappers so that
+ * <code>parameterEquals(java.lang.Integer, int)</code> returns <code>True</code>.
+ * </p>
+ *
+ * @param class1
+ * First of the two classes to test for equality.
+ * @param class2
+ * Second of the two classes to test for equality.
+ * @return <code>True</code> if the two classes are considered equal, <code>False</code> otherwise.
+ */
+ public static boolean classEquals(Class<?> class1, Class<?> class2) {
+ if (class1 == null || class2 == null)
+ throw new IllegalArgumentException(EMFCompareMessages.getString("ClassUtils.NullArguments")); //$NON-NLS-1$
+
+ boolean result = false;
+ if (class1 != class2 && !class1.equals(class2)) {
+ if (class1.isPrimitive()) {
+ for (int i = 0; i < PRIMITIVES.length; i++) {
+ if (class1.equals(PRIMITIVES[i])) {
+ result = class2.equals(WRAPPERS[i]);
+ break;
+ }
+ }
+ } else if (class2.isPrimitive()) {
+ for (int i = 0; i < PRIMITIVES.length; i++) {
+ if (class2.equals(PRIMITIVES[i])) {
+ result = class1.equals(WRAPPERS[i]);
+ break;
+ }
+ }
+ }
+ } else {
+ result = true;
+ }
+ return result;
+ }
+
+ /**
+ * Iterates through a given {@link Class} public {@link Method}s to determine if it declares a method of
+ * the given name and parameters.
+ *
+ * @param clazz
+ * {@link Class} to visit.
+ * @param methodName
+ * Name of the method we search for.
+ * @param parameters
+ * Types of the researched method parameters.
+ * @return <code>True</code> if the given {@link Class} object declares a {@link Method} called
+ * <code>methodName</code>.
+ */
+ public static boolean hasMethod(Class<?> clazz, String methodName, Class<?>... parameters) {
+ return getMethod(clazz, methodName, parameters) != null;
+ }
+
+ /**
+ * Convenience method to reflectively invoke a given method on the given object with the given parameters.
+ * This implementation takes care of checking if the method exists beforehand and will return
+ * <code>null</code> if it does not.
+ *
+ * @param object
+ * Invocation target.
+ * @param methodName
+ * Name of the method to invoke.
+ * @param parameters
+ * Parameters with which to invoke the method.
+ * @return Result of the invocation or <code>null</code> if the method does not exist according to
+ * {@link #hasMethod(Class, String, Class...)}.
+ */
+ public static Object invokeMethod(Object object, String methodName, Object... parameters) {
+ Object result = null;
+ final Class<?>[] parameterTypes = new Class<?>[parameters.length];
+ for (int i = 0; i < parameters.length; i++)
+ parameterTypes[i] = parameters[i].getClass();
+
+ try {
+ if (hasMethod(object.getClass(), methodName, parameterTypes)) {
+ final Method method = getMethod(object.getClass(), methodName, parameterTypes);
+ result = method.invoke(object, parameters);
+ }
+ } catch (InvocationTargetException e) {
+ // Should never be here, check ClassUtils#hasMethod(Class, String)
+ assert false;
+ } catch (IllegalAccessException e) {
+ // Should never be here, check ClassUtils#hasMethod(Class, String)
+ assert false;
+ }
+ return result;
+ }
+
+ /**
+ * Iterates through a given {@link Class} public {@link Method}s to determine if it declares a method of
+ * the given name and parameters and returns it if it does.
+ *
+ * @param clazz
+ * {@link Class} to visit.
+ * @param methodName
+ * Name of the method we search for.
+ * @param parameters
+ * Types of the researched method parameters.
+ * @return The method we were searching for if existing, <code>null</code> otherwise.
+ */
+ private static Method getMethod(Class<?> clazz, String methodName, Class<?>... parameters) {
+ Method soughtMethod = null;
+ /*
+ * We use Class#getMethods() instead of Class#getDeclaredMethods() to avoid protected, private and
+ * default (package) methods.
+ */
+ final Method[] methods = clazz.getMethods();
+ for (final Method method : methods) {
+ if (method.getName().equals(methodName)) {
+ final Class<?>[] params = method.getParameterTypes();
+ if (parameters.length == params.length) {
+ soughtMethod = method;
+ for (int i = 0; i < params.length; i++) {
+ if (!classEquals(parameters[i], params[i])) {
+ soughtMethod = null;
+ break;
+ }
+ }
+ if (soughtMethod != null)
+ break;
+ }
+ }
+ }
+ return soughtMethod;
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/EFactory.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/EFactory.java
new file mode 100644
index 000000000..80b7c8399
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/EFactory.java
@@ -0,0 +1,328 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2011 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.util;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.common.util.BasicEList;
+import org.eclipse.emf.compare.EMFCompareMessages;
+import org.eclipse.emf.compare.FactoryException;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EEnumLiteral;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * This is a factory for an ecore metamodel. There is a factory by package. Each factory is used to create
+ * instances of classifiers.
+ *
+ * @author <a href="mailto:cedric.brun@obeo.fr">Cedric Brun</a>
+ */
+public final class EFactory {
+ /**
+ * Utility classes don't need to (and shouldn't) be instantiated.
+ */
+ private EFactory() {
+ // prevents instantiation
+ }
+
+ /**
+ * Adds the new value of the given feature of the object. If the structural feature isn't a list, it
+ * behaves like eSet.
+ *
+ * @param object
+ * Object on which we want to add to the feature values list.
+ * @param name
+ * The name of the feature to add to.
+ * @param arg
+ * New value to add to the feature values.
+ * @param <T>
+ * Type of the new value to be added to the list.
+ * @throws FactoryException
+ * Thrown if the affectation fails.
+ */
+ public static <T> void eAdd(EObject object, String name, T arg) throws FactoryException {
+ eAdd(object, name, arg, -1);
+ }
+
+ /**
+ * Adds the new value of the given feature of the object. If the structural feature isn't a list, it
+ * behaves like eSet.
+ *
+ * @param object
+ * Object on which we want to add to the feature values list.
+ * @param name
+ * The name of the feature to add to.
+ * @param arg
+ * New value to add to the feature values.
+ * @param <T>
+ * Type of the new value to be added to the list.
+ * @param elementIndex
+ * in case the feature is multiplicity-many, specify the index where the new value has to be
+ * added. If the index is -1, the value will be appended to the feature list.
+ * @throws FactoryException
+ * Thrown if the affectation fails.
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> void eAdd(EObject object, String name, T arg, int elementIndex) throws FactoryException {
+ final EStructuralFeature feature = eStructuralFeature(object, name);
+ if (feature.isMany()) {
+ if (arg != null) {
+ final Object manyValue = object.eGet(feature);
+ if (manyValue instanceof BasicEList) {
+ final BasicEList<? super T> basicEList = (BasicEList<? super T>)manyValue;
+ final int listSize = basicEList.size();
+ if (elementIndex > -1 && elementIndex < listSize) {
+ basicEList.addUnique(elementIndex, arg);
+ } else {
+ basicEList.addUnique(arg);
+ }
+ } else if (manyValue instanceof Collection) {
+ ((Collection)manyValue).add(arg);
+ }
+ }
+ } else {
+ eSet(object, name, arg);
+ }
+ }
+
+ /**
+ * Adds the new value of the given feature of the object at the given index. If the structural feature
+ * isn't a list, it behaves like eSet and the index is ignored.
+ *
+ * @param object
+ * Object on which we want to add to the feature values list.
+ * @param name
+ * The name of the feature to add to.
+ * @param arg
+ * New value to add to the feature values.
+ * @param insertionIndex
+ * Index in the list at which the new value is to be added.
+ * @param <T>
+ * Type of the new value to be added to the list.
+ * @throws FactoryException
+ * Thrown if the affectation fails.
+ * @since 1.0
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> void eInsertAt(EObject object, String name, T arg, int insertionIndex)
+ throws FactoryException {
+ final EStructuralFeature feature = eStructuralFeature(object, name);
+ if (feature.isMany()) {
+ final List<? super T> target = (List<? super T>)object.eGet(feature);
+ int actualIndex = insertionIndex;
+ if (insertionIndex < 0) {
+ actualIndex = 0;
+ } else if (insertionIndex > target.size()) {
+ actualIndex = target.size();
+ }
+ if (arg != null) {
+ target.add(actualIndex, arg);
+ }
+ } else {
+ eSet(object, name, arg);
+ }
+ }
+
+ /**
+ * Gets the value of the given feature of the object.
+ *
+ * @param object
+ * Object to retrieve the feature value from.
+ * @param name
+ * The feature name, or a method defined on {@link EObject} like 'eClass', 'eResource',
+ * 'eContainer', 'eContainingFeature', 'eContainmentFeature', 'eContents', 'eAllContents',
+ * 'eCrossReferences'
+ * @return Value of the given feature of the object
+ * @throws FactoryException
+ * Thrown if the retrieval fails.
+ */
+ public static Object eGet(EObject object, String name) throws FactoryException {
+ Object result = null;
+ try {
+ final EStructuralFeature feature = eStructuralFeature(object, name);
+ result = object.eGet(feature);
+ } catch (FactoryException eGet) {
+ try {
+ result = eCall(object, name);
+ } catch (FactoryException eCall) {
+ throw eGet;
+ } catch (NullPointerException e) {
+ // Thrown if "name" is null
+ throw eGet;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Gets the value of the given feature of the object as a List.
+ *
+ * @param object
+ * Object to retrieve the feature value from.
+ * @param name
+ * Name of the feature to get the value for.
+ * @return <ul>
+ * If the feature is :
+ * <li><b>a list :</b> value of the feature</li>
+ * <li><b>a single valued feature :</b> new list containing the value as its single element</li>
+ * <li><b>not a feature :</b> <code>null</code></li>
+ * </ul>
+ * @throws FactoryException
+ * Thrown if the retrieval fails.
+ */
+ @SuppressWarnings("unchecked")
+ public static List<?> eGetAsList(EObject object, String name) throws FactoryException {
+ List<Object> list = new ArrayList<Object>();
+ final Object eGet = eGet(object, name);
+ if (eGet != null) {
+ if (eGet instanceof List) {
+ list = (List<Object>)eGet;
+ } else {
+ list = new BasicEList<Object>(1);
+ list.add(eGet);
+ }
+ }
+ return list;
+ }
+
+ /**
+ * Gets the value of the given feature of the object as a String.
+ *
+ * @param object
+ * Object to retrieve the feature value from.
+ * @param name
+ * Name of the feature to get the value for.
+ * @return Value of the feature, <code>null</code> if this value isn't a {@link String}.
+ * @throws FactoryException
+ * Thrown if the retrieval fails.
+ */
+ public static String eGetAsString(EObject object, String name) throws FactoryException {
+ final Object eGet = eGet(object, name);
+ if (eGet != null)
+ return eGet.toString();
+ return null;
+ }
+
+ /**
+ * Removes the value of the given feature of the object. If the structural feature isn't a list, it
+ * behaves like eSet(object, name, null) and resets the feature even if specified value isn't equal to the
+ * actual feature's value.
+ *
+ * @param object
+ * Object on which we want to remove from the feature values list.
+ * @param name
+ * The name of the feature to remove from.
+ * @param arg
+ * Value to remove from the feature values, can be <code>null</code>.
+ * @throws FactoryException
+ * Thrown if the removal fails.
+ */
+ public static void eRemove(EObject object, String name, Object arg) throws FactoryException {
+ final Object list = object.eGet(eStructuralFeature(object, name));
+ if (list instanceof List) {
+ if (arg != null) {
+ ((List<?>)list).remove(arg);
+ }
+ } else {
+ eSet(object, name, null);
+ }
+ }
+
+ /**
+ * Sets the value of the given feature of the object to the new value.
+ *
+ * @param object
+ * Object on which we want to set the feature value.
+ * @param name
+ * The name of the feature to set.
+ * @param arg
+ * New value to affect to the feature.
+ * @throws FactoryException
+ * Thrown if the affectation fails.
+ */
+ public static void eSet(EObject object, String name, Object arg) throws FactoryException {
+ final EStructuralFeature feature = eStructuralFeature(object, name);
+ if (!feature.isChangeable())
+ throw new FactoryException(EMFCompareMessages.getString("EFactory.UnSettableFeature", name)); //$NON-NLS-1$
+
+ if (feature.getEType() instanceof EEnum && arg instanceof String) {
+ final EEnumLiteral literal = ((EEnum)feature.getEType()).getEEnumLiteral((String)arg);
+ object.eSet(feature, literal);
+ } else {
+ if (arg == null && feature.isMany())
+ object.eSet(feature, Collections.EMPTY_LIST);
+ else if (arg == null)
+ object.eSet(feature, feature.getDefaultValue());
+ else
+ object.eSet(feature, arg);
+ }
+ }
+
+ /**
+ * Gets the structural feature of the given feature name of the object.
+ *
+ * @param object
+ * Object to retrieve the feature from.
+ * @param name
+ * Name of the feature to retrieve.
+ * @return The structural feature <code>name</code> of <code>object</code>.
+ * @throws FactoryException
+ * Thrown if the retrieval fails.
+ */
+ public static EStructuralFeature eStructuralFeature(EObject object, String name) throws FactoryException {
+ final EStructuralFeature structuralFeature = object.eClass().getEStructuralFeature(name);
+ if (structuralFeature != null)
+ return structuralFeature;
+ throw new FactoryException(EMFCompareMessages.getString(
+ "EFactory.FeatureNotFound", name, object.eClass().getName())); //$NON-NLS-1$
+ }
+
+ /**
+ * This will call the method called <code>name</code> on the given <code>object</code> with the given
+ * <code>arg</code>uments.
+ *
+ * @param object
+ * Object to call method <code>name</code> on.
+ * @param name
+ * Name of the method to call on <code>object</code>.
+ * @param arg
+ * Arguments to pass to the method invocation.
+ * @return The result of <code>name</code> invocation.
+ * @throws FactoryException
+ * Thrown if the invocation fails somehow.
+ */
+ @SuppressWarnings("unchecked")
+ private static Object eCall(Object object, String name, Object... arg) throws FactoryException {
+ try {
+ final Class<? extends Object>[] methodParams = new Class[arg.length];
+ final Object[] invocationParams = arg;
+
+ for (int i = 0; i < arg.length; i++) {
+ methodParams[i] = arg[i].getClass();
+ }
+
+ final Method method = object.getClass().getMethod(name, methodParams);
+ return method.invoke(object, invocationParams);
+ } catch (NoSuchMethodException e) {
+ throw new FactoryException(e.getMessage());
+ } catch (IllegalAccessException e) {
+ throw new FactoryException(e.getMessage());
+ } catch (InvocationTargetException e) {
+ throw new FactoryException(e.getMessage());
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/EMFCompareMap.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/EMFCompareMap.java
new file mode 100644
index 000000000..de07c83d4
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/EMFCompareMap.java
@@ -0,0 +1,1254 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2011 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.util;
+
+import java.io.Serializable;
+import java.util.AbstractSet;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.ConcurrentModificationException;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.emf.compare.EMFCompareMessages;
+
+/**
+ * Implementation of a map that stores its content using an hash table.
+ * <p>
+ * <it>Initial capacity</it> and <it>load factor</it> greatly affect the map's performances. <it>Capacity</it>
+ * is the number of elements the map can contain and the <it>load factor</it> represents how much the hash
+ * table can be filled before it is automatically rehashed.
+ * </p>
+ * <p>
+ * This implementation ensures the capacity of this Map is a prime number at all time.
+ * </p>
+ *
+ * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
+ * @param <K>
+ * Specifies the keys' class for this Map.
+ * @param <V>
+ * Specifies the values' class for this Map.
+ */
+@SuppressWarnings("unchecked")
+public class EMFCompareMap<K, V> implements Map<K, V>, Serializable, Cloneable {
+ /** Default value used as the initial capacity for a Map. */
+ protected static final int DEFAULT_INITIAL_CAPACITY = 31;
+
+ /** The load factor used when none specified in constructor. * */
+ protected static final float DEFAULT_LOAD_FACTOR = 0.6f;
+
+ /** Minimal allowed load factor for the map. */
+ protected static final float MINIMUM_LOAD_FACTOR = 0.05f;
+
+ /** Object used as key for the <code>null</code> key. */
+ protected static final Object NULL_KEY = new Object();
+
+ /** Object used as key for the "removed" entries of this Map. */
+ protected static final Object REMOVED_ENTRY = new Object();
+
+ /** First hundred primes. Used to compute the next prime. */
+ private static final int[] FIRST_PRIMES = new int[] {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43,
+ 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, };
+
+ /**
+ * Primes that will be used one after the other when using an initial capacity of 31. This lists extends
+ * up to {@link Integer#MAX_VALUE} as it is a prime.
+ */
+ private static final int[] DEFAULT_PRIME_LIST = new int[] {31, 67, 137, 277, 557, 1117, 2237, 4481, 8963,
+ 17929, 35863, 71741, 143483, 286973, 573953, 1147921, 2295859, 4591721, 9183457, 18366923,
+ 36733847, 73467739, 146935499, 293871013, 587742049, 1175484103, Integer.MAX_VALUE, };
+
+ /** Serial number of this map. Used for checks upon deserialization. */
+ private static final long serialVersionUID = -890704446117047482L;
+
+ /** Current number of free buckets this Map holds. */
+ protected int freeSlots;
+
+ /** Keys of this Map's entries. */
+ protected transient K[] keys;
+
+ /** Load factor of this Map. */
+ protected float loadFactor = DEFAULT_LOAD_FACTOR;
+
+ /** Index of the next prime in the primes list. */
+ protected int nextPrimeIndex;
+
+ /** Threshold for resizing. */
+ protected int threshold;
+
+ /** Current number of non-empty slots. */
+ protected transient int usedSlots;
+
+ /** Values contained within this Map. */
+ protected transient V[] values;
+
+ /**
+ * Constructs an empty <code>EMFCompareMap</code> with the default initial capacity (31) and the default
+ * load factor (0.75).
+ */
+ public EMFCompareMap() {
+ // We know the initial capacity will be a prime equal to DEFAULT_INITIAL_CAPACITY
+ nextPrimeIndex++;
+ threshold = (int)(DEFAULT_INITIAL_CAPACITY * DEFAULT_LOAD_FACTOR - 1);
+ freeSlots = threshold;
+ keys = (K[])new Object[DEFAULT_INITIAL_CAPACITY];
+ values = (V[])new Object[DEFAULT_INITIAL_CAPACITY];
+ }
+
+ /**
+ * Constructs an empty <code>EMFCompareMap</code> with the specified initial capacity and the default load
+ * factor (0.75). This class will automatically use <code>{@value #MINIMAL_INITIAL_CAPACITY}</code> as the
+ * Map's initial capacity if <code>initialCapacity</code> is lower.
+ *
+ * @param initialCapacity
+ * Initial capacity of the Map.
+ */
+ public EMFCompareMap(int initialCapacity) {
+ this(initialCapacity, DEFAULT_LOAD_FACTOR);
+ }
+
+ /**
+ * Constructs an empty <code>EMFCompareMap</code> with the specified initial capacity and load factor.This
+ * class will automatically use <code>{@value #MINIMAL_INITIAL_CAPACITY}</code> as the Map's initial
+ * capacity if <code>initialCapacity</code> is lower.
+ *
+ * @param initialCapacity
+ * Initial capacity of the Map.
+ * @param theLoadFactor
+ * Load factor to apply to this Map.
+ */
+ public EMFCompareMap(int initialCapacity, float theLoadFactor) {
+ if (initialCapacity < 0)
+ throw new IllegalArgumentException(EMFCompareMessages.getString("EMFCompareMap.NegativeCapacity")); //$NON-NLS-1$
+ if (theLoadFactor <= 0 || Float.isNaN(theLoadFactor))
+ throw new IllegalArgumentException(EMFCompareMessages.getString(
+ "EMFCompareMap.IllegalLoadFactor", theLoadFactor)); //$NON-NLS-1$
+
+ loadFactor = theLoadFactor;
+ final int newCapacity = getNearestPrime((int)(initialCapacity / Math.max(MINIMUM_LOAD_FACTOR,
+ loadFactor)));
+ changeCapacity(newCapacity);
+ keys = (K[])new Object[newCapacity];
+ values = (V[])new Object[newCapacity];
+ }
+
+ /**
+ * Construcs a <code>EMFCompareMap</code> populated by the entries of <code>map</code>.
+ *
+ * @param map
+ * The map whose mappings are to be placed in this map.
+ */
+ public EMFCompareMap(Map<K, V> map) {
+ this(map.size());
+ putAll(map);
+ }
+
+ /**
+ * Removes all mappings from this Map.
+ */
+ public void clear() {
+ if (size() == 0)
+ return;
+
+ usedSlots = 0;
+ freeSlots = capacity();
+ for (int i = 0; i < keys.length; i++) {
+ keys[i] = null;
+ values[i] = null;
+ }
+ }
+
+ /**
+ * Returns a copy of this Map containing all its elements.
+ *
+ * @return A clone of this instance.
+ */
+ @Override
+ public Object clone() {
+ try {
+ final EMFCompareMap<K, V> map = (EMFCompareMap<K, V>)super.clone();
+ map.putAll(this);
+ return map;
+ } catch (final CloneNotSupportedException e) {
+ // should be supported
+ return null;
+ }
+ }
+
+ /**
+ * Returns <code>True</code> if the Map contains a mapping for the specified key.
+ *
+ * @param key
+ * The key whose presence in this Map is to be tested.
+ * @return <code>True</code> if the Map contains a mapping for <code>key</code>, <code>False</code>
+ * otherwise.
+ */
+ public boolean containsKey(Object key) {
+ return indexOf(key) >= 0;
+ }
+
+ /**
+ * Checks for a mapping to the specified value in the Map.
+ *
+ * @param value
+ * Value whose presence is to be tested.
+ * @return <code>True</code> if the Map contains a mapping to <code>value</code>, <code>False</code>
+ * otherwise.
+ */
+ public boolean containsValue(Object value) {
+ boolean result = false;
+ for (int i = 0; i < keys.length; i++) {
+ if (keys[i] != null && keys[i] != REMOVED_ENTRY) {
+ if (value == null && values[i] == null) {
+ result = true;
+ break;
+ } else if (value != null
+ && (values[i] == value || (values[i] != null && values[i].equals(value)))) {
+ result = true;
+ break;
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.Map#entrySet()
+ */
+ public Set<Map.Entry<K, V>> entrySet() {
+ return new EntrySet();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object another) {
+ boolean result = false;
+ if (another == this) {
+ result = true;
+ } else if (another instanceof Map && ((Map)another).size() == size()) {
+ // Two empty maps are considered equal regardless of the implementation
+ if (size() == 0) {
+ result = true;
+ }
+ for (final Map.Entry<K, V> entry : entrySet()) {
+ if (((Map)another).containsKey(entry.getKey())) {
+ final Object otherValue = ((Map)another).get(entry.getKey());
+ result = equal(otherValue, entry.getValue());
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Retrieves the value to which the specified key is mapped.
+ *
+ * @param key
+ * The key whose associated value is to be returned.
+ * @return Value mapped to <code>key</code>, <code>null</code> if none.
+ */
+ public V get(Object key) {
+ final int index = indexOf(key);
+ if (index < 0)
+ return null;
+ return values[index];
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ int hash = 0;
+ for (final Map.Entry<K, V> entry : entrySet()) {
+ hash += entry.hashCode();
+ }
+ return hash;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.Map#isEmpty()
+ */
+ public boolean isEmpty() {
+ return size() == 0;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.Map#keySet()
+ */
+ public Set<K> keySet() {
+ return new KeySet();
+ }
+
+ /**
+ * Associates the specified key with the specified value in the Map. If a value was already associated to
+ * this key, it is replaced and returned.
+ *
+ * @param key
+ * Key with which the value will be associated.
+ * @param value
+ * Value to associate with the key.
+ * @return The previous value associated with <code>key</code>. <code>Null</code> if there were none or
+ * <code>null</code> was associated.
+ * @see java.util.Map#put(java.lang.Object, java.lang.Object)
+ */
+ public V put(K key, V value) {
+ K effectiveKey = key;
+ if (key == null) {
+ effectiveKey = (K)NULL_KEY;
+ }
+
+ V oldValue = null;
+ boolean usedFreeSlot;
+
+ int index = insertionIndexFor(effectiveKey);
+ boolean isNewMapping = true;
+ if (index < 0) {
+ index = -index - 1;
+ oldValue = values[index];
+ isNewMapping = false;
+ }
+ usedFreeSlot = keys[index] == null;
+ keys[index] = effectiveKey;
+ values[index] = value;
+ if (isNewMapping) {
+ postInsert(usedFreeSlot);
+ }
+
+ return oldValue;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.Map#putAll(java.util.Map)
+ */
+ public void putAll(Map<? extends K, ? extends V> map) {
+ checkCapacity(map.size());
+ for (final Map.Entry<? extends K, ? extends V> entry : map.entrySet()) {
+ put(entry.getKey(), entry.getValue());
+ }
+ }
+
+ /**
+ * Removes the mapping for this key from this Map if present.
+ *
+ * @param key
+ * Key whose mapping is to be removed.
+ * @return The old value mapped to <code>key</code>.
+ */
+ public V remove(Object key) {
+ Object effectiveKey = key;
+ if (key == null) {
+ effectiveKey = NULL_KEY;
+ }
+
+ V oldValue = null;
+ final int index = indexOf(effectiveKey);
+ if (index >= 0) {
+ oldValue = values[index];
+ removeEntryForIndex(index);
+ }
+ return oldValue;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.Map#size()
+ */
+ public int size() {
+ return usedSlots;
+ }
+
+ /**
+ * Returns a String representation of this Map.
+ *
+ * @return A String representation of this Map.
+ */
+ @Override
+ public String toString() {
+ final StringBuilder buf = new StringBuilder();
+ buf.append("{"); //$NON-NLS-1$
+
+ final Iterator<Map.Entry<K, V>> i = entrySet().iterator();
+ boolean hasNext = i.hasNext();
+ while (hasNext) {
+ final Map.Entry<K, V> e = i.next();
+ buf.append(e.toString());
+ hasNext = i.hasNext();
+ if (hasNext) {
+ buf.append(", "); //$NON-NLS-1$
+ }
+ }
+
+ buf.append("}"); //$NON-NLS-1$
+ return buf.toString();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.Map#values()
+ */
+ public Collection<V> values() {
+ return new ValueSet();
+ }
+
+ /**
+ * Returns the current capacity of the Map.
+ *
+ * @return The current capacity of the Map.
+ */
+ protected int capacity() {
+ return keys.length;
+ }
+
+ /**
+ * Modifies the capacity of this Map. This computes the new maximum size and number of free slots.
+ *
+ * @param newCapacity
+ * Capacity from which to compute the maximum capacity and the new number of free slots.
+ */
+ protected void changeCapacity(int newCapacity) {
+ threshold = newCapacity - 1;
+ final int candidate = (int)Math.floor(newCapacity * loadFactor);
+ if (candidate < threshold) {
+ threshold = candidate;
+ }
+ freeSlots = newCapacity - usedSlots;
+ }
+
+ /**
+ * Ensures the map has sufficient empty slots to hold <code>desiredSlots</code> additional elements and
+ * resizes it if needed.
+ *
+ * @param desiredSlots
+ * Desired number of additional elements.
+ */
+ protected void checkCapacity(int desiredSlots) {
+ if (desiredSlots > (threshold - size())) {
+ resize(getNearestPrime((int)Math.ceil(desiredSlots + size() / loadFactor) + 1));
+ }
+ }
+
+ /**
+ * Returns <code>True</code> if the two object are equal.
+ *
+ * @param obj1
+ * First of the objects to compare.
+ * @param obj2
+ * Second of the objects to compare.
+ * @return <code>True</code> if the two object are equal, <code>False</code> otherwise.
+ */
+ protected boolean equal(Object obj1, Object obj2) {
+ if (obj1 == null)
+ return obj2 == null;
+ return obj1.equals(obj2);
+ }
+
+ /**
+ * Finds the nearest pseudo-prime greater than <code>number</code>. Based on Rabin-Miller primality test.
+ *
+ * @param number
+ * Number we will use as a starting point to find a greater prime.
+ * @return First pseudo-prime greater than <code>number</code>
+ */
+ protected int getNearestPrime(int number) {
+ if (nextPrimeIndex > 0)
+ return DEFAULT_PRIME_LIST[nextPrimeIndex++];
+
+ // Any number below 2 will have its nearest prime equal to 2.
+ final int isPrime;
+ if (number <= 2) {
+ isPrime = 2;
+ } else {
+ isPrime = Math.abs(number);
+ }
+ int nearestPrime = -1;
+
+ if (isPrime < 100 && Arrays.binarySearch(FIRST_PRIMES, isPrime) >= 0) {
+ nearestPrime = isPrime;
+ } else if ((isPrime & 1) == 0) {
+ nearestPrime = getNearestPrime(isPrime + 1);
+ } else if (isPrime % 6 != 1 && isPrime % 6 != 5) {
+ nearestPrime = getNearestPrime(isPrime + 5 - (isPrime % 6));
+ } else {
+ for (final int prime : FIRST_PRIMES) {
+ if (isPrime % prime == 0) {
+ nearestPrime = getNearestPrime(isPrime + 2);
+ }
+ }
+
+ if (nearestPrime == -1) {
+ int d = isPrime - 1;
+ int r = 1;
+
+ // Calculates d and r
+ while ((d & 1) == 0) {
+ d >>= 1;
+ r += 1;
+ }
+
+ // Tests the number x times (increasing this loop's range increases probability of the number
+ // being a prime)
+ final int loops = 10;
+ for (int i = 0; i < loops; i++) {
+ // Calculates (a^d mod n) where a is a random number
+ int y = (int)Math.pow(Math.random() * isPrime + 1, d) % isPrime;
+
+ // if y equals 1, it passed the test
+ if (y == 1) {
+ continue;
+ }
+
+ boolean pass = false;
+ for (int j = 1; j < r; j++) {
+ if (y != (isPrime - 1)) {
+ pass = true;
+ break;
+ }
+ y = (int)Math.pow(y, 2) % isPrime;
+ }
+ // number didn't pass the test. We'll test again with the next possible
+ if (!pass) {
+ nearestPrime = getNearestPrime(isPrime + 2);
+ }
+ }
+ }
+ // If we are here, number passed the test 10 times. It is most likely a prime
+ if (nearestPrime == -1) {
+ nearestPrime = isPrime;
+ }
+ }
+ return nearestPrime;
+ }
+
+ /**
+ * Determines the index of the specified key in the <code>keys</code> array.
+ *
+ * @param key
+ * Key whose index is to be fetched.
+ * @return The index of the specified key, <code>-1</code> if inexistant.
+ */
+ protected int indexOf(Object key) {
+ Object effectiveKey = key;
+ if (key == null) {
+ effectiveKey = NULL_KEY;
+ }
+
+ final int mask = 0x7fffffff;
+ final int hash = effectiveKey.hashCode() & mask;
+ final int length = keys.length;
+ int index = hash % length;
+ K current = keys[index];
+
+ if (current != null && (current == REMOVED_ENTRY || !equal(current, effectiveKey))) {
+ final int hashProbe = 1 + (hash % (length - 2));
+
+ while (current != null && (current == REMOVED_ENTRY || !equal(current, effectiveKey))) {
+ index -= hashProbe;
+ if (index < 0) {
+ index += length;
+ }
+ current = keys[index];
+ }
+ }
+
+ if (current == null)
+ return -1;
+ return index;
+ }
+
+ /**
+ * Returns the index at which <code>key</code> can be inserted. If such a key already exists, returns its
+ * negative value minus 1.
+ *
+ * @param key
+ * Key to be inserted.
+ * @return The index at which <code>key</code> can be inserted. If such a key already exists, returns its
+ * negative value minus 1.
+ */
+ protected int insertionIndexFor(K key) {
+ // Key cannot be null here, it is either an object or NULL_KEY
+
+ final int mask = 0x7fffffff;
+ final int hash = key.hashCode() & mask;
+ final int length = keys.length;
+ int index = hash % length;
+ K current = keys[index];
+
+ if (current == null)
+ return index;
+ else if (current != REMOVED_ENTRY && equal(current, key))
+ // Key is already stored
+ return -index - 1;
+ else {
+ // This slot is already associated.
+ final int hashProbe = 1 + (hash % (length - 2));
+
+ if (current != REMOVED_ENTRY) {
+ while (current != null && current != REMOVED_ENTRY && !equal(current, key)) {
+ index -= hashProbe;
+ if (index < 0) {
+ index += length;
+ }
+ current = keys[index];
+ }
+ }
+
+ if (current == REMOVED_ENTRY) {
+ final int removedIndex = index;
+ while (current != null && (current == REMOVED_ENTRY || !equal(current, key))) {
+ index -= hashProbe;
+ if (index < 0) {
+ index += length;
+ }
+ current = keys[index];
+ }
+ // if we didn't find a free slot, we'll use a "removed" one
+ if (current == null) {
+ index = removedIndex;
+ }
+ }
+ }
+ if (current != null)
+ return -index - 1;
+ return index;
+ }
+
+ /**
+ * Called after an insert to update the used and free slots information and rehash the map if needed.
+ *
+ * @param usedFreeSlot
+ * Indicates whether the insert used up a free slot.
+ */
+ protected void postInsert(boolean usedFreeSlot) {
+ if (usedFreeSlot) {
+ freeSlots--;
+ }
+ usedSlots++;
+
+ // If there isn't any space left in the table, expand table.
+ if (usedSlots > threshold || freeSlots == 0) {
+ final int newCapacity = getNearestPrime(capacity() << 1);
+ resize(newCapacity);
+ }
+ }
+
+ /**
+ * Removes the specified entry from this Map. This is only called from EntrySet.
+ *
+ * @param e
+ * Entry to be removed from the Map.
+ * @return The old entry.
+ */
+ protected Map.Entry<K, V> removeEntry(Object e) {
+ Map.Entry<K, V> result;
+ if (!(e instanceof Map.Entry)) {
+ result = null;
+ } else {
+ final Map.Entry<K, V> entry = (Map.Entry<K, V>)e;
+ final V oldValue = remove(entry.getKey());
+ if (oldValue == null && entry.getValue() != null) {
+ result = null;
+ } else {
+ result = entry;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Removes the mapping at <code>index</code> from this Map.
+ *
+ * @param index
+ * Index of the mapping to be removed.
+ */
+ protected void removeEntryForIndex(int index) {
+ usedSlots--;
+ keys[index] = (K)REMOVED_ENTRY;
+ values[index] = null;
+ }
+
+ /**
+ * Rehashes the content of this Map into a new Array with a larger capacity. Also used without modifying
+ * capacity to delete removed entries in order to free space.
+ *
+ * @param newCapacity
+ * New capacity of the Map.
+ */
+ protected void resize(int newCapacity) {
+ final K[] oldKeys = keys;
+ final V[] oldValues = values;
+
+ keys = (K[])new Object[newCapacity];
+ values = (V[])new Object[newCapacity];
+
+ for (int i = 0; i < oldKeys.length; i++) {
+ if (oldKeys[i] != null && oldKeys[i] != REMOVED_ENTRY) {
+ final int index = insertionIndexFor(oldKeys[i]);
+ keys[index] = oldKeys[i];
+ values[index] = oldValues[i];
+ }
+ }
+ changeCapacity(newCapacity);
+ }
+
+ /**
+ * Represents a mapping key => value for this Map.
+ *
+ * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
+ */
+ /* package */class Entry implements Map.Entry<K, V> {
+ /** Index of this entry. */
+ private final int index;
+
+ /** Key of this Map entry. */
+ private final K key;
+
+ /** Value of this mapping. */
+ private V value;
+
+ /**
+ * Creates a mapping.
+ *
+ * @param entryKey
+ * The key for this mapping.
+ * @param entryValue
+ * The value for this Map entry.
+ * @param entryIndex
+ * The index of this entry.
+ */
+ public Entry(K entryKey, V entryValue, int entryIndex) {
+ key = entryKey;
+ value = entryValue;
+ index = entryIndex;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public final boolean equals(Object another) {
+ boolean result = false;
+ if (another == this) {
+ result = true;
+ } else if (another instanceof Map.Entry) {
+ final Map.Entry other = (Map.Entry)another;
+ if (equal(key, other.getKey()) && equal(value, other.getValue())) {
+ result = true;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Returns the key corresponding to this entry.
+ *
+ * @return The key corresponding to this entry.
+ */
+ public K getKey() {
+ return key;
+ }
+
+ /**
+ * Returns the value corresponding to this entry.
+ *
+ * @return The value corresponding to this entry.
+ */
+ public V getValue() {
+ return value;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public final int hashCode() {
+ int keyHash = 0;
+ int valueHash = 0;
+ if (key != null) {
+ keyHash = key.hashCode();
+ }
+ if (value != null) {
+ valueHash = value.hashCode();
+ }
+ return keyHash ^ valueHash;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.Map$Entry#setValue(java.lang.Object)
+ */
+ public V setValue(V newValue) {
+ if (EMFCompareMap.this.values[index] != value)
+ throw new ConcurrentModificationException();
+
+ final V oldValue = value;
+ EMFCompareMap.this.values[index] = newValue;
+ value = newValue;
+
+ return oldValue;
+ }
+
+ /**
+ * Returns a String representation of this entry.
+ *
+ * @return A String representation of this entry.
+ */
+ @Override
+ public String toString() {
+ // Note that we cannot have entries with key == FREE_ENTRY or key == REMOVED_ENTRY
+ // (see AbstractHashIterator#nextEntry)
+ final StringBuilder result = new StringBuilder();
+ if (key == NULL_KEY) {
+ result.append("null"); //$NON-NLS-1$
+ } else {
+ result.append(key.toString());
+ }
+ result.append('=');
+ if (value == null) {
+ result.append("null"); //$NON-NLS-1$
+ } else {
+ result.append(value.toString());
+ }
+ return result.toString();
+ }
+ }
+
+ /**
+ * This iterator allows traversing keys and values of this Map.
+ *
+ * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
+ * @param <E>
+ * Defines the class of this iterator's contents.
+ */
+ private abstract class AbstractHashIterator<E> implements Iterator<E> {
+ /** Current entry. */
+ protected Entry currentEntry;
+
+ /** Current key. */
+ protected K currentKey;
+
+ /** Current value. */
+ protected V currentValue;
+
+ /** Expected number of entries for this iterator to traverse. */
+ private int expectedSize;
+
+ /** Index of the next entry. */
+ private int nextIndex;
+
+ /**
+ * Constructs an HashIterator over the entries of this Map.
+ */
+ public AbstractHashIterator() {
+ expectedSize = usedSlots;
+ while (nextIndex < keys.length && (keys[nextIndex] == null || keys[nextIndex] == REMOVED_ENTRY)) {
+ nextIndex++;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.Iterator#hasNext()
+ */
+ public boolean hasNext() {
+ return nextIndex < keys.length;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.Iterator#remove()
+ */
+ public void remove() {
+ if (currentKey == null)
+ throw new IllegalStateException();
+ if (expectedSize != usedSlots)
+ throw new ConcurrentModificationException();
+
+ EMFCompareMap.this.remove(currentKey);
+ currentEntry = null;
+ currentKey = null;
+ currentValue = null;
+ expectedSize = usedSlots;
+ }
+
+ /**
+ * Advances this iterator to the next non removed, non <code>null</code> entry of the Map.
+ */
+ protected void nextEntry() {
+ if (expectedSize != usedSlots)
+ throw new ConcurrentModificationException();
+
+ currentKey = keys[nextIndex];
+ currentValue = values[nextIndex];
+ currentEntry = new Entry(currentKey, currentValue, nextIndex);
+
+ nextIndex++;
+ while (nextIndex < keys.length && (keys[nextIndex] == null || keys[nextIndex] == REMOVED_ENTRY)) {
+ nextIndex++;
+ }
+ }
+ }
+
+ /**
+ * Allows iteration over the entries of this Map.
+ *
+ * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
+ */
+ private class EntryIterator extends AbstractHashIterator<Map.Entry<K, V>> {
+ /**
+ * Increases visibility of the default constructor.
+ */
+ public EntryIterator() {
+ super();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.Iterator#next()
+ */
+ public Map.Entry<K, V> next() {
+ nextEntry();
+ return currentEntry;
+ }
+ }
+
+ /**
+ * Provides a view over the entries of the Map.
+ *
+ * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
+ */
+ private class EntrySet extends AbstractSet<Map.Entry<K, V>> {
+ /**
+ * Increases visibility of the default constructor.
+ */
+ public EntrySet() {
+ super();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.Set#clear()
+ */
+ @Override
+ public void clear() {
+ EMFCompareMap.this.clear();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.AbstractCollection#contains(java.lang.Object)
+ */
+ @Override
+ public boolean contains(Object e) {
+ boolean result = false;
+ if (!(e instanceof Map.Entry))
+ return false;
+
+ final Map.Entry<K, V> entry = (Map.Entry<K, V>)e;
+ if (EMFCompareMap.this.containsKey(entry.getKey())) {
+ final V candidate = EMFCompareMap.this.get(entry.getKey());
+ if (candidate == null) {
+ result = entry.getValue() == null;
+ } else {
+ result = entry.getValue().equals(candidate);
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.AbstractCollection#iterator()
+ */
+ @Override
+ public Iterator<Map.Entry<K, V>> iterator() {
+ return new EntryIterator();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.AbstractCollection#remove(java.lang.Object)
+ */
+ @Override
+ public boolean remove(Object e) {
+ return EMFCompareMap.this.removeEntry(e) != null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.AbstractSet#removeAll(java.util.Collection)
+ */
+ @Override
+ public boolean removeAll(Collection<?> c) {
+ boolean modified = false;
+
+ if (size() > c.size()) {
+ final Iterator<?> i = c.iterator();
+ while (i.hasNext()) {
+ modified |= remove(i.next());
+ }
+ } else {
+ final Iterator<?> i = c.iterator();
+ while (i.hasNext()) {
+ final Object entry = i.next();
+ if (contains(entry)) {
+ remove(entry);
+ modified = true;
+ }
+ }
+ }
+ return modified;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.AbstractCollection#retainAll(java.util.Collection)
+ */
+ @Override
+ public boolean retainAll(Collection<?> c) {
+ boolean modified = false;
+ final Object[] retainedKeys = new Object[c.size()];
+ int indx = 0;
+ final Iterator<?> it = c.iterator();
+ while (it.hasNext()) {
+ final Object entry = it.next();
+ if (entry instanceof Map.Entry) {
+ retainedKeys[indx++] = ((Map.Entry)entry).getKey();
+ }
+ }
+
+ final Iterator<?> e = iterator();
+ while (e.hasNext()) {
+ final Object entry = e.next();
+ boolean removeIt = true;
+ for (final Object o : retainedKeys) {
+ if (((Map.Entry)entry).getKey() == o) {
+ removeIt = false;
+ break;
+ }
+ }
+ if (removeIt) {
+ e.remove();
+ modified = true;
+ }
+ }
+ return modified;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.AbstractCollection#size()
+ */
+ @Override
+ public int size() {
+ return EMFCompareMap.this.size();
+ }
+ }
+
+ /**
+ * Allows iteration over the keys of this Map.
+ *
+ * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
+ */
+ private class KeyIterator extends AbstractHashIterator<K> {
+ /**
+ * Increases visibility of the default constructor.
+ */
+ public KeyIterator() {
+ super();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.Iterator#next()
+ */
+ public K next() {
+ nextEntry();
+ return currentKey;
+ }
+ }
+
+ /**
+ * Provides a view over the keys of this Map.
+ *
+ * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
+ */
+ private class KeySet extends AbstractSet<K> {
+ /**
+ * Increases visibility of the default constructor.
+ */
+ public KeySet() {
+ super();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.Set#clear()
+ */
+ @Override
+ public void clear() {
+ EMFCompareMap.this.clear();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.AbstractCollection#contains(java.lang.Object)
+ */
+ @Override
+ public boolean contains(Object o) {
+ return EMFCompareMap.this.containsKey(o);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.Set#iterator()
+ */
+ @Override
+ public Iterator<K> iterator() {
+ return new KeyIterator();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.Set#remove(java.lang.Object)
+ */
+ @Override
+ public boolean remove(Object o) {
+ return EMFCompareMap.this.remove(o) != null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.Set#size()
+ */
+ @Override
+ public int size() {
+ return EMFCompareMap.this.size();
+ }
+ }
+
+ /**
+ * Allows iteration over the values of this Map.
+ *
+ * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
+ */
+ private class ValueIterator extends AbstractHashIterator<V> {
+ /**
+ * Increases visibility of the default constructor.
+ */
+ public ValueIterator() {
+ super();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.Iterator#next()
+ */
+ public V next() {
+ nextEntry();
+ return currentValue;
+ }
+ }
+
+ /**
+ * Provides a view over the values of this Map.
+ *
+ * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
+ */
+ private class ValueSet extends AbstractSet<V> {
+ /**
+ * Increases visibility of the default constructor.
+ */
+ public ValueSet() {
+ super();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.AbstractCollection#clear()
+ */
+ @Override
+ public void clear() {
+ EMFCompareMap.this.clear();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.AbstractCollection#contains(java.lang.Object)
+ */
+ @Override
+ public boolean contains(Object o) {
+ return EMFCompareMap.this.containsValue(o);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.AbstractCollection#iterator()
+ */
+ @Override
+ public Iterator<V> iterator() {
+ return new ValueIterator();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.AbstractCollection#size()
+ */
+ @Override
+ public int size() {
+ return EMFCompareMap.this.size();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/EMFComparePreferenceConstants.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/EMFComparePreferenceConstants.java
new file mode 100644
index 000000000..a821f835f
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/EMFComparePreferenceConstants.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2011 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.util;
+
+/**
+ * Defines constants used for EMF Compare preferences. These are used by the UI as well as the match engine.
+ *
+ * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
+ * @since 1.0
+ */
+public interface EMFComparePreferenceConstants {
+ /**
+ * Preferences key for the boolean indicating that the comparison should assume the compared models have
+ * distinct metamodels.
+ */
+ String PREFERENCES_KEY_DISTINCT_METAMODEL = "emfcompare.distinct.metamodel"; //$NON-NLS-1$
+
+ /**
+ * Preferences key for the boolean indicating that the comparison should ignore IDs.
+ */
+ String PREFERENCES_KEY_IGNORE_ID = "emfcompare.ignore.ID"; //$NON-NLS-1$
+
+ /**
+ * Preferences key for the boolean indicating that the comparison should ignore XMI IDs.
+ */
+ String PREFERENCES_KEY_IGNORE_XMIID = "emfcompare.ignore.XMI.ID"; //$NON-NLS-1$
+
+ /** Preferences key for the siblings search window. */
+ String PREFERENCES_KEY_SEARCH_WINDOW = "emfcompare.search.window"; //$NON-NLS-1$
+
+ /** Preferences key for the engine selection. */
+ String PREFERENCES_KEY_ENGINE_SELECTION = "emfcompare.engine.selection"; //$NON-NLS-1$
+
+ /** Default value for the siblings search window. */
+ int PREFERENCES_DEFAULT_SEARCH_WINDOW = 100;
+}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/EclipseModelUtils.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/EclipseModelUtils.java
new file mode 100644
index 000000000..d2c6b3ea6
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/EclipseModelUtils.java
@@ -0,0 +1,205 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2011 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.util;
+
+import java.io.IOException;
+import java.util.Collections;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IProgressMonitorWithBlocking;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.content.IContentDescription;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.emf.common.util.BasicMonitor;
+import org.eclipse.emf.common.util.Monitor;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
+/**
+ * Utility class for model loading/saving and serialization within Eclipse.
+ *
+ * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
+ * @since 0.8
+ */
+public final class EclipseModelUtils {
+ /**
+ * Utility classes don't need to (and shouldn't) be instantiated.
+ */
+ private EclipseModelUtils() {
+ // prevents instantiation
+ }
+
+ /**
+ * This will create an EMF {@link Monitor progress monitor} that can be used standalone to display
+ * comparison progress to the user. If <code>delegate</code> isn't <code>null</code>, the created monitor
+ * will delegate all calls to it.
+ *
+ * @param delegate
+ * The delegate progress monitor. Can be <code>null</code> or Eclipse specific monitors.
+ * @return The created progress monitor.
+ * @since 1.0
+ */
+ public static Monitor createProgressMonitor(Object delegate) {
+ final Monitor monitor;
+ if (delegate instanceof IProgressMonitorWithBlocking) {
+ monitor = BasicMonitor.toMonitor((IProgressMonitorWithBlocking)delegate);
+ } else if (delegate instanceof IProgressMonitor) {
+ monitor = BasicMonitor.toMonitor((IProgressMonitor)delegate);
+ } else {
+ monitor = new BasicMonitor();
+ }
+ return monitor;
+ }
+
+ /**
+ * This will create a {@link Resource} given the model extension it is intended for and a ResourceSet.
+ *
+ * @param modelURI
+ * {@link org.eclipse.emf.common.util.URI URI} where the model is stored.
+ * @param contentType
+ * Content type of this file.
+ * @param resourceSet
+ * The {@link ResourceSet} to load the model in.
+ * @return The {@link Resource} given the model extension it is intended for.
+ * @since 1.1
+ */
+ public static Resource createResource(URI modelURI, String contentType, ResourceSet resourceSet) {
+ // First search the resource set for our resource factory
+ Resource.Factory.Registry registry = resourceSet.getResourceFactoryRegistry();
+ Object resourceFactory = registry.getContentTypeToFactoryMap().get(contentType);
+ if (resourceFactory == null) {
+ // Then the global registry
+ registry = Resource.Factory.Registry.INSTANCE;
+ resourceFactory = registry.getContentTypeToFactoryMap().get(contentType);
+ if (resourceFactory != null) {
+ resourceSet.getResourceFactoryRegistry().getContentTypeToFactoryMap().put(contentType,
+ resourceFactory);
+ }
+ }
+
+ return resourceSet.createResource(modelURI, contentType);
+ }
+
+ /**
+ * This will try and find the common content-type of the given resources.
+ *
+ * @param uris
+ * The resource URIs that will be compared.
+ * @return The content-type to consider when searching for a match engine or <code>null</code> if
+ * content-types are distinct.
+ * @since 1.1
+ */
+ public static String getCommonContentType(URI... uris) {
+ String contentType = null;
+ for (int i = 0; i < uris.length; i++) {
+ if (uris[i] != null) {
+ if (uris[i].isPlatformResource()) {
+ final IPath modelPath = new Path(uris[i].toPlatformString(true));
+ String newContentType = null;
+ try {
+ final IContentDescription contentDescription = ResourcesPlugin.getWorkspace()
+ .getRoot().getFile(modelPath).getContentDescription();
+ if (contentDescription != null && contentDescription.getContentType() != null) {
+ newContentType = contentDescription.getContentType().getId();
+ }
+
+ } catch (CoreException e) {
+ // Do nothing
+ }
+
+ if (contentType == null) {
+ contentType = newContentType;
+ } else if (newContentType != null && !contentType.equals(newContentType)) {
+ return null;
+ }
+ }
+ }
+ }
+ return contentType;
+ }
+
+ /**
+ * Loads a model from an {@link org.eclipse.core.resources.IFile IFile} in a given {@link ResourceSet}.
+ * <p>
+ * This will return the first root of the loaded model, other roots can be accessed via the resource's
+ * content.
+ * </p>
+ *
+ * @param file
+ * {@link org.eclipse.core.resources.IFile IFile} containing the model to be loaded.
+ * @param resourceSet
+ * The {@link ResourceSet} to load the model in.
+ * @return The model loaded from the file.
+ * @throws IOException
+ * If the given file does not exist.
+ */
+ public static EObject load(IFile file, ResourceSet resourceSet) throws IOException {
+ EObject result = null;
+
+ // First tries to load the IFile assuming it is in the workspace
+ final URI resourceURI = URI.createPlatformResourceURI(file.getFullPath().toOSString(), true);
+ Resource modelResource;
+ IContentType contentType = null;
+ try {
+ contentType = file.getContentDescription().getContentType();
+ } catch (CoreException e) {
+ // discard
+ }
+ if (contentType != null) {
+ modelResource = createResource(resourceURI, contentType.getId(), resourceSet);
+ } else {
+ modelResource = ModelUtils.createResource(resourceURI, resourceSet);
+ }
+ try {
+ modelResource.load(Collections.emptyMap());
+ } catch (IOException e) {
+ // If it failed, load the file assuming it is in the plugins
+ resourceSet.getResources().remove(modelResource);
+ modelResource = ModelUtils.createResource(URI.createPlatformPluginURI(file.getFullPath()
+ .toOSString(), true), resourceSet);
+ try {
+ modelResource.load(Collections.emptyMap());
+ } catch (IOException ee) {
+ // If it fails anew, throws the first IOException
+ throw e;
+ }
+ }
+ // Returns the first root of the loaded model
+ if (modelResource.getContents().size() > 0)
+ result = modelResource.getContents().get(0);
+ return result;
+ }
+
+ /**
+ * Loads a model from an {@link IPath} in a given {@link ResourceSet}.
+ * <p>
+ * This will return the first root of the loaded model, other roots can be accessed via the resource's
+ * content.
+ * </p>
+ *
+ * @param path
+ * {@link IPath} where the model lies.
+ * @param resourceSet
+ * The {@link ResourceSet} to load the model in.
+ * @return The model loaded from the path.
+ * @throws IOException
+ * If the given file does not exist.
+ */
+ public static EObject load(IPath path, ResourceSet resourceSet) throws IOException {
+ return load(ResourcesPlugin.getWorkspace().getRoot().getFile(path), resourceSet);
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/EngineConstants.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/EngineConstants.java
new file mode 100644
index 000000000..c698a8980
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/EngineConstants.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2011 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.util;
+
+/**
+ * Defines constants for use with all engine classes.
+ *
+ * @author <a href="mailto:cedric.brun@obeo.fr">Cedric Brun</a>
+ */
+public interface EngineConstants {
+ /** Integer (value 4) representing high priority. */
+ int PRIORITY_HIGH = 4;
+
+ /** Integer (value 5) representing the highest priority. */
+ int PRIORITY_HIGHEST = 5;
+
+ /** Integer (value 2) representing low priority. */
+ int PRIORITY_LOW = 2;
+
+ /** Integer (value 1) representing the lowest priority. */
+ int PRIORITY_LOWEST = 1;
+
+ /** Integer (value 3) representing normal priority. */
+ int PRIORITY_NORMAL = 3;
+}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/ModelIdentifier.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/ModelIdentifier.java
new file mode 100644
index 000000000..770946753
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/ModelIdentifier.java
@@ -0,0 +1,98 @@
+/**
+ * Copyright (c) 2009, 2011 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ */
+package org.eclipse.emf.compare.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.common.EMFPlugin;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+
+/**
+ * Store the models' common identification elements used to retrieve the comparison engines.
+ *
+ * @author <a href="mailto:gonzague.reydet@obeo.fr">Gonzague Reydet</a>
+ * @since 1.1
+ */
+public class ModelIdentifier {
+ /** Default extension for EObjects not attached to a resource. */
+ private static final String DEFAULT_EXTENSION = "ecore"; //$NON-NLS-1$
+
+ /** Common namespace of the models. */
+ private final String namespace;
+
+ /** Common content-type of the models. */
+ private final String contentType;
+
+ /** Common extension of the model. */
+ private final String extension;
+
+ /**
+ * Default constructor.
+ *
+ * @param resources
+ * Resources for which we need to identify an engine.
+ */
+ public ModelIdentifier(Resource... resources) {
+ final List<URI> uris = new ArrayList<URI>();
+ for (int i = 0; i < resources.length; i++) {
+ if (resources[i] != null) {
+ uris.add(resources[i].getURI());
+ }
+ }
+ final URI[] uriArray = uris.toArray(new URI[uris.size()]);
+
+ namespace = ModelUtils.getCommonNamespace(resources);
+
+ if (EMFPlugin.IS_ECLIPSE_RUNNING) {
+ contentType = EclipseModelUtils.getCommonContentType(uriArray);
+ } else {
+ contentType = null;
+ }
+
+ final String ext = ModelUtils.getCommonExtension(uriArray);
+ if (ext != null) {
+ this.extension = ext;
+ } else if (contentType == null && namespace == null) {
+ this.extension = DEFAULT_EXTENSION;
+ } else {
+ this.extension = null;
+ }
+ }
+
+ /**
+ * Returns the common namespace found for the models considered by this instance.
+ *
+ * @return The common namespace found for the models considered by this instance.
+ */
+ public String getNamespace() {
+ return namespace;
+ }
+
+ /**
+ * Returns the common content-type found for the models considered by this instance.
+ *
+ * @return The common content-type found for the models considered by this instance.
+ */
+ public String getContentType() {
+ return contentType;
+ }
+
+ /**
+ * Returns the common extension found for the models considered by this instance.
+ *
+ * @return The common extension found for the models considered by this instance.
+ */
+ public String getExtension() {
+ return extension;
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/ModelUtils.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/ModelUtils.java
new file mode 100644
index 000000000..5cd6caeb3
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/ModelUtils.java
@@ -0,0 +1,454 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2011 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.util;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.compare.EMFCompareMessages;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
+
+/**
+ * Utility class for model loading/saving and serialization.
+ *
+ * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
+ */
+public final class ModelUtils {
+ /** Constant for the file encoding system property. */
+ private static final String ENCODING_PROPERTY = "file.encoding"; //$NON-NLS-1$
+
+ /**
+ * Utility classes don't need to (and shouldn't) be instantiated.
+ */
+ private ModelUtils() {
+ // prevents instantiation
+ }
+
+ /**
+ * Attaches the given {@link EObject} to a new resource created in a new {@link ResourceSet} with the
+ * given URI.
+ *
+ * @param resourceURI
+ * URI of the new resource to create.
+ * @param root
+ * EObject to attach to a new resource.
+ * @return The resource <tt>root</tt> has been attached to.
+ */
+ public static Resource attachResource(URI resourceURI, EObject root) {
+ if (root == null)
+ throw new NullPointerException(EMFCompareMessages.getString("ModelUtils.NullRoot")); //$NON-NLS-1$
+
+ final Resource newResource = createResource(resourceURI);
+ newResource.getContents().add(root);
+ return newResource;
+ }
+
+ /**
+ * Attaches the given {@link EObject} to a new resource created in the given {@link ResourceSet} with the
+ * given URI.
+ *
+ * @param resourceURI
+ * URI of the new resource to create.
+ * @param resourceSet
+ * ResourceSet in which to create the resource.
+ * @param root
+ * EObject to attach to a new resource.
+ * @return The resource <tt>root</tt> has been attached to.
+ */
+ public static Resource attachResource(URI resourceURI, ResourceSet resourceSet, EObject root) {
+ if (root == null)
+ throw new NullPointerException(EMFCompareMessages.getString("ModelUtils.NullRoot")); //$NON-NLS-1$
+
+ final Resource newResource = createResource(resourceURI, resourceSet);
+ newResource.getContents().add(root);
+ return newResource;
+ }
+
+ /**
+ * This will create a {@link Resource} given the model extension it is intended for.
+ *
+ * @param modelURI
+ * {@link org.eclipse.emf.common.util.URI URI} where the model is stored.
+ * @return The {@link Resource} given the model extension it is intended for.
+ */
+ public static Resource createResource(URI modelURI) {
+ return createResource(modelURI, new ResourceSetImpl());
+ }
+
+ /**
+ * This will create a {@link Resource} given the model extension it is intended for and a ResourceSet.
+ *
+ * @param modelURI
+ * {@link org.eclipse.emf.common.util.URI URI} where the model is stored.
+ * @param resourceSet
+ * The {@link ResourceSet} to load the model in.
+ * @return The {@link Resource} given the model extension it is intended for.
+ */
+ public static Resource createResource(URI modelURI, ResourceSet resourceSet) {
+ String fileExtension = modelURI.fileExtension();
+ if (fileExtension == null || fileExtension.length() == 0) {
+ fileExtension = Resource.Factory.Registry.DEFAULT_EXTENSION;
+ }
+
+ // First search the resource set for our resource factory
+ Resource.Factory.Registry registry = resourceSet.getResourceFactoryRegistry();
+ Object resourceFactory = registry.getExtensionToFactoryMap().get(fileExtension);
+ if (resourceFactory == null) {
+ // then the global registry
+ registry = Resource.Factory.Registry.INSTANCE;
+ resourceFactory = registry.getExtensionToFactoryMap().get(fileExtension);
+ if (resourceFactory != null) {
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(fileExtension,
+ resourceFactory);
+ } else {
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(fileExtension,
+ new XMIResourceFactoryImpl());
+ }
+ }
+
+ return resourceSet.createResource(modelURI);
+ }
+
+ /**
+ * This will try and find the common file extension for the compared models.
+ *
+ * @param uris
+ * The resource URIs that will be compared.
+ * @return The file extension to consider when searching for a match engine or <code>null</code> if file
+ * extensions are distinct.
+ */
+ public static String getCommonExtension(URI... uris) {
+ String extension = null;
+ for (int i = 0; i < uris.length; i++) {
+ if (uris[i] != null) {
+ if (extension == null) {
+ extension = uris[i].fileExtension();
+ } else if (uris[i].fileExtension() != null && !extension.equals(uris[i].fileExtension())) {
+ return null;
+ }
+ }
+ }
+ return extension;
+ }
+
+ /**
+ * This will try to find the common namespace of the given resources.
+ *
+ * @param resources
+ * The resources that will be compared.
+ * @return The namespace to consider when searching for a match engine or <code>null</code> if namespaces
+ * are distinct.
+ * @since 1.1
+ */
+ public static String getCommonNamespace(Resource... resources) {
+ String namespace = null;
+ for (int i = 0; i < resources.length; i++) {
+ if (resources[i] != null) {
+ if (!resources[i].getContents().isEmpty()) {
+
+ final EObject rootContainer = EcoreUtil.getRootContainer(resources[i].getContents()
+ .get(0).eClass());
+ if (rootContainer instanceof EPackage) {
+ if (namespace == null) {
+ namespace = ((EPackage)rootContainer).getNsURI();
+ } else if (!namespace.equals(((EPackage)rootContainer).getNsURI())) {
+ return null;
+ }
+ }
+ }
+ }
+ }
+ return namespace;
+ }
+
+ /**
+ * Loads the models contained by the given directory in the given ResourceSet.
+ * <p>
+ * If <code>resourceSet</code> is <code>null</code>, all models will be loaded in a new resourceSet.
+ * </p>
+ *
+ * @param directory
+ * The directory from which to load the models.
+ * @param resourceSet
+ * The {@link ResourceSet} to load the model in. If <code>null</code>, all models will be
+ * loaded in a new resourceSet.
+ * @return The models contained by the given directory.
+ * @throws IOException
+ * Thrown if an I/O operation has failed or been interrupted.
+ */
+ public static List<EObject> getModelsFrom(File directory, ResourceSet resourceSet) throws IOException {
+ return getModelsFrom(directory, null, resourceSet);
+ }
+
+ /**
+ * Loads the files with the given extension contained by the given directory as EObjects in the given
+ * ResourceSet.
+ * <p>
+ * If <code>resourceSet</code> is <code>null</code>, all models will be loaded in a new resourceSet.
+ * </p>
+ * <p>
+ * The argument <code>extension</code> is in fact the needed suffix for its name in order for a file to be
+ * loaded. If it is equal to &quot;rd&quot;, a file named &quot;model.aird&quot; will be loaded, but so
+ * would be a file named &quot;Shepherd&quot;.
+ * </p>
+ * <p>
+ * The empty String or <code>null</code> will result in all the files of the given directory to be loaded,
+ * and would then be equivalent to {@link #getModelsFrom(File)}.
+ * </p>
+ *
+ * @param directory
+ * The directory from which to load the models.
+ * @param extension
+ * File extension of the files to load. If <code>null</code>, will consider all extensions.
+ * @param resourceSet
+ * The {@link ResourceSet} to load the model in. If <code>null</code>, all models will be
+ * loaded in a new resourceSet.
+ * @return The models contained by the given directory.
+ * @throws IOException
+ * Thrown if an I/O operation has failed or been interrupted.
+ */
+ public static List<EObject> getModelsFrom(File directory, String extension, ResourceSet resourceSet)
+ throws IOException {
+ final List<EObject> models = new ArrayList<EObject>();
+ final String fileExtension;
+ if (extension != null)
+ fileExtension = extension;
+ else
+ fileExtension = ""; //$NON-NLS-1$
+
+ final ResourceSet theResourceSet;
+ if (resourceSet == null)
+ theResourceSet = new ResourceSetImpl();
+ else
+ theResourceSet = resourceSet;
+
+ if (directory.exists() && directory.isDirectory() && directory.listFiles() != null) {
+ final File[] files = directory.listFiles();
+ for (int i = 0; i < files.length; i++) {
+ final File aFile = files[i];
+
+ if (!aFile.isDirectory() && aFile.getName().matches("[^.].*?\\Q" + fileExtension + "\\E")) { //$NON-NLS-1$ //$NON-NLS-2$
+ models.add(load(aFile, theResourceSet));
+ }
+ }
+ }
+
+ return models;
+ }
+
+ /**
+ * Loads a model from a {@link java.io.File File} in a given {@link ResourceSet}.
+ * <p>
+ * This will return the first root of the loaded model, other roots can be accessed via the resource's
+ * content.
+ * </p>
+ *
+ * @param file
+ * {@link java.io.File File} containing the model to be loaded.
+ * @param resourceSet
+ * The {@link ResourceSet} to load the model in.
+ * @return The model loaded from the file.
+ * @throws IOException
+ * If the given file does not exist.
+ */
+ public static EObject load(File file, ResourceSet resourceSet) throws IOException {
+ return load(URI.createFileURI(file.getPath()), resourceSet);
+ }
+
+ /**
+ * Load a model from an {@link java.io.InputStream InputStream} in a given {@link ResourceSet}.
+ * <p>
+ * This will return the first root of the loaded model, other roots can be accessed via the resource's
+ * content.
+ * </p>
+ *
+ * @param stream
+ * The inputstream to load from
+ * @param fileName
+ * The original filename
+ * @param resourceSet
+ * The {@link ResourceSet} to load the model in.
+ * @return The loaded model
+ * @throws IOException
+ * If the given file does not exist.
+ */
+ public static EObject load(InputStream stream, String fileName, ResourceSet resourceSet)
+ throws IOException {
+ if (stream == null)
+ throw new NullPointerException(EMFCompareMessages.getString("ModelUtils.NullInputStream")); //$NON-NLS-1$
+ EObject result = null;
+
+ final Resource modelResource = createResource(URI.createURI(fileName), resourceSet);
+ modelResource.load(stream, Collections.emptyMap());
+ if (modelResource.getContents().size() > 0)
+ result = modelResource.getContents().get(0);
+ return result;
+ }
+
+ /**
+ * Loads a model from the String representing the location of a model.
+ * <p>
+ * This can be called with pathes of the form
+ * <ul>
+ * <li><code>/pluginID/path</code></li>
+ * <li><code>platform:/plugin/pluginID/path</code></li>
+ * <li><code>platform:/resource/pluginID/path</code></li>
+ * </ul>
+ * </p>
+ * <p>
+ * This will return the first root of the loaded model, other roots can be accessed via the resource's
+ * content.
+ * </p>
+ *
+ * @param path
+ * Location of the model.
+ * @param resourceSet
+ * The {@link ResourceSet} to load the model in.
+ * @return The model loaded from the path.
+ * @throws IOException
+ * If the path doesn't resolve to a reachable location.
+ */
+ public static EObject load(String path, ResourceSet resourceSet) throws IOException {
+ if (path == null || "".equals(path)) //$NON-NLS-1$
+ throw new IllegalArgumentException(EMFCompareMessages.getString("ModelUtils.NullPath")); //$NON-NLS-1$
+
+ final EObject result;
+ // path is already defined with a platform scheme
+ if (path.startsWith("platform")) //$NON-NLS-1$
+ result = load(URI.createURI(path), resourceSet);
+ else {
+ EObject temp = null;
+ try {
+ // Will first try and load as if the model is in the plugins
+ temp = load(URI.createPlatformPluginURI(path, true), resourceSet);
+ } catch (IOException e) {
+ // Model wasn't in the plugins, try and load it within the workspace
+ try {
+ temp = load(URI.createPlatformResourceURI(path, true), resourceSet);
+ } catch (IOException ee) {
+ // Silently discarded, will fail later on
+ }
+ }
+ result = temp;
+ }
+ if (result == null)
+ throw new IOException(EMFCompareMessages.getString("ModelUtils.LoadFailure", path)); //$NON-NLS-1$
+ return result;
+ }
+
+ /**
+ * Loads a model from an {@link org.eclipse.emf.common.util.URI URI} in a given {@link ResourceSet}.
+ * <p>
+ * This will return the first root of the loaded model, other roots can be accessed via the resource's
+ * content.
+ * </p>
+ *
+ * @param modelURI
+ * {@link org.eclipse.emf.common.util.URI URI} where the model is stored.
+ * @param resourceSet
+ * The {@link ResourceSet} to load the model in.
+ * @return The model loaded from the URI.
+ * @throws IOException
+ * If the given file does not exist.
+ */
+ public static EObject load(URI modelURI, ResourceSet resourceSet) throws IOException {
+ EObject result = null;
+
+ final Resource modelResource = createResource(modelURI, resourceSet);
+ modelResource.load(Collections.emptyMap());
+ if (modelResource.getContents().size() > 0)
+ result = modelResource.getContents().get(0);
+ return result;
+ }
+
+ /**
+ * Saves a model as a file to the given path.
+ *
+ * @param root
+ * Root of the objects to be serialized in a file.
+ * @param path
+ * File where the objects have to be saved.
+ * @throws IOException
+ * Thrown if an I/O operation has failed or been interrupted during the saving process.
+ */
+ public static void save(EObject root, String path) throws IOException {
+ if (root == null)
+ throw new NullPointerException(EMFCompareMessages.getString("ModelUtils.NullSaveRoot")); //$NON-NLS-1$
+
+ final Resource newModelResource = createResource(URI.createFileURI(path));
+ newModelResource.getContents().add(root);
+ final Map<String, String> options = new EMFCompareMap<String, String>();
+ options.put(XMLResource.OPTION_ENCODING, System.getProperty(ENCODING_PROPERTY));
+ newModelResource.save(options);
+ }
+
+ /**
+ * Serializes the given EObjet as a String.
+ *
+ * @param root
+ * Root of the objects to be serialized.
+ * @return The given EObjet serialized as a String.
+ * @throws IOException
+ * Thrown if an I/O operation has failed or been interrupted during the saving process.
+ */
+ public static String serialize(EObject root) throws IOException {
+ if (root == null)
+ throw new NullPointerException(EMFCompareMessages.getString("ModelUtils.NullSaveRoot")); //$NON-NLS-1$
+
+ // Copies the root to avoid modifying it
+ final EObject copyRoot = EcoreUtil.copy(root);
+ attachResource(URI.createFileURI("resource.xml"), copyRoot); //$NON-NLS-1$
+
+ final StringWriter writer = new StringWriter();
+ final Map<String, String> options = new EMFCompareMap<String, String>();
+ options.put(XMLResource.OPTION_ENCODING, System.getProperty(ENCODING_PROPERTY));
+ // Should not throw ClassCast since uri calls for an xml resource
+ ((XMLResource)copyRoot.eResource()).save(writer, options);
+ final String result = writer.toString();
+ writer.flush();
+ return result;
+ }
+
+ /**
+ * Checks whether the given resource contains the given object by searching its complete contents (
+ * {@link Resource#getAllContents()}).
+ *
+ * @param resource
+ * The resource whose contents is to be processed.
+ * @param eObject
+ * The object to be evaluated.
+ * @return <code>true</code> if the resource contains the eObject, <code>false</code> otherwise.
+ */
+ public static boolean contains(Resource resource, EObject eObject) {
+ final TreeIterator<EObject> contentsIterator = resource.getAllContents();
+ while (contentsIterator.hasNext()) {
+ if (contentsIterator.next() == eObject) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/package-info.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/package-info.java
new file mode 100644
index 000000000..46b75551d
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/util/package-info.java
@@ -0,0 +1,15 @@
+/*
+ * (non-javadoc)
+ * Copyright (c) 2006, 2011 Obeo.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ */
+/**
+ * This package contains utility classes used throughout EMF Compare.
+ */
+package org.eclipse.emf.compare.util; \ No newline at end of file

Back to the top