Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@apache.org Received: (qmail 95157 invoked from network); 3 Jun 2002 13:03:08 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 3 Jun 2002 13:03:08 -0000 Received: (qmail 12168 invoked by uid 97); 3 Jun 2002 13:03:06 -0000 Delivered-To: qmlist-jakarta-archive-ant-dev@jakarta.apache.org Received: (qmail 12152 invoked by uid 97); 3 Jun 2002 13:03:06 -0000 Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 12102 invoked by uid 98); 3 Jun 2002 13:03:05 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Message-ID: <001b01c20afe$fc45a9b0$903b8f80@darden.virginia.edu> From: "Erik Hatcher" To: "Ant Developers List" References: <20020528135313.60590.qmail@icarus.apache.org> <01ae01c20afc$fd9dd190$0100a8c0@jose> Subject: Re: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Ant.java Date: Mon, 3 Jun 2002 09:02:58 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Originally setProperty was deprecated (I believe) and it was decided to keep the warning in there, but remove the deprecation, otherwise Ant's own codebase would be calling the deprecated method in several places since we did not want to remove those instances of setProperty use. Erik ----- Original Message ----- From: "Jose Alberto Fernandez" To: "Ant Developers List" Sent: Monday, June 03, 2002 8:48 AM Subject: Re: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Ant.java Please take a look at the comment below on the usage of the Project API. From: Subject: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Ant.java > bodewig 02/05/28 06:53:13 > > Modified: src/main/org/apache/tools/ant Tag: ANT_15_BRANCH > Project.java > src/main/org/apache/tools/ant/taskdefs Tag: ANT_15_BRANCH > Ant.java > Log: > Make sure user properties remain user properties - no matter what > inheritall says. Deal with potential non-String properties. > > Revision Changes Path > No revision > > > No revision > > > 1.108.2.1 +2 -2 jakarta-ant/src/main/org/apache/tools/ant/Project.java > > Index: Ant.java > =================================================================== > RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java,v > retrieving revision 1.56.2.2 > retrieving revision 1.56.2.3 > diff -u -r1.56.2.2 -r1.56.2.3 > --- Ant.java 10 May 2002 11:33:54 -0000 1.56.2.2 > +++ Ant.java 28 May 2002 13:53:13 -0000 1.56.2.3 [...] > - String value = (String) prop1.get(arg); > - if (inheritAll){ > - newProject.setProperty(arg, value); > - } else { > - newProject.setUserProperty(arg, value); > + String value = props.get(arg).toString(); Correct me if I am wrong but the snipped of code below is reproducing code that we already have in the Project API. I suggest we use here the existing API instead of implementing its current behaviour. > + if (newProject.getProperty(arg) == null){ > + // no user property > + newProject.setProperty(arg, value); > + } Intead we just need to call here: + newProject.setNewProperty(arg, value); > } > } > } > My point in this is that we should stop using Project.setProperty() which allows mutation and USE the API that it is already there that guarantees the correct behaviour. Since we cannot get rid of it, could we at least mark Project.setProperty() as deprecated and tell people to use Property.setNewProperty() instead? Jose Alberto -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: