Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 25532 invoked from network); 11 Jan 2005 17:45:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 11 Jan 2005 17:45:46 -0000 Received: (qmail 10250 invoked by uid 500); 11 Jan 2005 17:45:45 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 10057 invoked by uid 500); 11 Jan 2005 17:45:44 -0000 Mailing-List: contact dev-help@ant.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 dev@ant.apache.org Received: (qmail 10044 invoked by uid 99); 11 Jan 2005 17:45:44 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from junior.lgc.com (HELO junior.lgc.com) (134.132.72.99) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 11 Jan 2005 09:45:43 -0800 Received: from lgchvw02.lgc.com (lgchvw02.lgc.com [134.132.93.108]) by junior.lgc.com (8.11.7/8.11.3) with SMTP id j0BHjgu22823 for ; Tue, 11 Jan 2005 11:45:42 -0600 (CST) Received: from 134.132.72.99 by lgchvw02.lgc.com (InterScan E-Mail VirusWall NT); Tue, 11 Jan 2005 11:45:35 -0600 Received: from HOUEXCH903.landmark.lgc.com (houexch903 [134.132.167.43]) by junior.lgc.com (8.11.7/8.11.3) with ESMTP id j0BHjaN22808 for ; Tue, 11 Jan 2005 11:45:36 -0600 (CST) Received: from HOUEXCH902.landmark.lgc.com ([134.132.167.38]) by HOUEXCH903.landmark.lgc.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 11 Jan 2005 11:45:31 -0600 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: or file collections Date: Tue, 11 Jan 2005 11:45:31 -0600 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: or file collections Thread-Index: AcT4A5UVGmFzY2r3Q4em9GcDxYBMMAAADdqg From: "Dominique Devienne" To: "Ant Developers List" X-OriginalArrivalTime: 11 Jan 2005 17:45:31.0376 (UTC) FILETIME=[5855CF00:01C4F805] X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N > From: Matt Benson [mailto:gudnabrsam@yahoo.com] >=20 > --- Stefan Bodewig wrote: > [SNIP, re clone task:] > > Maybe I just don't understand how useful it is? > > > Usefulness would depend on the class being cloned and > what the user chose to do with it. It's almost (to my > thinking) along the lines of the Nice or Parallel > tasks in that it provides a basic and open-ended Ant > way to use a Java feature. It just happened that AFS > clones can be modified in basically the way one would > expect/hope for. A clone of an object of some other > type might not be so accommodating. The > open-endedness of the task might allow a user to > become frustrated by the misbehavior of a cloned > object; at the same time the task doesn't seem to > represent any hidden dangers of a nature worse than, > say, Delete (lesson: test your build files before > assuming they will do what you want). > In any event, this task has generated some nervousness > or distaste, and I must guess that if put to a vote it > will not pass (according to the bylaws re code > changes). The greatest part of my attachment to the > task is the research into the UE system it represents > for me, but I'm sure that knowledge will not be > wasted. On that subject, Peter expressed concern over > Clone's implementation mechanism as well (UE subclass) > but has not yet responded to my followup questions > (did you miss them, Peter?). Leaving the debate about whether is a good idea or not aside (I tend not to like it, as I already wrote), maybe using Object.clone() is not the best way to implement this. After all, allowing to clone any Java object, not just Ant types, is probably overkill and weird. Another approach would be to use the UnknownElement of the Ant type to duplicate/augment to create a brand new instance of the same Ant type (using the normal Ant instantiation techniques for types/tasks) and configure it using the merged raw XML info in the 'parent' UE (accessed by reference) and the 'overriding' UE. This would be similar in spirit to the implementation technique in macrodef, where the raw XML info from the macro instance is weaved in with the macro definition before being instantiated. So you're not cloning a Java instance anymore, you're instantiating a new one configured exactly as the previous one modulo the changes made. I find this very similar to macrodefs, and this would allow to truly 'extend' a datatype, not just augmenting by possibly even 'overriding' attributes from the 'base' type. It's a bit like if any refid'able type is an implicit presetdef ;-) --DD --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org