svn commit: r13698 - trunk/src_new/org/argouml/moduleloader/ModuleLoader2.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-11-02 03:00:03-0700
New Revision: 13698

Modified:
   trunk/src_new/org/argouml/moduleloader/ModuleLoader2.java

Log:
Issue 4889 - protect against any exception during class loading

Modified: trunk/src_new/org/argouml/moduleloader/ModuleLoader2.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/moduleloader/ModuleLoader2.java?view=diff&rev=13698&p1=trunk/src_new/org/argouml/moduleloader/ModuleLoader2.java&p2=trunk/src_new/org/argouml/moduleloader/ModuleLoader2.java&r1=13697&r2=13698
==============================================================================
--- trunk/src_new/org/argouml/moduleloader/ModuleLoader2.java	(original)
+++ trunk/src_new/org/argouml/moduleloader/ModuleLoader2.java	2007-11-02 03:00:03-0700
@@ -662,6 +662,14 @@
             LOG.error("The default constructor for class " + classname
                       + " is not found.", e);
             return false;
+        } catch (NoClassDefFoundError e) {
+            LOG.error("Unable to find required class while loading "
+                    + classname + " - may indicate an obsolete"
+                    + " extension module or an unresolved dependency", e);
+            return false;
+        } catch (Exception e) {
+            LOG.error("Unexpected error while loading " + classname, e);
+            return false;
         }
 
         if (!Modifier.isPublic(defaultConstructor.getModifiers())) {
@@ -689,12 +697,12 @@
                     + " cannot be called.", e);
             return false;
         } catch (NoClassDefFoundError e) {
-            LOG.error("Unable to find required class while loading "
+            LOG.error("Unable to find required class while instantiating "
                     + classname + " - may indicate an obsolete"
-                    + " extension module", e);
+                    + " extension module or an unresolved dependency", e);
             return false;
         } catch (Exception e) {
-            LOG.error("Unexpected error while loading " + classname, e);
+            LOG.error("Unexpected error while instantiating " + classname, e);
             return false;
         }
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.