Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/DetectRecursivity.java')
-rw-r--r--extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/DetectRecursivity.java41
1 files changed, 17 insertions, 24 deletions
diff --git a/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/DetectRecursivity.java b/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/DetectRecursivity.java
index 79593bae69e..50cc6750850 100644
--- a/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/DetectRecursivity.java
+++ b/extraplugins/robotml/org.eclipse.papyrus.robotml.validation/src/org/eclipse/papyrus/robotml/validation/constraints/DetectRecursivity.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* 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
@@ -12,17 +12,9 @@
package org.eclipse.papyrus.robotml.validation.constraints;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.validation.AbstractModelConstraint;
import org.eclipse.emf.validation.IValidationContext;
-import org.eclipse.papyrus.RobotML.RobotMLPackage;
-import org.eclipse.papyrus.infra.core.resource.NotFoundException;
-import org.eclipse.papyrus.uml.tools.model.UmlModel;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.Profile;
import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.util.UMLUtil;
// TODO: Auto-generated Javadoc
/**
@@ -36,23 +28,24 @@ public class DetectRecursivity extends AbstractModelConstraint {
* @see org.eclipse.emf.validation.AbstractModelConstraint#validate(org.eclipse.emf.validation.IValidationContext)
*/
+ @Override
public IStatus validate(IValidationContext ctx) {
-
- Property subsystem = (Property)ctx.getTarget();
-
- if (ConstraintsUtil.verifyRobotMLApplied(subsystem)){
- //System.err.println("\n\n Type: "+subsystem.getType() +"\n Owner: "+ subsystem.getOwner());
- if(subsystem.getType() == null) {
- return ctx.createFailureStatus("Property (subsystem or attribute) must have a Type " + subsystem.getQualifiedName());
- } else if(subsystem.getType().equals(subsystem.getOwner())) {
- return ctx.createFailureStatus("Problem of recursivity the subsystem " + subsystem.getQualifiedName() + " is typed by the same system that contains it)");
- }
+
+ Property subsystem = (Property) ctx.getTarget();
+
+ if (ConstraintsUtil.verifyRobotMLApplied(subsystem)) {
+ // System.err.println("\n\n Type: "+subsystem.getType() +"\n Owner: "+ subsystem.getOwner());
+ if (subsystem.getType() == null) {
+ return ctx.createFailureStatus("Property (subsystem or attribute) must have a Type " + subsystem.getQualifiedName());
+ } else if (subsystem.getType().equals(subsystem.getOwner())) {
+ return ctx.createFailureStatus("Problem of recursivity the subsystem " + subsystem.getQualifiedName() + " is typed by the same system that contains it)");
+ }
}
-
+
return ctx.createSuccessStatus();
}
-
-
-
-
+
+
+
+
}

Back to the top