svn commit: r16351 - trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2008-12-12 18:28:09-0800
New Revision: 16351

Modified:
   trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java

Log:
Return clients and suppliers as unmodifiable collections. We should consider similar with other returned collections and maybe consider returning a copy.

Modified: trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java?view=diff&pathrev=16351&r1=16350&r2=16351
==============================================================================
--- trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java	(original)
+++ trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java	2008-12-12 18:28:09-0800
@@ -1433,8 +1433,9 @@
     public Collection<Dependency> getClientDependencies(Object handle) {
         try {
             if (handle instanceof ModelElement) {
-                ModelElement me = (ModelElement) handle;
-                return me.getClientDependency();
+                final ModelElement me = (ModelElement) handle;
+                return Collections.unmodifiableCollection(
+                        me.getClientDependency());
             }
         } catch (InvalidObjectException e) {
             throw new InvalidElementException(e);
@@ -3310,10 +3311,12 @@
     public Collection getSupplierDependencies(Object handle) {
         try {
             if (handle instanceof ModelElement) {
-                ModelElement me = (ModelElement) handle;                
-                return ((org.omg.uml.UmlPackage) me.refOutermostPackage())
+                final ModelElement me = (ModelElement) handle;                
+                return Collections.unmodifiableCollection(
+                        ((org.omg.uml.UmlPackage) me.refOutermostPackage())
                         .getCore().getASupplierSupplierDependency()
-                        .getSupplierDependency((ModelElement) handle);
+                        .getSupplierDependency((ModelElement) handle)
+                );
             }
         } catch (InvalidObjectException e) {
             throw new InvalidElementException(e);

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=983624

To unsubscribe from this discussion, e-mail: [[email protected]].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.