svn commit: r17436 - trunk/src/argouml-app/src/org/argouml/persistence/UmlFilePersister.java

Thomas Neustupny <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: thn
Date: 2009-10-30 11:07:38-0700
New Revision: 17436

Modified:
   trunk/src/argouml-app/src/org/argouml/persistence/UmlFilePersister.java

Log:
loading UML2 models: trying to fix the loading of profile projects, but it still doesn't work

Modified: trunk/src/argouml-app/src/org/argouml/persistence/UmlFilePersister.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/persistence/UmlFilePersister.java?view=diff&pathrev=17436&r1=17435&r2=17436
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/persistence/UmlFilePersister.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/persistence/UmlFilePersister.java	2009-10-30 11:07:38-0700
@@ -380,13 +380,14 @@
                 try {
                     persister.load(p, inputSource);
                 } catch (OpenException e) {
-                    // UML 2.x files don't have XMI as their outer
-                    // tag.  Try again with uml:Model
-                    if ("XMI".equals(persister.getMainTag()) 
+                    // UML 2.x files could also contain a profile model.
+                    // Try again with uml:Profile as main tag.
+                    if ("uml:Model".equals(persister.getMainTag()) 
                             && e.getCause() instanceof UmlException 
                             && e.getCause().getCause() instanceof IOException) {
-                        inputStream.reopen("uml:Model");
+                        inputStream.reopen("uml:Profile");
                         persister.load(p, inputSource);
+                        p.setProjectType(Project.PROFILE_PROJECT);
                     } else {
                         throw e;
                     }

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

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.