From e36ab22599742bfd0a3a2c6522251e2fe4125920 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 21 Jan 2011 14:33:47 +0000 Subject: [PATCH] fall back to system properties for build.sysclasspath if there is no project instance git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1061822 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/types/Path.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/org/apache/tools/ant/types/Path.java b/src/main/org/apache/tools/ant/types/Path.java index 16443e6f5..5cf16b00e 100644 --- a/src/main/org/apache/tools/ant/types/Path.java +++ b/src/main/org/apache/tools/ant/types/Path.java @@ -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 implements Cloneable, ResourceCollection { 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 implements Cloneable, ResourceCollection { } 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);