You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2011/01/21 15:33:48 UTC

svn commit: r1061822 - /ant/core/trunk/src/main/org/apache/tools/ant/types/Path.java

Author: bodewig
Date: Fri Jan 21 14:33:47 2011
New Revision: 1061822

URL: http://svn.apache.org/viewvc?rev=1061822&view=rev
Log:
fall back to system properties for build.sysclasspath if there is no project instance

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/types/Path.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/Path.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/Path.java?rev=1061822&r1=1061821&r2=1061822&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/Path.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/Path.java Fri Jan 21 14:33:47 2011
@@ -27,6 +27,7 @@ import java.util.Stack;
 import java.util.Vector;
 
 import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.MagicNames;
 import org.apache.tools.ant.PathTokenizer;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.types.resources.Union;
@@ -552,11 +553,11 @@ public class Path extends DataType imple
         Path result = new Path(getProject());
 
         String order = defValue;
-        if (getProject() != null) {
-            String o = getProject().getProperty("build.sysclasspath");
-            if (o != null) {
-                order = o;
-            }
+        String o = getProject() != null 
+            ? getProject().getProperty(MagicNames.BUILD_SYSCLASSPATH)
+            : System.getProperty(MagicNames.BUILD_SYSCLASSPATH);
+        if (o != null) {
+            order = o;
         }
         if (order.equals("only")) {
             // only: the developer knows what (s)he is doing
@@ -574,7 +575,8 @@ public class Path extends DataType imple
         } else {
             // last: don't trust the developer
             if (!order.equals("last")) {
-                log("invalid value for build.sysclasspath: " + order,
+                log("invalid value for " + MagicNames.BUILD_SYSCLASSPATH
+                    + ": " + order,
                     Project.MSG_WARN);
             }
             result.addExisting(this);