[jboss-cvs] JBossAS SVN: r71214 - branches/Branch_4_2/console/src/main/org/jboss/console/twiddle/command.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Mar 24 19:00:44 EDT 2008


Author: dimitris at jboss.org
Date: 2008-03-24 19:00:44 -0400 (Mon, 24 Mar 2008)
New Revision: 71214

Modified:
   branches/Branch_4_2/console/src/main/org/jboss/console/twiddle/command/InvokeCommand.java
Log:
JBAS-5108, print out 'invoke' results, even when no property editor is found.

Modified: branches/Branch_4_2/console/src/main/org/jboss/console/twiddle/command/InvokeCommand.java
===================================================================
--- branches/Branch_4_2/console/src/main/org/jboss/console/twiddle/command/InvokeCommand.java	2008-03-24 22:16:56 UTC (rev 71213)
+++ branches/Branch_4_2/console/src/main/org/jboss/console/twiddle/command/InvokeCommand.java	2008-03-24 23:00:44 UTC (rev 71214)
@@ -40,7 +40,8 @@
  * Invoke an operation on an MBean.
  *
  * @author <a href="mailto:jason at planet57.com">Jason Dillon</a>
- * @author Scott.Stark at jboss.org
+ * @author <a href="mailto:scott.stark at jboss.org">Scott Stark</a>
+ * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
  * @version <tt>$Revision$</tt>
  */
 public class InvokeCommand
@@ -241,10 +242,18 @@
 
          if (result != null)
          {
-            PropertyEditor editor = PropertyEditors.getEditor(result.getClass());
-            editor.setValue(result);
-            resultText = editor.getAsText();
-            log.debug("Converted result: " + resultText);
+            try
+            {
+               PropertyEditor editor = PropertyEditors.getEditor(result.getClass());
+               editor.setValue(result);
+               resultText = editor.getAsText();
+               log.debug("Converted result: " + resultText);
+            }
+            catch (RuntimeException e)
+            {
+               // No property editor found or some conversion problem
+               resultText = result.toString();
+            }
          }
          else
          {




More information about the jboss-cvs-commits mailing list