svn commit: r18017 - trunk/src/argouml-app/src/org/argouml/profile/internal/ui/PropPanelCritic.java

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2010-02-15 01:10:28-0800
New Revision: 18017

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

Log:
Issue 5976: Lets trap an illegal argument and give a more useful stackdump

Modified: trunk/src/argouml-app/src/org/argouml/profile/internal/ui/PropPanelCritic.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/internal/ui/PropPanelCritic.java?view=diff&pathrev=18017&r1=18016&r2=18017
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/profile/internal/ui/PropPanelCritic.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/profile/internal/ui/PropPanelCritic.java	2010-02-15 01:10:28-0800
@@ -120,9 +120,17 @@
      * @see org.argouml.uml.ui.PropPanel#setTarget(java.lang.Object)
      */
     public void setTarget(Object t) {
+        
+        final String targetType =
+            getTarget().getClass().getCanonicalName();
+        
+        if (!(t instanceof Critic)) {
+            throw new IllegalArgumentException("A Critic is expected as the target, a " + targetType + " was received");
+        }
+        
         super.setTarget(t);
 
-        criticClass.setText(getTarget().getClass().getCanonicalName());
+        criticClass.setText(targetType);
 
         Critic c = (Critic) getTarget();
         name.setText(c.getCriticName());

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

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.