ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r1476822 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/taskdefs/Execute.java
Date Sun, 28 Apr 2013 19:53:25 GMT
Author: antoine
Date: Sun Apr 28 19:53:25 2013
New Revision: 1476822

URL: http://svn.apache.org/r1476822
Log:
simplifying Execute.getEnvironmentVariables since we are now always at least on Java 1.5

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Execute.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=1476822&r1=1476821&r2=1476822&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Sun Apr 28 19:53:25 2013
@@ -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
 ===================================
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Execute.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Execute.java?rev=1476822&r1=1476821&r2=1476822&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Execute.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Execute.java Sun Apr 28 19:53:25
2013
@@ -38,7 +38,6 @@ import org.apache.tools.ant.taskdefs.con
 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();



Mime
View raw message