svn commit: r13196 - 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-01 07:12:19-0700
New Revision: 13196

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

Log:
Don't return null for methods that return a Collection

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=13196&p1=trunk/src_new/org/argouml/uml/ProfileJava.java&p2=trunk/src_new/org/argouml/uml/ProfileJava.java&r1=13195&r2=13196
==============================================================================
--- trunk/src_new/org/argouml/uml/ProfileJava.java	(original)
+++ trunk/src_new/org/argouml/uml/ProfileJava.java	2007-08-01 07:12:19-0700
@@ -33,6 +33,7 @@
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
@@ -394,11 +395,11 @@
                 } catch (MalformedURLException e) {
                     LOG.error("Exception while loading profile '"
                             + modelFilename + "'", e);
-                    return null;
+                    return Collections.EMPTY_LIST;
                 } catch (IOException e) {
                     LOG.error("Exception while loading profile '"
                             + modelFilename + "'", e);
-                    return null;
+                    return Collections.EMPTY_LIST;
                 }
             } else {
                 is = new FileInputStream(modelFile);
@@ -425,11 +426,11 @@
             } catch (UmlException e) {
                 LOG.error("Exception while loading profile '" 
                         + modelFilename + "'", e);
-                return null;
+                return Collections.EMPTY_LIST;
             }
         }
         LOG.error("Profile '" + modelFilename + "' not found");
-        return null;
+        return Collections.EMPTY_LIST;
     }
 
     /**
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.