ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant Project.java
Date Tue, 02 Apr 2002 14:59:44 GMT
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:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message