ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 14212] New: - Add an API to remove proeprties from a Project
Date Mon, 04 Nov 2002 04:51:40 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14212>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14212

Add an API to remove proeprties from a Project

           Summary: Add an API to remove proeprties from a Project
           Product: Ant
           Version: 1.5.1
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: shemnon@yahoo.com


The API provices for over-riding a property with a new value, but there is no
way to over-rider ti with a null value or remove that value.  This is kind of a
selfish request (http://freeroller.net/page/shemnon/20021103), but as you can
see from the log it would be a Good Thing if it can get pas the philosophical
objection to it.

Somthing like this... (Project.java version 1.116)

--- Project.java.old    2002-11-03 21:43:03.000000000 -0700
+++ Project.java        2002-11-03 21:46:50.000000000 -0700
@@ -440,6 +440,25 @@
     }

     /**
+     * Removes a property from the project property set.  If the property
+     * is set as a user property then this will not attempt to delete
+     * the property and will instead log an error
+     */
+    public synchronized void setProperty(String name, String value) {
+        // command line properties take precedence
+        if (null != userProperties.get(name)) {
+            log("Remove ignored for user property " + name, MSG_VERBOSE);
+            return;
+        }
+
+        if (null != properties.get(name)) {
+            log("Removing previous definition of property " + name,
+                MSG_VERBOSE);
+            properties.remove(name);
+        }
+    }
+
+    /**
      * Sets a property if no value currently exists. If the property
      * exists already, a message is logged and the method returns with
      * no other effect.

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message