Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 37236 Details for
Bug 80307
Validation Rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
combinedFragment and ExecutionSpecification
validationPatch_060329_1.txt (text/plain), 12.24 KB, created by
James Bruck
on 2006-03-29 15:39:52 EST
(
hide
)
Description:
combinedFragment and ExecutionSpecification
Filename:
MIME Type:
Creator:
James Bruck
Created:
2006-03-29 15:39:52 EST
Size:
12.24 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.uml2.uml >Index: src/org/eclipse/uml2/uml/internal/operations/CombinedFragmentOperations.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.uml2/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/CombinedFragmentOperations.java,v >retrieving revision 1.4 >diff -u -r1.4 CombinedFragmentOperations.java >--- src/org/eclipse/uml2/uml/internal/operations/CombinedFragmentOperations.java 5 Jan 2006 22:43:25 -0000 1.4 >+++ src/org/eclipse/uml2/uml/internal/operations/CombinedFragmentOperations.java 29 Mar 2006 20:38:49 -0000 >@@ -12,14 +12,17 @@ > */ > package org.eclipse.uml2.uml.internal.operations; > >+import java.util.Iterator; > import java.util.Map; > > import org.eclipse.emf.common.util.BasicDiagnostic; > import org.eclipse.emf.common.util.Diagnostic; > import org.eclipse.emf.common.util.DiagnosticChain; >- > import org.eclipse.uml2.uml.CombinedFragment; >- >+import org.eclipse.uml2.uml.InteractionConstraint; >+import org.eclipse.uml2.uml.InteractionOperand; >+import org.eclipse.uml2.uml.InteractionOperatorKind; >+import org.eclipse.uml2.uml.UMLPlugin; > import org.eclipse.uml2.uml.util.UMLValidator; > > /** >@@ -58,72 +61,89 @@ > * If the interactionOperator is opt, loop, break, or neg there must be exactly one operand > * true > * <!-- end-model-doc --> >- * @generated >+ * @generated NOT > */ > public static boolean validateOptLoopBreakNeg( > CombinedFragment combinedFragment, DiagnosticChain diagnostics, > Map context) { >- // TODO: implement this method >- // -> specify the condition that violates the invariant >- // -> verify the details of the diagnostic, including severity and message >- // Ensure that you remove @generated or mark it @generated NOT >- if (false) { >+ >+ boolean result = true; >+ >+ InteractionOperatorKind op = combinedFragment.getInteractionOperator(); >+ >+ switch (op.getValue()) { >+ case InteractionOperatorKind.OPT : >+ case InteractionOperatorKind.LOOP : >+ case InteractionOperatorKind.NEG : >+ case InteractionOperatorKind.BREAK : >+ int operandCount = combinedFragment.getOperands().size(); >+ result = (operandCount == 1); >+ break; >+ default : >+ result = true; >+ } >+ if (!result) { > if (diagnostics != null) { >- diagnostics >- .add(new BasicDiagnostic( >- Diagnostic.ERROR, >- UMLValidator.DIAGNOSTIC_SOURCE, >- UMLValidator.COMBINED_FRAGMENT__OPT_LOOP_BREAK_NEG, >- org.eclipse.emf.ecore.plugin.EcorePlugin.INSTANCE >- .getString( >- "_UI_GenericInvariant_diagnostic", new Object[]{"validateOptLoopBreakNeg", org.eclipse.emf.ecore.util.EObjectValidator.getObjectLabel(combinedFragment, context)}), //$NON-NLS-1$ //$NON-NLS-2$ >- new Object[]{combinedFragment})); >+ diagnostics.add(new BasicDiagnostic(Diagnostic.WARNING, >+ UMLValidator.DIAGNOSTIC_SOURCE, >+ UMLValidator.COMBINED_FRAGMENT__OPT_LOOP_BREAK_NEG, >+ UMLPlugin.INSTANCE.getString( >+ "_UI_CombinedFragment_OptLoopBreakNeg_diagnostic", //$NON-NLS-1$ >+ getMessageSubstitutions(context, combinedFragment)), >+ new Object[]{combinedFragment})); > } >- return false; > } >- return true; >+ return result; > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * <!-- begin-model-doc --> >- * The InteractionConstraint with minint and maxint only apply when attached to an InteractionOperand where the interactionOperator is loop. >- * true >+ * The InteractionConstraint with minint and maxint only apply when attached >+ * to an InteractionOperand where the interactionOperator is loop. true > * <!-- end-model-doc --> >- * @generated >+ * >+ * @generated NOT > */ > public static boolean validateMinintAndMaxint( > CombinedFragment combinedFragment, DiagnosticChain diagnostics, > Map context) { >- // TODO: implement this method >- // -> specify the condition that violates the invariant >- // -> verify the details of the diagnostic, including severity and message >- // Ensure that you remove @generated or mark it @generated NOT >- if (false) { >+ >+ boolean result = true; >+ if (combinedFragment.getInteractionOperator() != InteractionOperatorKind.LOOP_LITERAL) { >+ for (Iterator iter = combinedFragment.getOperands().iterator(); iter >+ .hasNext();) { >+ InteractionOperand next = (InteractionOperand) iter.next(); >+ InteractionConstraint guard = next.getGuard(); >+ if ((guard != null) >+ && ((guard.getMinint() != null) || (guard.getMaxint() != null))) { >+ result = false; >+ } >+ } >+ } >+ if (!result) { > if (diagnostics != null) { >- diagnostics >- .add(new BasicDiagnostic( >- Diagnostic.ERROR, >- UMLValidator.DIAGNOSTIC_SOURCE, >- UMLValidator.COMBINED_FRAGMENT__MININT_AND_MAXINT, >- org.eclipse.emf.ecore.plugin.EcorePlugin.INSTANCE >- .getString( >- "_UI_GenericInvariant_diagnostic", new Object[]{"validateMinintAndMaxint", org.eclipse.emf.ecore.util.EObjectValidator.getObjectLabel(combinedFragment, context)}), //$NON-NLS-1$ //$NON-NLS-2$ >- new Object[]{combinedFragment})); >+ diagnostics.add(new BasicDiagnostic(Diagnostic.WARNING, >+ UMLValidator.DIAGNOSTIC_SOURCE, >+ UMLValidator.COMBINED_FRAGMENT__MININT_AND_MAXINT, >+ UMLPlugin.INSTANCE.getString( >+ "_UI_CombinedFragment_MinintAndMaxint_diagnostic", //$NON-NLS-1$ >+ getMessageSubstitutions(context, combinedFragment)), >+ new Object[]{combinedFragment})); > } >- return false; > } >- return true; >+ return result; > } > > /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * <!-- begin-model-doc --> >- * If the interactionOperator is break, the corresponding InteractionOperand must cover all Lifelines within the enclosing InteractionFragment. >- * true >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * <!-- begin-model-doc --> >+ * If the interactionOperator is break, the corresponding InteractionOperand >+ * must cover all Lifelines within the enclosing InteractionFragment. true > * <!-- end-model-doc --> >+ * > * @generated > */ > public static boolean validateBreak(CombinedFragment combinedFragment, >Index: src/org/eclipse/uml2/uml/internal/operations/ExecutionSpecificationOperations.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.uml2/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/ExecutionSpecificationOperations.java,v >retrieving revision 1.4 >diff -u -r1.4 ExecutionSpecificationOperations.java >--- src/org/eclipse/uml2/uml/internal/operations/ExecutionSpecificationOperations.java 5 Jan 2006 22:43:25 -0000 1.4 >+++ src/org/eclipse/uml2/uml/internal/operations/ExecutionSpecificationOperations.java 29 Mar 2006 20:38:49 -0000 >@@ -17,9 +17,9 @@ > import org.eclipse.emf.common.util.BasicDiagnostic; > import org.eclipse.emf.common.util.Diagnostic; > import org.eclipse.emf.common.util.DiagnosticChain; >- >+import org.eclipse.emf.common.util.EList; > import org.eclipse.uml2.uml.ExecutionSpecification; >- >+import org.eclipse.uml2.uml.UMLPlugin; > import org.eclipse.uml2.uml.util.UMLValidator; > > /** >@@ -55,28 +55,35 @@ > * The startEvent and the finishEvent must be on the same Lifeline > * start.lifeline = finish.lifeline > * <!-- end-model-doc --> >- * @generated >+ * @generated NOT > */ > public static boolean validateSameLifeline( > ExecutionSpecification executionSpecification, > DiagnosticChain diagnostics, Map context) { >- // TODO: implement this method >- // -> specify the condition that violates the invariant >- // -> verify the details of the diagnostic, including severity and message >- // Ensure that you remove @generated or mark it @generated NOT >- if (false) { >- if (diagnostics != null) { >- diagnostics >- .add(new BasicDiagnostic( >- Diagnostic.ERROR, >- UMLValidator.DIAGNOSTIC_SOURCE, >- UMLValidator.EXECUTION_SPECIFICATION__SAME_LIFELINE, >- org.eclipse.emf.ecore.plugin.EcorePlugin.INSTANCE >- .getString( >- "_UI_GenericInvariant_diagnostic", new Object[]{"validateSameLifeline", org.eclipse.emf.ecore.util.EObjectValidator.getObjectLabel(executionSpecification, context)}), //$NON-NLS-1$ //$NON-NLS-2$ >- new Object[]{executionSpecification})); >+ if ((executionSpecification.getStart() != null) >+ && (executionSpecification.getFinish() != null)) { >+ EList startLifelines = executionSpecification.getStart() >+ .getCovereds(); >+ EList finishLifelines = executionSpecification.getFinish() >+ .getCovereds(); >+ if (startLifelines.isEmpty() || finishLifelines.isEmpty() >+ || !startLifelines.containsAll(finishLifelines) >+ || !finishLifelines.containsAll(startLifelines)) { >+ if (diagnostics != null) { >+ diagnostics >+ .add(new BasicDiagnostic( >+ Diagnostic.WARNING, >+ UMLValidator.DIAGNOSTIC_SOURCE, >+ UMLValidator.EXECUTION_SPECIFICATION__SAME_LIFELINE, >+ UMLPlugin.INSTANCE >+ .getString( >+ "_UI_ExecutionSpecification_SameLifeline_diagnostic", //$NON-NLS-1$ >+ getMessageSubstitutions(context, >+ executionSpecification)), >+ new Object[]{executionSpecification})); >+ } >+ return false; > } >- return false; > } > return true; > } >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.uml2/plugins/org.eclipse.uml2.uml/plugin.properties,v >retrieving revision 1.5 >diff -u -r1.5 plugin.properties >--- plugin.properties 28 Mar 2006 18:26:14 -0000 1.5 >+++ plugin.properties 29 Mar 2006 20:38:49 -0000 >@@ -128,6 +128,7 @@ > > _UI_Package_ElementsPublicOrPrivate_diagnostic = Element ''{0}'', owned by package ''{1}'', has visibility that is neither public nor private. > >+ > _UI_Property_SubsettingContextConforms_diagnostic = The context of the subsetting property ''{0}'' does not conform to the context of subsetted property ''{1}''. > _UI_Property_NavigableReadOnly_diagnostic = Non-navigable property ''{0}'' is marked as read-only. > _UI_Property_DerivedUnionIsDerived_diagnostic = Derived union ''{0}'' is not derived. >@@ -140,7 +141,24 @@ > _UI_RedefinableElement_RedefinitionConsistent_diagnostic = Redefining element ''{0}'' is not consistent with redefined element ''{1}''. > _UI_RedefinableElement_RedefinitionContextValid_diagnostic = None of the redefinition contexts of redefining element ''{0}'' is a specialization of at least one of the redefinition contexts for redefined element ''{1}''. > >+_UI_Interface_Visibility_diagnostic = The interface ''{0}''has at least one feature which is not public. >+ > _UI_UseCase_MustHaveName_diagnostic = Use case ''{0}'' must have a name. > _UI_UseCase_BinaryAssociations_diagnostic = Use case ''{0}'' can only be involved in binary associations. > _UI_UseCase_NoAssociationToUseCase_diagnostic = Use case ''{0}'' is involved in an association with another use case ''{1}'' having the same subject. > _UI_UseCase_CannotIncludeSelf_diagnostic = Use case ''{0}'' cannot include itself. >+ >+ >+_UI_Behavior_ParametersMatch_diagnostic = One or more parameters of the behavior ''{0}'' do not match. >+_UI_Behavior_FeatureOfContextClassifier_diagnostic = The behavioral feature ''{0}'' must be a feature of the context classifier of the behavior. >+ >+_UI_Port_PortAggregation_diagnostic = Port ''{0}'' must have composite aggregation kind. >+_UI_Port_DefaultValue_diagnostic = Port ''{0}'' must not have a default value if it is typed by an interface. >+ >+_UI_Profile_MetaclassReferenceNotSpecialized_diagnostic = An element imported as a metaclass reference is not specialized or generalized in profile ''{0}''. >+_UI_Profile_ReferencesSameMetamodel_diagnostic = All elements imported either as metaclass references or through metamodel references owned by profile ''{0}'' must be members of the same base reference metamodel. >+ >+_UI_CombinedFragment_OptLoopBreakNeg_diagnostic = The combined fragment ''{0}'' has an interactionOperator of either opt, loop, break, or neg but does not have exactly one operand. >+_UI_ExecutionSpecification_SameLifeline_diagnostic = Execution specification ''{0}'' must have start event and finish event on the same lifeline. >+ >+ >\ No newline at end of file
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
Kenn.Hussey
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 80307
:
35921
|
36338
|
36914
|
37131
|
37153
|
37217
| 37236 |
37419
|
40586
|
41343
|
84050
|
85114
|
85115
|
85127
|
228168