From 4212c03c3d965482f900f0660eac89ed265315bd Mon Sep 17 00:00:00 2001 From: Matthew Jason Benson Date: Thu, 14 Jun 2007 21:27:32 +0000 Subject: [PATCH] fmting, add getProject() git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@547411 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tools/ant/PropertyHelper.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/org/apache/tools/ant/PropertyHelper.java b/src/main/org/apache/tools/ant/PropertyHelper.java index 1af3f4309..11082e3a5 100644 --- a/src/main/org/apache/tools/ant/PropertyHelper.java +++ b/src/main/org/apache/tools/ant/PropertyHelper.java @@ -77,11 +77,10 @@ public class PropertyHelper { //override facility for subclasses to put custom hashtables in - // -------------------- Hook management -------------------- /** - * Set the project for which this helper is performing property resolution + * Set the project for which this helper is performing property resolution. * * @param p the project instance. */ @@ -89,6 +88,14 @@ public class PropertyHelper { this.project = p; } + /** + * Get this PropertyHelper's Project. + * @return Project + */ + public Project getProject() { + return project; + } + /** There are 2 ways to hook into property handling: * - you can replace the main PropertyHelper. The replacement is required * to support the same semantics (of course :-) @@ -118,12 +125,11 @@ public class PropertyHelper { * reference. User tasks can also add themselves to the chain, and provide * dynamic properties. * - * @param project the project fro which the property helper is required. + * @param project the project for which the property helper is required. * * @return the project's property helper. */ - public static synchronized - PropertyHelper getPropertyHelper(Project project) { + public static synchronized PropertyHelper getPropertyHelper(Project project) { PropertyHelper helper = (PropertyHelper) project.getReference(MagicNames.REFID_PROPERTY_HELPER); if (helper != null) { @@ -274,7 +280,6 @@ public class PropertyHelper { if (replacement == null) { replacement = getProperty(ns, propertyName); } - if (replacement == null) { project.log("Property \"" + propertyName + "\" has not been set", Project.MSG_VERBOSE); @@ -457,7 +462,7 @@ public class PropertyHelper { if (o != null) { return o; } - return userProperties.get(name); + return userProperties.get(name); } @@ -639,5 +644,4 @@ public class PropertyHelper { fragments.addElement(value.substring(prev)); } } - }