svn commit: r15888 - trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ModelEventPumpMDRImpl.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2008-10-06 08:49:03-0700
New Revision: 15888

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

Log:
Issue 5438: Make sure MDR exceptions get wrapped with Model exception when caller attempts to register for a deleted element 
http://argouml.tigris.org/issues/show_bug.cgi?id=5438

Modified: trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ModelEventPumpMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ModelEventPumpMDRImpl.java?view=diff&rev=15888&p1=trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ModelEventPumpMDRImpl.java&p2=trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ModelEventPumpMDRImpl.java&r1=15887&r2=15888
==============================================================================
--- trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ModelEventPumpMDRImpl.java	(original)
+++ trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ModelEventPumpMDRImpl.java	2008-10-06 08:49:03-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2005-2007 The Regents of the University of California. All
+// Copyright (c) 2005-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -54,6 +54,7 @@
 import org.argouml.model.AddAssociationEvent;
 import org.argouml.model.AttributeChangeEvent;
 import org.argouml.model.DeleteInstanceEvent;
+import org.argouml.model.InvalidElementException;
 import org.argouml.model.Model;
 import org.argouml.model.RemoveAssociationEvent;
 import org.argouml.model.UmlChangeEvent;
@@ -511,8 +512,12 @@
 
         // Fetch the key before going in synchronized mode
         String mofId = ((MDRObject) modelElement).refMofId();
-        verifyAttributeNames(((MDRObject) modelElement).refMetaObject(),
-                propertyNames);
+        try {
+            verifyAttributeNames(((MDRObject) modelElement).refMetaObject(),
+                    propertyNames);
+        } catch (InvalidObjectException e) {
+            throw new InvalidElementException(e);
+        }
         if (LOG.isDebugEnabled()) {
             LOG.debug("Register ["
                     + " element:" + formatElement(modelElement)
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.