commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Siegfried Goeschl (JIRA)" <j...@apache.org>
Subject [jira] Commented: (EXEC-31) Fix handling of empty environment for forked process
Date Fri, 14 Nov 2008 00:56:44 GMT

    [ https://issues.apache.org/jira/browse/EXEC-31?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12647487#action_12647487
] 

Siegfried Goeschl commented on EXEC-31:
---------------------------------------

I think you are right regarding the clash - just aplied the patch and it breaks EnvironmentUtilTest.testGetProcEnvironment
... :-) ... so I have to analyze the code in more detail

> Fix handling of empty environment for forked process
> ----------------------------------------------------
>
>                 Key: EXEC-31
>                 URL: https://issues.apache.org/jira/browse/EXEC-31
>             Project: Commons Exec
>          Issue Type: Bug
>    Affects Versions: 1.0
>            Reporter: Benjamin Bentmann
>            Assignee: Siegfried Goeschl
>            Priority: Minor
>         Attachments: EXEC-31.patch
>
>
> The current implementation of {{EnvironmentUtil.toStrings()}} will turn an empty map
into a null array. The {{CommandLauncher}} implementations will then pass this array to {{Runtime.exec()}}.
However, passing in {{null}} for the env argument means to inherit the enviroment, this is
not the same as using an empty environment as specified by the caller. In other words, the
semantics of a null map and an empty map clash which I believe shouldn't.
> I suggest to have {{EnviromentUtils.toStrings()}}
> - output an emtpy array upon input of an empty map
> - output {{null}} upon input of {{null}} (primarily to ease usage, e.g. in the {{CommandLauncher}}'s)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message