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 228168 Details for
Bug 80307
Validation Rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch for class RegionOperations
org.eclipse.uml2.uml.diff (text/plain), 4.56 KB, created by
Ansgar Radermacher
on 2013-03-09 06:47:14 EST
(
hide
)
Description:
Patch for class RegionOperations
Filename:
MIME Type:
Creator:
Ansgar Radermacher
Created:
2013-03-09 06:47:14 EST
Size:
4.56 KB
patch
obsolete
>--- orig/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/RegionOperations.java 2013-01-02 10:31:50.000000000 +0100 >+++ org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/RegionOperations.java 2013-03-09 12:37:09.769894973 +0100 >@@ -19,17 +19,17 @@ > import org.eclipse.emf.common.util.DiagnosticChain; > import org.eclipse.emf.common.util.EList; > import org.eclipse.emf.common.util.UniqueEList; >- > import org.eclipse.uml2.uml.BehavioredClassifier; > import org.eclipse.uml2.uml.Classifier; > import org.eclipse.uml2.uml.ProtocolStateMachine; >+import org.eclipse.uml2.uml.Pseudostate; >+import org.eclipse.uml2.uml.PseudostateKind; > import org.eclipse.uml2.uml.RedefinableElement; > import org.eclipse.uml2.uml.Region; > import org.eclipse.uml2.uml.State; > import org.eclipse.uml2.uml.StateMachine; > import org.eclipse.uml2.uml.Transition; > import org.eclipse.uml2.uml.Vertex; >- > import org.eclipse.uml2.uml.util.UMLValidator; > > /** >@@ -78,15 +78,19 @@ > * @param diagnostics The chain of diagnostics to which problems are to be appended. > * @param context The cache of context-specific information. > * <!-- end-model-doc --> >- * @generated >+ * @generated NOT > */ > public static boolean validateInitialVertex(Region region, > DiagnosticChain diagnostics, Map<Object, Object> 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) { >+ int initialVertex = 0; >+ for(Vertex vertex : region.getSubvertices()) { >+ if(vertex instanceof Pseudostate) { >+ if(((Pseudostate)vertex).getKind() == PseudostateKind.INITIAL_LITERAL) { >+ initialVertex++; >+ } >+ } >+ } >+ if(initialVertex > 1) { > if (diagnostics != null) { > diagnostics > .add(new BasicDiagnostic( >@@ -115,15 +119,19 @@ > * @param diagnostics The chain of diagnostics to which problems are to be appended. > * @param context The cache of context-specific information. > * <!-- end-model-doc --> >- * @generated >+ * @generated NOT > */ > public static boolean validateDeepHistoryVertex(Region region, > DiagnosticChain diagnostics, Map<Object, Object> 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) { >+ int deepHistory = 0; >+ for(Vertex vertex : region.getSubvertices()) { >+ if(vertex instanceof Pseudostate) { >+ if(((Pseudostate)vertex).getKind() == PseudostateKind.SHALLOW_HISTORY_LITERAL) { >+ deepHistory++; >+ } >+ } >+ } >+ if(deepHistory > 1) { > if (diagnostics != null) { > diagnostics > .add(new BasicDiagnostic( >@@ -152,15 +160,19 @@ > * @param diagnostics The chain of diagnostics to which problems are to be appended. > * @param context The cache of context-specific information. > * <!-- end-model-doc --> >- * @generated >+ * @generated NOT > */ > public static boolean validateShallowHistoryVertex(Region region, > DiagnosticChain diagnostics, Map<Object, Object> 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) { >+ int shallowHistory = 0; >+ for(Vertex vertex : region.getSubvertices()) { >+ if(vertex instanceof Pseudostate) { >+ if(((Pseudostate)vertex).getKind() == PseudostateKind.SHALLOW_HISTORY_LITERAL) { >+ shallowHistory++; >+ } >+ } >+ } >+ if(shallowHistory > 1) { > if (diagnostics != null) { > diagnostics > .add(new BasicDiagnostic( >@@ -187,15 +199,12 @@ > * @param diagnostics The chain of diagnostics to which problems are to be appended. > * @param context The cache of context-specific information. > * <!-- end-model-doc --> >- * @generated >+ * @generated NOT > */ > public static boolean validateOwned(Region region, > DiagnosticChain diagnostics, Map<Object, Object> 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) { >+ // ownerships must be different >+ if((region.getState() != null) == (region.getStateMachine() != null)) { > if (diagnostics != null) { > diagnostics > .add(new BasicDiagnostic(
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
Actions:
View
|
Diff
Attachments on
bug 80307
:
35921
|
36338
|
36914
|
37131
|
37153
|
37217
|
37236
|
37419
|
40586
|
41343
|
84050
|
85114
|
85115
|
85127
| 228168