svn commit: r13326 - trunk/src_new/org/argouml/uml/ProfileJava.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-08-13 19:49:11-0700
New Revision: 13326

Modified:
   trunk/src_new/org/argouml/uml/ProfileJava.java

Log:
Make URL handling more bulletproof

Modified: trunk/src_new/org/argouml/uml/ProfileJava.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ProfileJava.java?view=diff&rev=13326&p1=trunk/src_new/org/argouml/uml/ProfileJava.java&p2=trunk/src_new/org/argouml/uml/ProfileJava.java&r1=13325&r2=13326
==============================================================================
--- trunk/src_new/org/argouml/uml/ProfileJava.java	(original)
+++ trunk/src_new/org/argouml/uml/ProfileJava.java	2007-08-13 19:49:11-0700
@@ -26,11 +26,11 @@
 
 import java.io.File;
 import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Iterator;
-import java.util.List;
 
 import org.apache.log4j.Logger;
 import org.argouml.application.api.Argo;
@@ -369,11 +369,16 @@
         File modelFile = new File(modelFilename);
         if (modelFile.exists()) {
             try {
-                systemId = modelFile.toURL().toExternalForm();
+                URL url = modelFile.toURL();
+                if (url != null) {
+                    systemId = url.toExternalForm();
+                } else {
+                    systemId = null;
+                }
             } catch (MalformedURLException e1) {
                 systemId = null;
             }
-            if (systemId.endsWith(".zip")) {
+            if (systemId != null && systemId.endsWith(".zip")) {
                 systemId = systemId + "!/"
                 + systemId.substring(0, systemId.length() - 4);
             }
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.