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 85127 Details for
Bug 80307
Validation Rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Update for AssociationOperations
Validation_AssociationOperations.patch (text/plain), 5.48 KB, created by
James Bruck
on 2007-12-12 16:55:54 EST
(
hide
)
Description:
Update for AssociationOperations
Filename:
MIME Type:
Creator:
James Bruck
Created:
2007-12-12 16:55:54 EST
Size:
5.48 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.uml2.uml >Index: src/org/eclipse/uml2/uml/internal/operations/AssociationOperations.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.uml2/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/AssociationOperations.java,v >retrieving revision 1.12 >diff -u -r1.12 AssociationOperations.java >--- src/org/eclipse/uml2/uml/internal/operations/AssociationOperations.java 3 May 2007 21:11:52 -0000 1.12 >+++ src/org/eclipse/uml2/uml/internal/operations/AssociationOperations.java 12 Dec 2007 21:53:07 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM - initial API and implementation >+ * Javier Muñoz (Integranova) - Implementation of some validations > * > * $Id: AssociationOperations.java,v 1.12 2007/05/03 21:11:52 khussey Exp $ > */ >@@ -18,16 +19,14 @@ > import org.eclipse.emf.common.util.Diagnostic; > import org.eclipse.emf.common.util.DiagnosticChain; > import org.eclipse.emf.common.util.EList; >- > import org.eclipse.emf.common.util.UniqueEList; > import org.eclipse.emf.ecore.InternalEObject; >- > import org.eclipse.uml2.common.util.UnionEObjectEList; > import org.eclipse.uml2.uml.Association; >+import org.eclipse.uml2.uml.Classifier; > import org.eclipse.uml2.uml.Property; > import org.eclipse.uml2.uml.Type; > import org.eclipse.uml2.uml.UMLPackage; >- > import org.eclipse.uml2.uml.util.UMLValidator; > > /** >@@ -71,27 +70,33 @@ > * @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 validateSpecializedEndNumber(Association association, > 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) { >- if (diagnostics != null) { >- diagnostics >- .add(new BasicDiagnostic( >- Diagnostic.ERROR, >- UMLValidator.DIAGNOSTIC_SOURCE, >- UMLValidator.ASSOCIATION__SPECIALIZED_END_NUMBER, >- org.eclipse.emf.ecore.plugin.EcorePlugin.INSTANCE >- .getString( >- "_UI_GenericInvariant_diagnostic", new Object[]{"validateSpecializedEndNumber", org.eclipse.emf.ecore.util.EObjectValidator.getObjectLabel(association, context)}), //$NON-NLS-1$ //$NON-NLS-2$ >- new Object[]{association})); >+ >+ for (Classifier parent : association.parents()) { >+ >+ if (parent instanceof Association) { >+ Association nextAssociation = (Association) parent; >+ >+ if (association.getMemberEnds().size() != nextAssociation >+ .getMemberEnds().size()) { >+ >+ if (diagnostics != null) { >+ diagnostics >+ .add(new BasicDiagnostic( >+ Diagnostic.ERROR, >+ UMLValidator.DIAGNOSTIC_SOURCE, >+ UMLValidator.ASSOCIATION__SPECIALIZED_END_NUMBER, >+ org.eclipse.emf.ecore.plugin.EcorePlugin.INSTANCE >+ .getString( >+ "_UI_Association_SpecializedEndNumber_diagnostic", new Object[]{"validateSpecializedEndNumber", org.eclipse.emf.ecore.util.EObjectValidator.getObjectLabel(association, context)}), //$NON-NLS-1$ //$NON-NLS-2$ >+ new Object[]{association})); >+ } >+ return false; >+ } > } >- return false; > } > return true; > } >@@ -141,27 +146,31 @@ > * @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 validateBinaryAssociations(Association association, > 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) { >- if (diagnostics != null) { >- diagnostics >- .add(new BasicDiagnostic( >- Diagnostic.ERROR, >- UMLValidator.DIAGNOSTIC_SOURCE, >- UMLValidator.ASSOCIATION__BINARY_ASSOCIATIONS, >- org.eclipse.emf.ecore.plugin.EcorePlugin.INSTANCE >- .getString( >- "_UI_GenericInvariant_diagnostic", new Object[]{"validateBinaryAssociations", org.eclipse.emf.ecore.util.EObjectValidator.getObjectLabel(association, context)}), //$NON-NLS-1$ //$NON-NLS-2$ >- new Object[]{association})); >+ >+ for (Property memberEnd : association.getMemberEnds()) { >+ >+ if (memberEnd.getAggregation().getValue() != org.eclipse.uml2.uml.AggregationKind.NONE) { >+ >+ if (!association.isBinary()) { >+ >+ if (diagnostics != null) { >+ diagnostics >+ .add(new BasicDiagnostic( >+ Diagnostic.ERROR, >+ UMLValidator.DIAGNOSTIC_SOURCE, >+ UMLValidator.ASSOCIATION__BINARY_ASSOCIATIONS, >+ org.eclipse.emf.ecore.plugin.EcorePlugin.INSTANCE >+ .getString( >+ "_UI_Association_AggregationIsBinary_diagnostic", new Object[]{"validateBinaryAssociations", org.eclipse.emf.ecore.util.EObjectValidator.getObjectLabel(association, context)}), //$NON-NLS-1$ //$NON-NLS-2$ >+ new Object[]{association})); >+ } >+ return false; >+ } > } >- return false; > } > return true; > }
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