From: <ju...@us...> - 2006-12-15 15:30:23
|
Revision: 3722 http://svn.sourceforge.net/smartfrog/?rev=3722&view=rev Author: julgui Date: 2006-12-15 07:30:21 -0800 (Fri, 15 Dec 2006) Log Message: ----------- Protecting empty "code" returns in asComponentDescription. Modified Paths: -------------- trunk/core/smartfrog/src/org/smartfrog/services/shellscript/ScriptExecutionImpl.java Modified: trunk/core/smartfrog/src/org/smartfrog/services/shellscript/ScriptExecutionImpl.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/services/shellscript/ScriptExecutionImpl.java 2006-12-15 14:58:57 UTC (rev 3721) +++ trunk/core/smartfrog/src/org/smartfrog/services/shellscript/ScriptExecutionImpl.java 2006-12-15 15:30:21 UTC (rev 3722) @@ -50,7 +50,7 @@ protected boolean resultReady = false; - private Integer code = null; + private Integer code = new Integer(-9999); protected InvocationTargetException exception = null; @@ -186,9 +186,10 @@ private ComponentDescription asComponentDescription() { ComponentDescription cd = new ComponentDescriptionImpl(null, new ContextImpl(), false); try { - cd.sfAddAttribute("stdErr", stdErr); - cd.sfAddAttribute("stdOut", stdOut); - cd.sfAddAttribute("code", code); + cd.sfAddAttribute("resultReady", new Boolean (resultReady)); + if (code!=null) cd.sfAddAttribute("code", code); + if (stdErr!=null) cd.sfAddAttribute("stdErr", stdErr); + if (stdOut!=null) cd.sfAddAttribute("stdOut", stdOut); if (exception != null) cd.sfAddAttribute("exception", exception); } catch (SmartFrogRuntimeException ex) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |