svn commit: r13265 - trunk/src/model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-08-07 13:16:02-0700
New Revision: 13265

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

Log:
Deprecate getAssociateEnds().  Fix Javadoc.  Generalize getSupertypes() so that is not limited to Classifiers.

Modified: trunk/src/model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java?view=diff&rev=13265&p1=trunk/src/model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java&p2=trunk/src/model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java&r1=13264&r2=13265
==============================================================================
--- trunk/src/model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java	(original)
+++ trunk/src/model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java	2007-08-07 13:16:02-0700
@@ -199,19 +199,17 @@
             throw new IllegalArgumentException();
         }
 
-        Classifier cls = (Classifier) cls1;
+        GeneralizableElement ge = (GeneralizableElement) cls1;
 
         Collection<GeneralizableElement> result = 
             new HashSet<GeneralizableElement>();
         try {
-            Collection<GeneralizableElement> toBeAdded = getSupertypes(cls);
+            Collection<GeneralizableElement> toBeAdded = getSupertypes(ge);
             do {
                 Collection<GeneralizableElement> newlyAdded = 
                     new HashSet<GeneralizableElement>();
                 for (GeneralizableElement element : toBeAdded) {
-                    if (element instanceof Classifier) {
-                        newlyAdded.addAll(getSupertypes(element));
-                    }
+                    newlyAdded.addAll(getSupertypes(element));
                 }
                 result.addAll(toBeAdded);
                 toBeAdded = newlyAdded;
@@ -240,10 +238,9 @@
     }
 
 
+    @SuppressWarnings("deprecation")
+    @Deprecated
     public Collection<AssociationEnd> getAssociateEnds(Object classifier) {
-        if (!(classifier instanceof Classifier)) {
-            throw new IllegalArgumentException();
-        }
         return Model.getFacade().getAssociationEnds(classifier);
     }
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.