svn commit: r13859 - trunk/src/model-mdr/src/org/argouml/model/mdr/MDRModelImplementation.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-12-06 09:38:10-0800
New Revision: 13859

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

Log:
Add comment explaining impact of always deleting UML extent

Modified: trunk/src/model-mdr/src/org/argouml/model/mdr/MDRModelImplementation.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-mdr/src/org/argouml/model/mdr/MDRModelImplementation.java?view=diff&rev=13859&p1=trunk/src/model-mdr/src/org/argouml/model/mdr/MDRModelImplementation.java&p2=trunk/src/model-mdr/src/org/argouml/model/mdr/MDRModelImplementation.java&r1=13858&r2=13859
==============================================================================
--- trunk/src/model-mdr/src/org/argouml/model/mdr/MDRModelImplementation.java	(original)
+++ trunk/src/model-mdr/src/org/argouml/model/mdr/MDRModelImplementation.java	2007-12-06 09:38:10-0800
@@ -300,22 +300,24 @@
         umlPackage = (UmlPackage) repository.getExtent(MODEL_EXTENT_NAME);
         LOG.debug("MDR Init - tried to get UML extent");
         if (umlPackage != null) {
+            // NOTE: If we switch to a persistent repository like the b-tree
+            // repository we'll want to keep the old extent(s) around
             umlPackage.refDelete();
             umlPackage = null;
+            LOG.debug("MDR Init - UML extent existed - "
+                    + "deleted it and all UML data");
         }
-        if (umlPackage == null) {
-            try {
-                umlPackage =
-                    (UmlPackage) repository.createExtent(
-                            MODEL_EXTENT_NAME, mofPackage);
-            } catch (CreationFailedException e) {
-                throw new UmlException(e);
-            }
-            LOG.debug("MDR Init - created UML extent");
+        try {
+            umlPackage =
+                (UmlPackage) repository.createExtent(
+                        MODEL_EXTENT_NAME, mofPackage);
+        } catch (CreationFailedException e) {
+            throw new UmlException(e);
         }
+        LOG.debug("MDR Init - created UML extent");
 
         if (umlPackage == null) {
-            throw new UmlException("Could not find MofPackage UML");
+            throw new UmlException("Could not create UML extent");
         }
 
         // Create and start event pump first so it's available for all others
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.