Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2018-11-27 08:01:06 -0500
committerPatrick Tessier2018-11-27 10:43:51 -0500
commitae880b7505f411203a3c90a32ee49089c3fdb7f7 (patch)
tree297e0f714c402ebe65462850d2006f26b783b2aa
parent52faf3e1e56dd5154d314dc89266d310ff91bcec (diff)
downloadorg.eclipse.papyrus-ae880b7505f411203a3c90a32ee49089c3fdb7f7.tar.gz
org.eclipse.papyrus-ae880b7505f411203a3c90a32ee49089c3fdb7f7.tar.xz
org.eclipse.papyrus-ae880b7505f411203a3c90a32ee49089c3fdb7f7.zip
Bug 541313: [UML][CDO] UML calls to the method getCacheAdapter(EObject) must be replaced
https://bugs.eclipse.org/bugs/show_bug.cgi?id=541313 Change-Id: I590e72c871f86af1f26878aacb1884c982cdb9a4 Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
-rw-r--r--plugins/infra/filters/org.eclipse.papyrus.infra.filters.edit/.settings/.api_filters11
-rw-r--r--plugins/infra/filters/org.eclipse.papyrus.infra.filters/.settings/.api_filters39
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/ExecutionSpecificationUtil.java13
-rw-r--r--plugins/uml/m2m/org.eclipse.papyrus.uml.m2m.qvto.common/src/org/eclipse/papyrus/uml/m2m/qvto/common/transformation/AbstractImportTransformation.java2
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/DestructionOccurrenceSpecificationEditHelperAdvice.java6
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/adapters/PortTypeAdapter.java7
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProvidedInterfaceObservableList.java13
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/RequiredInterfaceObservableList.java13
-rw-r--r--tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.ui.emf.tests/src/org/eclipse/papyrus/infra/ui/internal/emf/readonly/handlers/ReferencedModelReadOnlyHandlerTest.java8
9 files changed, 33 insertions, 79 deletions
diff --git a/plugins/infra/filters/org.eclipse.papyrus.infra.filters.edit/.settings/.api_filters b/plugins/infra/filters/org.eclipse.papyrus.infra.filters.edit/.settings/.api_filters
deleted file mode 100644
index 8fae0beab5b..00000000000
--- a/plugins/infra/filters/org.eclipse.papyrus.infra.filters.edit/.settings/.api_filters
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<component id="org.eclipse.papyrus.infra.filters.edit" version="2">
- <resource path="src-gen/org/eclipse/papyrus/infra/filters/provider/FiltersItemProviderAdapterFactory.java" type="org.eclipse.papyrus.infra.filters.provider.FiltersItemProviderAdapterFactory">
- <filter comment="Generated code" id="336658481">
- <message_arguments>
- <message_argument value="org.eclipse.papyrus.infra.filters.provider.FiltersItemProviderAdapterFactory"/>
- <message_argument value="filteredElementItemProvider"/>
- </message_arguments>
- </filter>
- </resource>
-</component>
diff --git a/plugins/infra/filters/org.eclipse.papyrus.infra.filters/.settings/.api_filters b/plugins/infra/filters/org.eclipse.papyrus.infra.filters/.settings/.api_filters
deleted file mode 100644
index ae1959fe35b..00000000000
--- a/plugins/infra/filters/org.eclipse.papyrus.infra.filters/.settings/.api_filters
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<component id="org.eclipse.papyrus.infra.filters" version="2">
- <resource path="src-gen/org/eclipse/papyrus/infra/filters/FiltersFactory.java" type="org.eclipse.papyrus.infra.filters.FiltersFactory">
- <filter comment="Generated code" id="403804204">
- <message_arguments>
- <message_argument value="org.eclipse.papyrus.infra.filters.FiltersFactory"/>
- <message_argument value="createFilteredElement()"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src-gen/org/eclipse/papyrus/infra/filters/FiltersPackage.java" type="org.eclipse.papyrus.infra.filters.FiltersPackage">
- <filter comment="Generated code" id="388194388">
- <message_arguments>
- <message_argument value="org.eclipse.papyrus.infra.filters.FiltersPackage"/>
- <message_argument value="OBJECT"/>
- <message_argument value="4"/>
- </message_arguments>
- </filter>
- <filter comment="Generated code" id="388194388">
- <message_arguments>
- <message_argument value="org.eclipse.papyrus.infra.filters.FiltersPackage"/>
- <message_argument value="OPERATOR_KIND"/>
- <message_argument value="3"/>
- </message_arguments>
- </filter>
- <filter comment="Generated code" id="403804204">
- <message_arguments>
- <message_argument value="org.eclipse.papyrus.infra.filters.FiltersPackage"/>
- <message_argument value="getFilteredElement()"/>
- </message_arguments>
- </filter>
- <filter comment="Generated code" id="403804204">
- <message_arguments>
- <message_argument value="org.eclipse.papyrus.infra.filters.FiltersPackage"/>
- <message_argument value="getFilteredElement_Filter()"/>
- </message_arguments>
- </filter>
- </resource>
-</component>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/ExecutionSpecificationUtil.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/ExecutionSpecificationUtil.java
index 53e791a1e4d..709b0c7f5af 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/ExecutionSpecificationUtil.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/util/ExecutionSpecificationUtil.java
@@ -11,7 +11,7 @@
* Contributors:
* Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Initial API and implementation
* Christian W. Damus - bug 533679
- *
+ * Vincent LORENZO - bug 541313 - [UML][CDO] UML calls to the method getCacheAdapter(EObject) must be replaced
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.util;
@@ -90,7 +90,7 @@ public class ExecutionSpecificationUtil {
final EditPart editPartToSkip) {
return calculateExecutionSpecificationCorrectLocation(lifeLineEditPart, executionSpecificationRectangles, initialRectangle, Collections.singleton(editPartToSkip));
}
-
+
/**
* This allows to calculate the correct location of the execution specification with the list of rectangles of the execution specification for the current life line.
*
@@ -246,13 +246,14 @@ public class ExecutionSpecificationUtil {
public static Map<AbstractExecutionSpecificationEditPart, Rectangle> getRectangles(final LifelineEditPart lifeLineEditPart) {
return getRectangles(lifeLineEditPart, null);
}
-
+
/**
* This allows to get initial rectangles by execution specification available in the current life line.
*
* @param lifeLineEditPart
* The current life line edit part.
- * @param editPartsToSkip The collection of edit parts to skip during the calculation.
+ * @param editPartsToSkip
+ * The collection of edit parts to skip during the calculation.
* @return The map with the rectangle by execution specification edit part.
*/
public static Map<AbstractExecutionSpecificationEditPart, Rectangle> getRectangles(final LifelineEditPart lifeLineEditPart, final Collection<EditPart> editPartsToSkip) {
@@ -314,14 +315,14 @@ public class ExecutionSpecificationUtil {
/**
* Query the execution, if any, that is started by an {@code occurrence}.
- *
+ *
* @param occurrence
* an occurrence specification
* @return the execution specification that it starts
* @since 5.0
*/
public static Optional<ExecutionSpecification> getStartedExecution(OccurrenceSpecification occurrence) {
- CacheAdapter cache = CacheAdapter.getCacheAdapter(occurrence);
+ CacheAdapter cache = CacheAdapter.getInstance();
Predicate<EStructuralFeature.Setting> settingFilter = setting -> setting.getEStructuralFeature() == UMLPackage.Literals.EXECUTION_SPECIFICATION__START;
return cache.getInverseReferences(occurrence).stream()
diff --git a/plugins/uml/m2m/org.eclipse.papyrus.uml.m2m.qvto.common/src/org/eclipse/papyrus/uml/m2m/qvto/common/transformation/AbstractImportTransformation.java b/plugins/uml/m2m/org.eclipse.papyrus.uml.m2m.qvto.common/src/org/eclipse/papyrus/uml/m2m/qvto/common/transformation/AbstractImportTransformation.java
index e518d482a5d..809c13fe40b 100644
--- a/plugins/uml/m2m/org.eclipse.papyrus.uml.m2m.qvto.common/src/org/eclipse/papyrus/uml/m2m/qvto/common/transformation/AbstractImportTransformation.java
+++ b/plugins/uml/m2m/org.eclipse.papyrus.uml.m2m.qvto.common/src/org/eclipse/papyrus/uml/m2m/qvto/common/transformation/AbstractImportTransformation.java
@@ -789,7 +789,7 @@ public abstract class AbstractImportTransformation implements IImportTransformat
/** Lightweight delete operation, which only removes the object from its parent. Incoming references are not deleted */
public void delete(EObject elementToDelete) {
- CacheAdapter adapter = CacheAdapter.getCacheAdapter(elementToDelete);
+ CacheAdapter adapter = CacheAdapter.getCacheAdapter(elementToDelete); // bug 541313 [CDO] - change is not required here
if (adapter == null) {
adapter = CacheAdapter.getInstance();
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/DestructionOccurrenceSpecificationEditHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/DestructionOccurrenceSpecificationEditHelperAdvice.java
index eb718f7733c..0d7443f1652 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/DestructionOccurrenceSpecificationEditHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/DestructionOccurrenceSpecificationEditHelperAdvice.java
@@ -10,7 +10,7 @@
*
* Contributors:
* Christian W. Damus - Initial API and implementation
- *
+ * Vincent LORENZO - bug 541313 - [UML][CDO] UML calls to the method getCacheAdapter(EObject) must be replaced
*****************************************************************************/
package org.eclipse.papyrus.uml.service.types.helper.advice;
@@ -165,7 +165,7 @@ public class DestructionOccurrenceSpecificationEditHelperAdvice extends Interact
return Stream.empty();
}
- return CacheAdapter.getCacheAdapter(constrained).getNonNavigableInverseReferences(constrained)
+ return CacheAdapter.getInstance().getNonNavigableInverseReferences(constrained)
.stream()
.filter(setting -> setting.getEStructuralFeature() == UMLPackage.Literals.CONSTRAINT__CONSTRAINED_ELEMENT)
.map(setting -> (Constraint) setting.getEObject())
@@ -193,7 +193,7 @@ public class DestructionOccurrenceSpecificationEditHelperAdvice extends Interact
// These observations are contained by packages, so the interaction context isn't
// actually useful. It is specified for API consistency with other cases
- return CacheAdapter.getCacheAdapter(observed).getNonNavigableInverseReferences(observed)
+ return CacheAdapter.getInstance().getNonNavigableInverseReferences(observed)
.stream()
.filter(setting -> setting.getEStructuralFeature() == UMLPackage.Literals.TIME_OBSERVATION__EVENT)
.map(setting -> (TimeObservation) setting.getEObject());
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/adapters/PortTypeAdapter.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/adapters/PortTypeAdapter.java
index 46653c5dceb..7fb5a545f47 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/adapters/PortTypeAdapter.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/adapters/PortTypeAdapter.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2014 CEA LIST.
+ * Copyright (c) 2018 CEA LIST.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,6 +10,7 @@
*
* Contributors:
* Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Initial API and implementation
+ * Vincent LORENZO - bug 541313 - [UML][CDO] UML calls to the method getCacheAdapter(EObject) must be replaced
*****************************************************************************/
package org.eclipse.papyrus.uml.tools.adapters;
@@ -164,7 +165,7 @@ public class PortTypeAdapter extends AdapterImpl {
* @param type
* Type is origin of evaluation
* @return
- * Source according of derived feature
+ * Source according of derived feature
*/
private EObject determineSource(Type type) {
EObject source = type;
@@ -185,7 +186,7 @@ public class PortTypeAdapter extends AdapterImpl {
private void updateObservableList() {
// Clear cache for derived feature
- CacheAdapter cache = CacheAdapter.getCacheAdapter(port);
+ CacheAdapter cache = CacheAdapter.getInstance();
if (cache != null) {
cache.put(port, derivedFeature, null);
}
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProvidedInterfaceObservableList.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProvidedInterfaceObservableList.java
index 0cfaa80f199..830a72a33f4 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProvidedInterfaceObservableList.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProvidedInterfaceObservableList.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2011 - 2014 CEA LIST.
+ * Copyright (c) 2011 - 2014, 2018 CEA LIST.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -11,6 +11,7 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Initial API and implementation
+ * Vincent LORENZO - bug 541313 - [UML][CDO] UML calls to the method getCacheAdapter(EObject) must be replaced
*****************************************************************************/
package org.eclipse.papyrus.uml.tools.databinding;
@@ -86,8 +87,8 @@ public class ProvidedInterfaceObservableList extends PapyrusObservableList {
@Override
public Command getAddAllCommand(Collection<?> values) {
CompoundCommand returnedCommand = new CompoundCommand();
- List<IEditCommandRequest> requests = new LinkedList<IEditCommandRequest>();
- List<Interface> commonInterfacesList = new ArrayList<Interface>();
+ List<IEditCommandRequest> requests = new LinkedList<>();
+ List<Interface> commonInterfacesList = new ArrayList<>();
EList<Interface> providedInterfaceList = port.getProvideds();
@@ -114,7 +115,7 @@ public class ProvidedInterfaceObservableList extends PapyrusObservableList {
// Handle deleted interfaces
if (providedInterfaceList.size() != commonInterfacesList.size()) {
- List<Interface> removedInterfacesList = new ArrayList<Interface>();
+ List<Interface> removedInterfacesList = new ArrayList<>();
for (Interface current : providedInterfaceList) {
if (!commonInterfacesList.contains(current)) {
@@ -165,7 +166,7 @@ public class ProvidedInterfaceObservableList extends PapyrusObservableList {
@Override
public Command getRemoveAllCommand(Collection<?> values) {
CompoundCommand commands = new CompoundCommand();
- Set<Dependency> dependenciesSet = new HashSet<Dependency>();
+ Set<Dependency> dependenciesSet = new HashSet<>();
for (Object value : values) {
Dependency realization = getRealization(value);
@@ -226,7 +227,7 @@ public class ProvidedInterfaceObservableList extends PapyrusObservableList {
@Override
protected void doExecute() {
- CacheAdapter cache = CacheAdapter.getCacheAdapter(port);
+ CacheAdapter cache = CacheAdapter.getInstance();
cache.put(port, UMLPackage.Literals.PORT__PROVIDED, null);
}
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/RequiredInterfaceObservableList.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/RequiredInterfaceObservableList.java
index 9585acbb9f1..8c7bf6db621 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/RequiredInterfaceObservableList.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/RequiredInterfaceObservableList.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
+ * Copyright (c) 2011, 2018 CEA LIST.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -11,6 +11,7 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Initial API and implementation
+ * Vincent LORENZO - bug 541313 - [UML][CDO] UML calls to the method getCacheAdapter(EObject) must be replaced
*****************************************************************************/
package org.eclipse.papyrus.uml.tools.databinding;
@@ -84,8 +85,8 @@ public class RequiredInterfaceObservableList extends PapyrusObservableList {
public Command getAddAllCommand(Collection<?> values) {
CompoundCommand returnedCommand = new CompoundCommand();
- List<IEditCommandRequest> requests = new LinkedList<IEditCommandRequest>();
- List<Interface> commonInterfacesList = new ArrayList<Interface>();
+ List<IEditCommandRequest> requests = new LinkedList<>();
+ List<Interface> commonInterfacesList = new ArrayList<>();
EList<Interface> requiredInterfacesList = port.getRequireds();
for (Object current : values) {
@@ -110,7 +111,7 @@ public class RequiredInterfaceObservableList extends PapyrusObservableList {
// Handle deleted interfaces
if (requiredInterfacesList.size() != commonInterfacesList.size()) {
- List<Interface> removedInterfacesList = new ArrayList<Interface>();
+ List<Interface> removedInterfacesList = new ArrayList<>();
for (Interface current : requiredInterfacesList) {
if (!commonInterfacesList.contains(current)) {
@@ -154,7 +155,7 @@ public class RequiredInterfaceObservableList extends PapyrusObservableList {
@Override
public Command getRemoveAllCommand(Collection<?> values) {
CompoundCommand commands = new CompoundCommand();
- Set<Dependency> dependenciesSet = new HashSet<Dependency>();
+ Set<Dependency> dependenciesSet = new HashSet<>();
for (Object value : values) {
Dependency usage = getUsage(value);
@@ -181,7 +182,7 @@ public class RequiredInterfaceObservableList extends PapyrusObservableList {
@Override
protected void doExecute() {
- CacheAdapter cache = CacheAdapter.getCacheAdapter(port);
+ CacheAdapter cache = CacheAdapter.getInstance();
cache.put(port, UMLPackage.Literals.PORT__REQUIRED, null);
}
diff --git a/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.ui.emf.tests/src/org/eclipse/papyrus/infra/ui/internal/emf/readonly/handlers/ReferencedModelReadOnlyHandlerTest.java b/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.ui.emf.tests/src/org/eclipse/papyrus/infra/ui/internal/emf/readonly/handlers/ReferencedModelReadOnlyHandlerTest.java
index 77dd810bb7a..7eacdf3980b 100644
--- a/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.ui.emf.tests/src/org/eclipse/papyrus/infra/ui/internal/emf/readonly/handlers/ReferencedModelReadOnlyHandlerTest.java
+++ b/tests/junit/plugins/infra/emf/org.eclipse.papyrus.infra.ui.emf.tests/src/org/eclipse/papyrus/infra/ui/internal/emf/readonly/handlers/ReferencedModelReadOnlyHandlerTest.java
@@ -1,5 +1,5 @@
-/*
- * Copyright (c) 2014, 2016 CEA, Christian W. Damus, and others.
+/**
+ * Copyright (c) 2014, 2016, 2018 CEA, 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
@@ -11,7 +11,7 @@
* Contributors:
* Christian W. Damus (CEA) - Initial API and implementation
* Christian W. Damus - bugs 463631, 485220
- *
+ * Vincent LORENZO - bug 541313 - [UML][CDO] UML calls to the method getCacheAdapter(EObject) must be replaced
*/
package org.eclipse.papyrus.infra.ui.internal.emf.readonly.handlers;
@@ -333,7 +333,7 @@ public class ReferencedModelReadOnlyHandlerTest extends AbstractPapyrusTest {
void assertLocalViewsNotReadOnly(EObject object) {
boolean foundSomeLocalViews = false;
- for (EStructuralFeature.Setting setting : CacheAdapter.getCacheAdapter(object).getNonNavigableInverseReferences(object)) {
+ for (EStructuralFeature.Setting setting : CacheAdapter.getInstance().getNonNavigableInverseReferences(object)) {
if (setting.getEStructuralFeature() == NotationPackage.Literals.VIEW__ELEMENT) {
EObject view = setting.getEObject();
Set<URI> uris = ControlledResourceTracker.getInstance(domain).getRootResourceURIs(view.eResource().getURI());

Back to the top