Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlorenzo2011-07-20 08:23:53 +0000
committervlorenzo2011-07-20 08:23:53 +0000
commit75e437f7ac81804eb63e791dc622feecf7b4da41 (patch)
tree686ed1718234cf9ae253506d376f20684150547b
parent85a7f5ff2ead11855a5bddb4d77eb201f026e219 (diff)
downloadorg.eclipse.papyrus-75e437f7ac81804eb63e791dc622feecf7b4da41.tar.gz
org.eclipse.papyrus-75e437f7ac81804eb63e791dc622feecf7b4da41.tar.xz
org.eclipse.papyrus-75e437f7ac81804eb63e791dc622feecf7b4da41.zip
NEW - bug 352331: [SysML Static Profile] Deprecated constraint on Verify ends is still used (client is not necessarily a TestCase)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=352331
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.facets/resources/requirementsQueries.querySet2
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/query/value/getter/GetRequirementVerifiedByQuery.java14
2 files changed, 7 insertions, 9 deletions
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.facets/resources/requirementsQueries.querySet b/plugins/sysml/org.eclipse.papyrus.sysml.facets/resources/requirementsQueries.querySet
index 7b9454118ca..0e07ab9d109 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.facets/resources/requirementsQueries.querySet
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.facets/resources/requirementsQueries.querySet
@@ -30,7 +30,7 @@
<scope href="http://www.eclipse.org/uml2/3.0.0/UML#//Class"/>
</queries>
<queries xsi:type="query:JavaModelQuery" name="GetRequirementVerifiedByQuery" description="Query to get the reference &quot;verified by&quot; of the requirement" upperBound="-1" implementationClassName="org.eclipse.papyrus.sysml.facets.query.value.getter.GetRequirementVerifiedByQuery">
- <returnType xsi:type="ecore:EClass" href="http://www.eclipse.org/uml2/3.0.0/UML#//Operation"/>
+ <returnType xsi:type="ecore:EClass" href="http://www.eclipse.org/uml2/3.0.0/UML#//NamedElement"/>
<scope href="http://www.eclipse.org/uml2/3.0.0/UML#//Class"/>
</queries>
<queries xsi:type="query:JavaModelQuery" name="GetRequirementMasterQuery" description="Query to get the field reference &quot;master&quot; of the requirement" implementationClassName="org.eclipse.papyrus.sysml.facets.query.value.getter.GetRequirementMasterQuery">
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/query/value/getter/GetRequirementVerifiedByQuery.java b/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/query/value/getter/GetRequirementVerifiedByQuery.java
index 22b0143562b..011cef9b919 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/query/value/getter/GetRequirementVerifiedByQuery.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.facets/src/org/eclipse/papyrus/sysml/facets/query/value/getter/GetRequirementVerifiedByQuery.java
@@ -23,21 +23,19 @@ import org.eclipse.papyrus.sysml.requirements.Requirement;
import org.eclipse.papyrus.sysml.requirements.TestCase;
import org.eclipse.papyrus.sysml.util.ElementUtil;
import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.NamedElement;
import org.eclipse.uml2.uml.Operation;
/** Query to get the text of the requirement */
-public class GetRequirementVerifiedByQuery implements IJavaModelQuery<Class, Collection<Operation>> {
+public class GetRequirementVerifiedByQuery implements IJavaModelQuery<Class, Collection<NamedElement>> {
+
+ public Collection<NamedElement> evaluate(final Class context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
- public Collection<Operation> evaluate(final Class context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
- Collection<Operation> result = new ArrayList<Operation>();
-
Requirement requirement = ElementUtil.getStereotypeApplication(context, Requirement.class);
if (requirement != null) {
- for(TestCase current : requirement.getVerifiedBy()) {
- result.add(current.getBase_Operation());
- }
+ return requirement.getVerifiedBy();
}
- return result;
+ return null;
}
}

Back to the top