Browse Source

simplifying Execute.getEnvironmentVariables since we are now always at least on Java 1.5

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1476822 13f79535-47bb-0310-9956-ffa450edef68
master
Antoine Levy-Lambert 12 years ago
parent
commit
1327421596
2 changed files with 4 additions and 8 deletions
  1. +2
    -0
      WHATSNEW
  2. +2
    -8
      src/main/org/apache/tools/ant/taskdefs/Execute.java

+ 2
- 0
WHATSNEW View File

@@ -27,6 +27,8 @@ Other changes:
* strict attribute added to <signjar>.
Bugzilla Report 54889.

* simplifying Execute.getEnvironmentVariables since we are only running on Java 1.5 or higher now

Changes from Ant 1.8.4 TO Ant 1.9.0
===================================



+ 2
- 8
src/main/org/apache/tools/ant/taskdefs/Execute.java View File

@@ -38,7 +38,6 @@ import org.apache.tools.ant.taskdefs.condition.Os;
import org.apache.tools.ant.taskdefs.launcher.CommandLauncher;
import org.apache.tools.ant.types.Commandline;
import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.ant.util.JavaEnvUtils;
import org.apache.tools.ant.util.StringUtils;

/**
@@ -109,14 +108,9 @@ public class Execute {
if (procEnvironment != null) {
return procEnvironment;
}
if (JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_1_5)
&& !Os.isFamily("openvms")) {
if (!Os.isFamily("openvms")) {
try {
@SuppressWarnings("unchecked")
final Map<String, String> cast = (Map<String, String>) System.class
.getMethod("getenv", new Class[0])
.invoke(null, new Object[0]);
procEnvironment = cast;
procEnvironment = System.getenv();
return procEnvironment;
} catch (Exception x) {
x.printStackTrace();


Loading…
Cancel
Save