Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2018-11-27 04:51:09 -0500
committervincent lorenzo2018-11-29 04:28:48 -0500
commit5bf47e1b9c6d58b68dbed5407cf12669cceee874 (patch)
tree7fa55fd7457b37e8adb6a825435f2241a250d818
parent1fd65f398c276af8b7dc5185c04ef1e49769c5e8 (diff)
downloadorg.eclipse.papyrus-5bf47e1b9c6d58b68dbed5407cf12669cceee874.tar.gz
org.eclipse.papyrus-5bf47e1b9c6d58b68dbed5407cf12669cceee874.tar.xz
org.eclipse.papyrus-5bf47e1b9c6d58b68dbed5407cf12669cceee874.zip
Bug 541590: [Modeling Assistant] Remove the generation of the cache adapter method in the Modeling assistant framework
Change-Id: Iff17567a39b60c91cea97b82ae61c9bd8e51abe9 Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
-rwxr-xr-xplugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/.settings/.api_filters43
-rw-r--r--plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.genmodel7
-rw-r--r--plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/pom.xml7
-rw-r--r--plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/AssistantPackage.java20
-rw-r--r--plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistantImpl.java24
-rw-r--r--plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistantPackageImpl.java4
-rw-r--r--plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistedElementTypeFilterImpl.java16
-rw-r--r--plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ConnectionAssistantImpl.java8
-rw-r--r--plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ElementTypeFilterImpl.java23
-rw-r--r--plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ModelingAssistantProviderImpl.java69
-rw-r--r--plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/PopupAssistantImpl.java8
-rw-r--r--plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/operations/ModelingAssistantProviderOperations.java4
-rw-r--r--plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/core/ModelingAssistantModelRegistry.java8
-rw-r--r--plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/core/util/ProviderCache.java20
-rw-r--r--tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/tests/AssistedElementTypeFilterTest.java38
-rw-r--r--tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/tests/ModelingAssistantProviderTest.java24
17 files changed, 123 insertions, 202 deletions
diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/.settings/.api_filters b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/.settings/.api_filters
new file mode 100755
index 00000000000..f461d97dee0
--- /dev/null
+++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/.settings/.api_filters
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<component id="org.eclipse.papyrus.infra.gmfdiag.assistant" version="2">
+ <resource path="META-INF/MANIFEST.MF">
+ <filter comment="we regenerate the code removing the CacheAdapter generation -&gt; we increase the minor" id="926941240">
+ <message_arguments>
+ <message_argument value="1.4.0"/>
+ <message_argument value="1.3.100"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistantImpl.java" type="org.eclipse.papyrus.infra.gmfdiag.assistant.impl.AssistantImpl">
+ <filter comment="generated code" id="338792546">
+ <message_arguments>
+ <message_argument value="org.eclipse.papyrus.infra.gmfdiag.assistant.impl.AssistantImpl"/>
+ <message_argument value="getCacheAdapter()"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistedElementTypeFilterImpl.java" type="org.eclipse.papyrus.infra.gmfdiag.assistant.impl.AssistedElementTypeFilterImpl">
+ <filter comment="generated code" id="338792546">
+ <message_arguments>
+ <message_argument value="org.eclipse.papyrus.infra.gmfdiag.assistant.impl.AssistedElementTypeFilterImpl"/>
+ <message_argument value="getCacheAdapter()"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ElementTypeFilterImpl.java" type="org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ElementTypeFilterImpl">
+ <filter comment="generated code" id="338792546">
+ <message_arguments>
+ <message_argument value="org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ElementTypeFilterImpl"/>
+ <message_argument value="getCacheAdapter()"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ModelingAssistantProviderImpl.java" type="org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ModelingAssistantProviderImpl">
+ <filter comment="generated code" id="338792546">
+ <message_arguments>
+ <message_argument value="org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ModelingAssistantProviderImpl"/>
+ <message_argument value="getCacheAdapter()"/>
+ </message_arguments>
+ </filter>
+ </resource>
+</component>
diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/META-INF/MANIFEST.MF
index dc0d9a7e101..fa8dec782ac 100644
--- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/META-INF/MANIFEST.MF
@@ -18,7 +18,7 @@ Export-Package: org.eclipse.papyrus.infra.gmfdiag.assistant,
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
-Bundle-Version: 1.3.100.qualifier
+Bundle-Version: 1.4.0.qualifier
Bundle-Localization: plugin
Bundle-Name: %pluginName
Bundle-Activator: org.eclipse.papyrus.infra.gmfdiag.assistant.internal.core.AssistantPlugin$Implementation
diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.genmodel b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.genmodel
index 1e6cfd395f1..4a062ae476e 100644
--- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.genmodel
+++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.genmodel
@@ -8,10 +8,9 @@
nonNLSMarkers="true" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
codeFormatting="true" commentFormatting="true" testsDirectory="/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/src-gen"
booleanFlagsField="_flags" booleanFlagsReservedBits="8" importerID="org.eclipse.uml2.uml.ecore.importer"
- complianceLevel="7.0" copyrightFields="false" operationReflection="true" importOrganizing="true"
- usedGenPackages="../../org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore ../../org.eclipse.papyrus.infra.filters/model/filters.genmodel#//filters ../../org.eclipse.uml2.types/model/Types.genmodel#//types"
- cleanup="true" factoryMethods="true" pluralizedGetters="true" cacheAdapterSupport="true"
- safeStrings="true" invariantPrefix="validate">
+ complianceLevel="7.0" copyrightFields="false" usedGenPackages="../../org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore ../../org.eclipse.papyrus.infra.filters/model/filters.genmodel#//filters ../../org.eclipse.uml2.types/model/Types.genmodel#//types"
+ operationReflection="true" importOrganizing="true" cleanup="true" factoryMethods="true"
+ pluralizedGetters="true" safeStrings="true" invariantPrefix="validate">
<genAnnotations source="http://www.eclipse.org/emf/2002/GenModel/importer/org.eclipse.uml2.uml.ecore.importer">
<details key="ECORE_TAGGED_VALUES" value="PROCESS"/>
<details key="UNION_PROPERTIES" value="PROCESS"/>
diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/pom.xml b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/pom.xml
index 4a2469e2c57..7ed8bc8e4d7 100644
--- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/pom.xml
+++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/pom.xml
@@ -1,4 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>org.eclipse.papyrus.infra-gmfdiag-assistant</artifactId>
@@ -6,6 +9,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.infra.gmfdiag.assistant</artifactId>
- <version>1.3.100-SNAPSHOT</version>
+ <version>1.4.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/AssistantPackage.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/AssistantPackage.java
index ad11df66f83..7e67af0cacd 100644
--- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/AssistantPackage.java
+++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/AssistantPackage.java
@@ -1939,6 +1939,11 @@ public interface AssistantPackage extends EPackage {
* Returns the meta object for data type '{@link org.eclipse.gmf.runtime.emf.type.core.IElementType <em>Element Type</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * <p>
+ * From package assistantapi.
+ * </p>
+ * <!-- end-model-doc -->
*
* @return the meta object for data type '<em>Element Type</em>'.
* @see org.eclipse.gmf.runtime.emf.type.core.IElementType
@@ -1963,6 +1968,11 @@ public interface AssistantPackage extends EPackage {
* Returns the meta object for data type '{@link org.eclipse.gmf.runtime.common.core.service.IOperation <em>IOperation</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * <p>
+ * From package serviceprovider.
+ * </p>
+ * <!-- end-model-doc -->
*
* @return the meta object for data type '<em>IOperation</em>'.
* @see org.eclipse.gmf.runtime.common.core.service.IOperation
@@ -1975,6 +1985,11 @@ public interface AssistantPackage extends EPackage {
* Returns the meta object for data type '{@link org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener <em>IProvider Change Listener</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * <p>
+ * From package serviceprovider.
+ * </p>
+ * <!-- end-model-doc -->
*
* @return the meta object for data type '<em>IProvider Change Listener</em>'.
* @see org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener
@@ -1987,6 +2002,11 @@ public interface AssistantPackage extends EPackage {
* Returns the meta object for data type '{@link org.eclipse.core.runtime.IAdaptable <em>IAdaptable</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * <p>
+ * From package assistantapi.
+ * </p>
+ * <!-- end-model-doc -->
*
* @return the meta object for data type '<em>IAdaptable</em>'.
* @see org.eclipse.core.runtime.IAdaptable
diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistantImpl.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistantImpl.java
index 410cbc8bca1..8a91ecd2aa8 100644
--- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistantImpl.java
+++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistantImpl.java
@@ -32,8 +32,6 @@ import org.eclipse.papyrus.infra.gmfdiag.assistant.AssistantPackage;
import org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider;
import org.eclipse.papyrus.infra.gmfdiag.assistant.internal.operations.AssistantOperations;
-import org.eclipse.uml2.common.util.CacheAdapter;
-
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Assistant</b></em>'.
@@ -139,14 +137,6 @@ public abstract class AssistantImpl extends MinimalEObjectImpl.Container impleme
*/
@Override
public IElementType getElementType() {
- CacheAdapter cache = getCacheAdapter();
- if (cache != null) {
- IElementType result = (IElementType) cache.get(eResource(), this, AssistantPackage.Literals.ASSISTANT__ELEMENT_TYPE);
- if (result == null) {
- cache.put(eResource(), this, AssistantPackage.Literals.ASSISTANT__ELEMENT_TYPE, result = AssistantOperations.getElementType(this));
- }
- return result;
- }
return AssistantOperations.getElementType(this);
}
@@ -257,7 +247,7 @@ public abstract class AssistantImpl extends MinimalEObjectImpl.Container impleme
return super.toString();
}
- StringBuffer result = new StringBuffer(super.toString());
+ StringBuilder result = new StringBuilder(super.toString());
result.append(" (elementTypeID: "); //$NON-NLS-1$
result.append(elementTypeID);
result.append(')');
@@ -279,18 +269,6 @@ public abstract class AssistantImpl extends MinimalEObjectImpl.Container impleme
}
/**
- * Retrieves the cache adapter for this '<em><b>Assistant</b></em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return The cache adapter for this '<em><b>Assistant</b></em>'.
- * @generated
- */
- protected CacheAdapter getCacheAdapter() {
- return CacheAdapter.getCacheAdapter(this);
- }
-
- /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistantPackageImpl.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistantPackageImpl.java
index 25e75db23e8..e1042b40adc 100644
--- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistantPackageImpl.java
+++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistantPackageImpl.java
@@ -208,7 +208,8 @@ public class AssistantPackageImpl extends EPackageImpl implements AssistantPacka
}
// Obtain or create and register package
- AssistantPackageImpl theAssistantPackage = (AssistantPackageImpl) (EPackage.Registry.INSTANCE.get(eNS_URI) instanceof AssistantPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new AssistantPackageImpl());
+ Object registeredAssistantPackage = EPackage.Registry.INSTANCE.get(eNS_URI);
+ AssistantPackageImpl theAssistantPackage = registeredAssistantPackage instanceof AssistantPackageImpl ? (AssistantPackageImpl) registeredAssistantPackage : new AssistantPackageImpl();
isInited = true;
@@ -226,7 +227,6 @@ public class AssistantPackageImpl extends EPackageImpl implements AssistantPacka
// Mark meta-data to indicate it can't be changed
theAssistantPackage.freeze();
-
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(AssistantPackage.eNS_URI, theAssistantPackage);
return theAssistantPackage;
diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistedElementTypeFilterImpl.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistedElementTypeFilterImpl.java
index cb6c34751fb..fe68b9da561 100644
--- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistedElementTypeFilterImpl.java
+++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistedElementTypeFilterImpl.java
@@ -34,8 +34,6 @@ import org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider;
import org.eclipse.papyrus.infra.gmfdiag.assistant.internal.operations.AssistedElementTypeFilterOperations;
-import org.eclipse.uml2.common.util.CacheAdapter;
-
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Assisted Element Type Filter</b></em>'.
@@ -250,7 +248,7 @@ public class AssistedElementTypeFilterImpl extends MinimalEObjectImpl.Container
return super.toString();
}
- StringBuffer result = new StringBuffer(super.toString());
+ StringBuilder result = new StringBuilder(super.toString());
result.append(" (name: "); //$NON-NLS-1$
result.append(name);
result.append(')');
@@ -271,16 +269,4 @@ public class AssistedElementTypeFilterImpl extends MinimalEObjectImpl.Container
return EcoreUtil.create(eClass);
}
- /**
- * Retrieves the cache adapter for this '<em><b>Assisted Element Type Filter</b></em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return The cache adapter for this '<em><b>Assisted Element Type Filter</b></em>'.
- * @generated
- */
- protected CacheAdapter getCacheAdapter() {
- return CacheAdapter.getCacheAdapter(this);
- }
-
} // AssistedElementTypeFilterImpl
diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ConnectionAssistantImpl.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ConnectionAssistantImpl.java
index 612b7ac5520..b6abd7ad43b 100644
--- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ConnectionAssistantImpl.java
+++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ConnectionAssistantImpl.java
@@ -15,17 +15,12 @@ package org.eclipse.papyrus.infra.gmfdiag.assistant.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
-
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
-
import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
import org.eclipse.emf.ecore.resource.Resource;
-
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.papyrus.infra.filters.Filter;
-
import org.eclipse.papyrus.infra.gmfdiag.assistant.AssistantPackage;
import org.eclipse.papyrus.infra.gmfdiag.assistant.ConnectionAssistant;
import org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider;
@@ -277,8 +272,7 @@ public class ConnectionAssistantImpl extends AssistantImpl implements Connection
@Override
public void setOwningProvider(ModelingAssistantProvider newOwningProvider) {
if (newOwningProvider != eInternalContainer() || (eContainerFeatureID() != AssistantPackage.CONNECTION_ASSISTANT__OWNING_PROVIDER && newOwningProvider != null)) {
- if (EcoreUtil.isAncestor(this, newOwningProvider))
- {
+ if (EcoreUtil.isAncestor(this, newOwningProvider)) {
throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); //$NON-NLS-1$
}
NotificationChain msgs = null;
diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ElementTypeFilterImpl.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ElementTypeFilterImpl.java
index 9be37e7cb46..80980cb6384 100644
--- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ElementTypeFilterImpl.java
+++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ElementTypeFilterImpl.java
@@ -27,7 +27,6 @@ import org.eclipse.papyrus.infra.gmfdiag.assistant.AssistantPackage;
import org.eclipse.papyrus.infra.gmfdiag.assistant.ElementTypeFilter;
import org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider;
import org.eclipse.papyrus.infra.gmfdiag.assistant.internal.operations.ElementTypeFilterOperations;
-import org.eclipse.uml2.common.util.CacheAdapter;
/**
* <!-- begin-user-doc -->
@@ -184,14 +183,6 @@ public class ElementTypeFilterImpl extends MinimalEObjectImpl.Container implemen
*/
@Override
public IElementType getElementType() {
- CacheAdapter cache = getCacheAdapter();
- if (cache != null) {
- IElementType result = (IElementType) cache.get(eResource(), this, AssistantPackage.Literals.ELEMENT_TYPE_FILTER__ELEMENT_TYPE);
- if (result == null) {
- cache.put(eResource(), this, AssistantPackage.Literals.ELEMENT_TYPE_FILTER__ELEMENT_TYPE, result = ElementTypeFilterOperations.getElementType(this));
- }
- return result;
- }
return ElementTypeFilterOperations.getElementType(this);
}
@@ -338,7 +329,7 @@ public class ElementTypeFilterImpl extends MinimalEObjectImpl.Container implemen
return super.toString();
}
- StringBuffer result = new StringBuffer(super.toString());
+ StringBuilder result = new StringBuilder(super.toString());
result.append(" (name: "); //$NON-NLS-1$
result.append(name);
result.append(", elementTypeID: "); //$NON-NLS-1$
@@ -361,16 +352,4 @@ public class ElementTypeFilterImpl extends MinimalEObjectImpl.Container implemen
return EcoreUtil.create(eClass);
}
- /**
- * Retrieves the cache adapter for this '<em><b>Element Type Filter</b></em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return The cache adapter for this '<em><b>Element Type Filter</b></em>'.
- * @generated
- */
- protected CacheAdapter getCacheAdapter() {
- return CacheAdapter.getCacheAdapter(this);
- }
-
} // ElementTypeFilterImpl
diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ModelingAssistantProviderImpl.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ModelingAssistantProviderImpl.java
index 63da5469a1f..b8e20a1a1ee 100644
--- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ModelingAssistantProviderImpl.java
+++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ModelingAssistantProviderImpl.java
@@ -19,37 +19,28 @@ import java.util.Collection;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
-
import org.eclipse.emf.common.util.EList;
-
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.InternalEObject;
-
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
-
-import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.util.InternalEList;
-
import org.eclipse.gmf.runtime.common.core.service.IOperation;
import org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener;
import org.eclipse.gmf.runtime.emf.type.core.IClientContext;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.papyrus.infra.filters.Filter;
-
import org.eclipse.papyrus.infra.gmfdiag.assistant.Assistant;
import org.eclipse.papyrus.infra.gmfdiag.assistant.AssistantPackage;
import org.eclipse.papyrus.infra.gmfdiag.assistant.ConnectionAssistant;
import org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider;
-
import org.eclipse.papyrus.infra.gmfdiag.assistant.PopupAssistant;
import org.eclipse.papyrus.infra.gmfdiag.assistant.internal.operations.ModelingAssistantProviderOperations;
-import org.eclipse.uml2.common.util.CacheAdapter;
import org.eclipse.uml2.common.util.DerivedUnionEObjectEList;
import org.eclipse.uml2.common.util.SubsetSupersetEDataTypeUniqueEList;
@@ -254,17 +245,6 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container
*/
@Override
public EList<Assistant> getAssistants() {
- CacheAdapter cache = getCacheAdapter();
- if (cache != null) {
- Resource eResource = eResource();
- @SuppressWarnings("unchecked")
- EList<Assistant> assistants = (EList<Assistant>) cache.get(eResource, this, AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__ASSISTANT);
- if (assistants == null) {
- cache.put(eResource, this, AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__ASSISTANT,
- assistants = new DerivedUnionEObjectEList<>(Assistant.class, this, AssistantPackage.MODELING_ASSISTANT_PROVIDER__ASSISTANT, ASSISTANT_ESUBSETS));
- }
- return assistants;
- }
return new DerivedUnionEObjectEList<>(Assistant.class, this, AssistantPackage.MODELING_ASSISTANT_PROVIDER__ASSISTANT, ASSISTANT_ESUBSETS);
}
@@ -429,15 +409,6 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container
*/
@Override
public EList<IElementType> getElementTypes() {
- CacheAdapter cache = getCacheAdapter();
- if (cache != null) {
- @SuppressWarnings("unchecked")
- EList<IElementType> result = (EList<IElementType>) cache.get(eResource(), this, AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__ELEMENT_TYPE);
- if (result == null) {
- cache.put(eResource(), this, AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__ELEMENT_TYPE, result = ModelingAssistantProviderOperations.getElementTypes(this));
- }
- return result;
- }
return ModelingAssistantProviderOperations.getElementTypes(this);
}
@@ -474,14 +445,6 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container
*/
@Override
public IClientContext getClientContext() {
- CacheAdapter cache = getCacheAdapter();
- if (cache != null) {
- IClientContext result = (IClientContext) cache.get(eResource(), this, AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__CLIENT_CONTEXT);
- if (result == null) {
- cache.put(eResource(), this, AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__CLIENT_CONTEXT, result = ModelingAssistantProviderOperations.getClientContext(this));
- }
- return result;
- }
return ModelingAssistantProviderOperations.getClientContext(this);
}
@@ -520,15 +483,6 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container
*/
@Override
public EList<IElementType> getExcludedElementTypes() {
- CacheAdapter cache = getCacheAdapter();
- if (cache != null) {
- @SuppressWarnings("unchecked")
- EList<IElementType> result = (EList<IElementType>) cache.get(eResource(), this, AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__EXCLUDED_ELEMENT_TYPE);
- if (result == null) {
- cache.put(eResource(), this, AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__EXCLUDED_ELEMENT_TYPE, result = ModelingAssistantProviderOperations.getExcludedElementTypes(this));
- }
- return result;
- }
return ModelingAssistantProviderOperations.getExcludedElementTypes(this);
}
@@ -554,15 +508,6 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container
*/
@Override
public EList<IElementType> getRelationshipTypes() {
- CacheAdapter cache = getCacheAdapter();
- if (cache != null) {
- @SuppressWarnings("unchecked")
- EList<IElementType> result = (EList<IElementType>) cache.get(eResource(), this, AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE);
- if (result == null) {
- cache.put(eResource(), this, AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE, result = ModelingAssistantProviderOperations.getRelationshipTypes(this));
- }
- return result;
- }
return ModelingAssistantProviderOperations.getRelationshipTypes(this);
}
@@ -1033,7 +978,7 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container
return super.toString();
}
- StringBuffer result = new StringBuffer(super.toString());
+ StringBuilder result = new StringBuilder(super.toString());
result.append(" (listener: "); //$NON-NLS-1$
result.append(listeners);
result.append(", name: "); //$NON-NLS-1$
@@ -1065,18 +1010,6 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container
}
/**
- * Retrieves the cache adapter for this '<em><b>Modeling Assistant Provider</b></em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return The cache adapter for this '<em><b>Modeling Assistant Provider</b></em>'.
- * @generated
- */
- protected CacheAdapter getCacheAdapter() {
- return CacheAdapter.getCacheAdapter(this);
- }
-
- /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/PopupAssistantImpl.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/PopupAssistantImpl.java
index b601d400705..3da47be873c 100644
--- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/PopupAssistantImpl.java
+++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/PopupAssistantImpl.java
@@ -15,17 +15,12 @@ package org.eclipse.papyrus.infra.gmfdiag.assistant.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
-
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
-
import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
import org.eclipse.emf.ecore.resource.Resource;
-
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.papyrus.infra.filters.Filter;
-
import org.eclipse.papyrus.infra.gmfdiag.assistant.AssistantPackage;
import org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider;
import org.eclipse.papyrus.infra.gmfdiag.assistant.PopupAssistant;
@@ -282,8 +277,7 @@ public class PopupAssistantImpl extends AssistantImpl implements PopupAssistant
@Override
public void setOwningProvider(ModelingAssistantProvider newOwningProvider) {
if (newOwningProvider != eInternalContainer() || (eContainerFeatureID() != AssistantPackage.POPUP_ASSISTANT__OWNING_PROVIDER && newOwningProvider != null)) {
- if (EcoreUtil.isAncestor(this, newOwningProvider))
- {
+ if (EcoreUtil.isAncestor(this, newOwningProvider)) {
throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); //$NON-NLS-1$
}
NotificationChain msgs = null;
diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/operations/ModelingAssistantProviderOperations.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/operations/ModelingAssistantProviderOperations.java
index baf03233a2b..43c2a9ff6d1 100644
--- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/operations/ModelingAssistantProviderOperations.java
+++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/operations/ModelingAssistantProviderOperations.java
@@ -421,7 +421,7 @@ public class ModelingAssistantProviderOperations {
if (false == type instanceof IHintedType) {
return false;
}
- String hint = ((IHintedType)type).getSemanticHint();
+ String hint = ((IHintedType) type).getSemanticHint();
return hint != null && !hint.isEmpty();
}
@@ -556,7 +556,7 @@ public class ModelingAssistantProviderOperations {
@SuppressWarnings("unchecked")
public static boolean isRelationshipType(ModelingAssistantProvider modelingAssistantProvider, IElementType elementType) {
Set<IElementType> relationshipTypes;
- CacheAdapter cache = CacheAdapter.getCacheAdapter(modelingAssistantProvider);
+ CacheAdapter cache = CacheAdapter.getCacheAdapter(modelingAssistantProvider); // bug 541590 [CDO] - change is not required here
if (cache == null) {
relationshipTypes = ImmutableSet.copyOf(modelingAssistantProvider.getRelationshipTypes());
} else {
diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/core/ModelingAssistantModelRegistry.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/core/ModelingAssistantModelRegistry.java
index da5470e75a5..c65c6e026fd 100644
--- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/core/ModelingAssistantModelRegistry.java
+++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/core/ModelingAssistantModelRegistry.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2014 Christian W. Damus and others.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,7 @@
*
* Contributors:
* Christian W. Damus - Initial API and implementation
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.assistant.internal.core;
@@ -77,7 +77,7 @@ public class ModelingAssistantModelRegistry implements IProviderChangeListener {
super();
// Attach a CacheAdapter for performance
- resourceSet.eAdapters().add(new CacheAdapter());
+ resourceSet.eAdapters().add(new CacheAdapter()); // bug 541590 [CDO] - change is not required here
// Load plug-in models
new ExtensionLoader().readRegistry();
@@ -263,7 +263,7 @@ public class ModelingAssistantModelRegistry implements IProviderChangeListener {
@Override
public void elementTypeAdded(ElementTypeAddedEvent elementTypeAddedEvent) {
// Forget everything we think we know about element types and recompute
- CacheAdapter.getCacheAdapter(resourceSet).clear();
+ CacheAdapter.getCacheAdapter(resourceSet).clear(); // bug 541590 [CDO] - change is not required here
}
};
}
diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/core/util/ProviderCache.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/core/util/ProviderCache.java
index a1a2a78a507..0067cef8e73 100644
--- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/core/util/ProviderCache.java
+++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/core/util/ProviderCache.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2015 Christian W. Damus and others.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,7 @@
*
* Contributors:
* Christian W. Damus - Initial API and implementation
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.assistant.internal.core.util;
@@ -26,7 +26,7 @@ import com.google.common.base.Function;
/**
* A simple weak cache of computed data for some input type.
- *
+ *
* @param <I>
* the input type, on which the provider computes provided data
* @param <T>
@@ -40,7 +40,7 @@ public class ProviderCache<I, T> {
/**
* Initializes me with a function that lazily computes the provided data from the input if I have not already cached it.
- *
+ *
* @param cacheFunction
* the cache populator function
*/
@@ -52,7 +52,7 @@ public class ProviderCache<I, T> {
/**
* Gets the cache for a particular provider operation.
- *
+ *
* @param provider
* the provider for which to get the cache
* @param key
@@ -64,7 +64,7 @@ public class ProviderCache<I, T> {
public static <I, T> ProviderCache<I, T> getCache(ModelingAssistantProvider provider, Class<? extends IModelingAssistantOperation> key) {
ProviderCache<I, T> result = null;
- CacheAdapter adapter = CacheAdapter.getCacheAdapter(provider);
+ CacheAdapter adapter = CacheAdapter.getCacheAdapter(provider); // bug 541590 [CDO] - change is not required here
if (adapter != null) {
result = (ProviderCache<I, T>) adapter.get(provider, key);
}
@@ -74,7 +74,7 @@ public class ProviderCache<I, T> {
/**
* Creates or replaces the cache for a particular provider operation.
- *
+ *
* @param provider
* the provider for which to create the cache
* @param key
@@ -84,9 +84,9 @@ public class ProviderCache<I, T> {
* @return the new cache (never {@code null})
*/
public static <I, T> ProviderCache<I, T> cache(ModelingAssistantProvider provider, Class<? extends IModelingAssistantOperation> key, Function<? super I, ? extends T> cacheFunction) {
- ProviderCache<I, T> result = new ProviderCache<I, T>(cacheFunction);
+ ProviderCache<I, T> result = new ProviderCache<>(cacheFunction);
- CacheAdapter adapter = CacheAdapter.getCacheAdapter(provider);
+ CacheAdapter adapter = CacheAdapter.getCacheAdapter(provider); // bug 541590 [CDO] - change is not required here
if (adapter != null) {
adapter.put(provider, key, result);
}
@@ -96,7 +96,7 @@ public class ProviderCache<I, T> {
/**
* Obtains the cached data for the specified input.
- *
+ *
* @param input
* an input object
* @return the corresponding data
diff --git a/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/tests/AssistedElementTypeFilterTest.java b/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/tests/AssistedElementTypeFilterTest.java
index 1c64bb08cb6..ef51d9a5fdf 100644
--- a/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/tests/AssistedElementTypeFilterTest.java
+++ b/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/tests/AssistedElementTypeFilterTest.java
@@ -17,9 +17,9 @@ import static org.eclipse.papyrus.infra.gmfdiag.assistant.tests.ElementTypesUtil
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
+
import java.util.Arrays;
-import junit.framework.TestCase;
-import junit.textui.TestRunner;
+
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
@@ -33,6 +33,9 @@ import org.eclipse.uml2.common.util.CacheAdapter;
import org.eclipse.uml2.uml.UMLFactory;
import org.eclipse.uml2.uml.resource.UMLResource;
+import junit.framework.TestCase;
+import junit.textui.TestRunner;
+
/**
* <!-- begin-user-doc -->
* A test case for the model object '<em><b>Assisted Element Type Filter</b></em>'.
@@ -52,8 +55,7 @@ import org.eclipse.uml2.uml.resource.UMLResource;
*
* @generated
*/
-public class AssistedElementTypeFilterTest extends TestCase
-{
+public class AssistedElementTypeFilterTest extends TestCase {
/**
* The fixture for this Assisted Element Type Filter test case.
@@ -70,8 +72,7 @@ public class AssistedElementTypeFilterTest extends TestCase
*
* @generated
*/
- public static void main(String[] args)
- {
+ public static void main(String[] args) {
TestRunner.run(AssistedElementTypeFilterTest.class);
}
@@ -82,8 +83,7 @@ public class AssistedElementTypeFilterTest extends TestCase
*
* @generated
*/
- public AssistedElementTypeFilterTest(String name)
- {
+ public AssistedElementTypeFilterTest(String name) {
super(name);
}
@@ -94,8 +94,7 @@ public class AssistedElementTypeFilterTest extends TestCase
*
* @generated
*/
- protected void setFixture(AssistedElementTypeFilter fixture)
- {
+ protected void setFixture(AssistedElementTypeFilter fixture) {
this.fixture = fixture;
}
@@ -106,8 +105,7 @@ public class AssistedElementTypeFilterTest extends TestCase
*
* @generated
*/
- protected AssistedElementTypeFilter getFixture()
- {
+ protected AssistedElementTypeFilter getFixture() {
return fixture;
}
@@ -119,10 +117,9 @@ public class AssistedElementTypeFilterTest extends TestCase
* @generated NOT
*/
@Override
- protected void setUp() throws Exception
- {
+ protected void setUp() throws Exception {
ResourceSet rset = new ResourceSetImpl();
- rset.eAdapters().add(new CacheAdapter());
+ rset.eAdapters().add(new CacheAdapter()); // bug 541590 [CDO] - change is not required here
Resource res = rset.getResource(URI.createPlatformPluginURI("org.eclipse.papyrus.infra.gmfdiag.assistant.tests/resources/test.assistants", true), true);
setFixture((AssistedElementTypeFilter) ((ModelingAssistantProvider) res.getContents().get(0)).getOwnedFilter("isAssistedElementType"));
@@ -136,8 +133,7 @@ public class AssistedElementTypeFilterTest extends TestCase
* @generated NOT
*/
@Override
- protected void tearDown() throws Exception
- {
+ protected void tearDown() throws Exception {
EMFHelper.unload(EMFHelper.getResourceSet(getFixture()));
setFixture(null);
}
@@ -150,8 +146,7 @@ public class AssistedElementTypeFilterTest extends TestCase
* @see org.eclipse.papyrus.infra.gmfdiag.assistant.AssistedElementTypeFilter#getProvider()
* @generated NOT
*/
- public void testGetProvider()
- {
+ public void testGetProvider() {
ModelingAssistantProvider provider = (ModelingAssistantProvider) EcoreUtil.getRootContainer(getFixture());
assertThat(getFixture().getProvider(), is(provider));
@@ -173,8 +168,7 @@ public class AssistedElementTypeFilterTest extends TestCase
* @see org.eclipse.papyrus.infra.filters.Filter#matches(java.lang.Object)
* @generated NOT
*/
- public void testMatches__Object()
- {
+ public void testMatches__Object() {
// Match an element type
assertThat(getFixture().matches(canonicalize(UMLElementTypes.DATA_TYPE)), is(true));
assertThat(getFixture().matches(canonicalize(UMLElementTypes.ENUMERATION)), is(false)); // don't match element-type subtypes
@@ -185,7 +179,7 @@ public class AssistedElementTypeFilterTest extends TestCase
EMFHelper.getResourceSet(getFixture()).getResources().add(uml);
uml.getContents().addAll(Arrays.asList( //
UMLFactory.eINSTANCE.createDataType(), //
- UMLFactory.eINSTANCE.createEnumeration(),//
+ UMLFactory.eINSTANCE.createEnumeration(), //
UMLFactory.eINSTANCE.createCallBehaviorAction()));
// Match an object
diff --git a/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/tests/ModelingAssistantProviderTest.java b/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/tests/ModelingAssistantProviderTest.java
index e4516c82044..6cdd8de9ecc 100644
--- a/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/tests/ModelingAssistantProviderTest.java
+++ b/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/tests/ModelingAssistantProviderTest.java
@@ -18,9 +18,9 @@ import static org.hamcrest.CoreMatchers.hasItem;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
+
import java.util.Collection;
-import junit.framework.TestCase;
-import junit.textui.TestRunner;
+
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
@@ -42,6 +42,9 @@ import org.eclipse.uml2.common.util.CacheAdapter;
import org.eclipse.uml2.uml.UMLFactory;
import org.hamcrest.CoreMatchers;
+import junit.framework.TestCase;
+import junit.textui.TestRunner;
+
/**
* <!-- begin-user-doc -->
* A test case for the model object '<em><b>Modeling Assistant Provider</b></em>'.
@@ -145,7 +148,7 @@ public class ModelingAssistantProviderTest extends TestCase {
@Override
protected void setUp() throws Exception {
ResourceSet rset = new ResourceSetImpl();
- rset.eAdapters().add(new CacheAdapter());
+ rset.eAdapters().add(new CacheAdapter()); // bug 541590 [CDO] - change is not required here
Resource res = rset.getResource(URI.createPlatformPluginURI("org.eclipse.papyrus.infra.gmfdiag.assistant.tests/resources/test.assistants", true), true);
setFixture((ModelingAssistantProvider) res.getContents().get(0));
@@ -185,8 +188,7 @@ public class ModelingAssistantProviderTest extends TestCase {
* @see org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getClientContext()
* @generated NOT
*/
- public void testGetClientContext()
- {
+ public void testGetClientContext() {
assertThat(getFixture().getClientContext(), is(ElementTypeUtils.getDefaultClientContext()));
getFixture().setClientContextID("org.eclipse.papyrus.uml.diagram.clazz.TypeContext");
@@ -211,8 +213,7 @@ public class ModelingAssistantProviderTest extends TestCase {
* @see org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getExcludedElementTypes()
* @generated NOT
*/
- public void testGetExcludedElementTypes()
- {
+ public void testGetExcludedElementTypes() {
assertThat(getFixture().getExcludedElementTypes(), hasItem(canonicalize(UMLElementTypes.ASSOCIATION_CLASS)));
}
@@ -224,8 +225,7 @@ public class ModelingAssistantProviderTest extends TestCase {
* @see org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getRelationshipTypes()
* @generated NOT
*/
- public void testGetRelationshipTypes()
- {
+ public void testGetRelationshipTypes() {
assertThat(getFixture().getRelationshipTypes(), hasItem(canonicalize(UMLElementTypes.USAGE)));
assertThat(getFixture().getRelationshipTypes(), hasItem(canonicalize(UMLElementTypes.GENERALIZATION)));
assertThat(getFixture().getRelationshipTypes(), not(hasItem(canonicalize(UMLElementTypes.CLASS))));
@@ -491,8 +491,7 @@ public class ModelingAssistantProviderTest extends TestCase {
* @see org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getElementType(java.lang.String)
* @generated NOT
*/
- public void testGetElementType__String()
- {
+ public void testGetElementType__String() {
assertThat(canonicalize(UMLElementTypes.CLASS), is(getFixture().getElementType("org.eclipse.papyrus.uml.Class")));
}
@@ -504,8 +503,7 @@ public class ModelingAssistantProviderTest extends TestCase {
* @see org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#isRelationshipType(org.eclipse.gmf.runtime.emf.type.core.IElementType)
* @generated NOT
*/
- public void testIsRelationshipType__IElementType()
- {
+ public void testIsRelationshipType__IElementType() {
assertThat(getFixture().isRelationshipType(canonicalize(UMLElementTypes.USAGE)), is(true));
assertThat(getFixture().isRelationshipType(canonicalize(UMLElementTypes.GENERALIZATION)), is(true));
assertThat(getFixture().isRelationshipType(canonicalize(UMLElementTypes.CLASS)), is(false));

Back to the top