svn commit: r18321 - trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileManagerImpl.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2010-04-21 12:13:43-0700
New Revision: 18321

Modified:
   trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileManagerImpl.java

Log:
If we fail to register a profile then log the fact as an error with the profile name

Modified: trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileManagerImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileManagerImpl.java?view=diff&pathrev=18321&r1=18320&r2=18321
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileManagerImpl.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileManagerImpl.java	2010-04-21 12:13:43-0700
@@ -279,21 +279,28 @@
      * from the configuration.
      */
     private boolean registerProfileInternal(Profile p) {
-        boolean loadDefaultProfilesFromConfiguration = false;
-        if (p != null && !profiles.contains(p)) {
-            if (p instanceof UserDefinedProfile
-                    || getProfileForClass(p.getClass().getName()) == null) {
-                loadDefaultProfilesFromConfiguration = true;
-                profiles.add(p);
-                for (Critic critic : p.getCritics()) {
-                    for (Object meta : critic.getCriticizedDesignMaterials()) {
-                        Agency.register(critic, meta);
+        
+        try {
+            boolean loadDefaultProfilesFromConfiguration = false;
+            if (p != null && !profiles.contains(p)) {
+                if (p instanceof UserDefinedProfile
+                        || getProfileForClass(p.getClass().getName()) == null) {
+                    loadDefaultProfilesFromConfiguration = true;
+                    profiles.add(p);
+                    for (Critic critic : p.getCritics()) {
+                        for (Object meta : critic.getCriticizedDesignMaterials()) {
+                            Agency.register(critic, meta);
+                        }
+                        critic.setEnabled(false);
                     }
-                    critic.setEnabled(false);
                 }
             }
+            return loadDefaultProfilesFromConfiguration;
+        } catch (RuntimeException e) {
+            // TODO: Better if we wrap in a ProfileException and throw that
+            LOG.error("Error registering profile " + p.getDisplayName());
+            throw e;
         }
-        return loadDefaultProfilesFromConfiguration;
     }
 
     public void removeProfile(Profile p) {

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

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.