Browse Source

Reorded addition of proeprties to environment when exec call has an additive environment so specified values overide values in the native environment.

Also added basic javadocs.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270519 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 23 years ago
parent
commit
0a064d62aa
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      proposal/myrmidon/src/java/org/apache/myrmidon/framework/exec/launchers/DefaultCommandLauncher.java

+ 7
- 1
proposal/myrmidon/src/java/org/apache/myrmidon/framework/exec/launchers/DefaultCommandLauncher.java View File

@@ -85,6 +85,12 @@ public class DefaultCommandLauncher
}
}

/**
* Get the native environment according to proper rules.
* Return null if no environment specified, return environment combined
* with native environment if environment data is additive else just return
* converted environment data.
*/
private String[] getEnvironmentSpec( final ExecMetaData metaData )
throws ExecException, IOException
{
@@ -98,8 +104,8 @@ public class DefaultCommandLauncher
if( metaData.isEnvironmentAdditive() )
{
final Properties newEnvironment = new Properties();
newEnvironment.putAll( environment );
newEnvironment.putAll( Environment.getNativeEnvironment() );
newEnvironment.putAll( environment );
return ExecUtil.toNativeEnvironment( newEnvironment );
}
else


Loading…
Cancel
Save