You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2002/04/02 16:59:44 UTC
cvs commit: jakarta-ant/src/main/org/apache/tools/ant Project.java
bodewig 02/04/02 06:59:43
Modified: src/main/org/apache/tools/ant Project.java
Log:
only warn if override changes the value of a reference.
PR: 5161
Revision Changes Path
1.101 +7 -2 jakarta-ant/src/main/org/apache/tools/ant/Project.java
Index: Project.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Project.java,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -r1.100 -r1.101
--- Project.java 28 Mar 2002 12:15:26 -0000 1.100
+++ Project.java 2 Apr 2002 14:59:43 -0000 1.101
@@ -82,7 +82,7 @@
*
* @author duncan@x180.com
*
- * @version $Revision: 1.100 $
+ * @version $Revision: 1.101 $
*/
public class Project {
@@ -1639,7 +1639,12 @@
* @param value The value of the reference. Must not be <code>null</code>.
*/
public void addReference(String name, Object value) {
- if (null != references.get(name)) {
+ Object old = references.get(name);
+ if (old == value) {
+ // no warning, this is not changing anything
+ return;
+ }
+ if (old != null) {
log("Overriding previous definition of reference to " + name,
MSG_WARN);
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>