You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2002/11/04 05:51:40 UTC
DO NOT REPLY [Bug 14212] New: -
Add an API to remove proeprties from a Project
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: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>