Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 16247 invoked from network); 20 May 2008 08:02:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 May 2008 08:02:06 -0000 Received: (qmail 97968 invoked by uid 500); 20 May 2008 08:02:06 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 97895 invoked by uid 500); 20 May 2008 08:02:06 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 97884 invoked by uid 99); 20 May 2008 08:02:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 May 2008 01:02:06 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.130] (HELO eos.apache.org) (140.211.11.130) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 May 2008 08:01:20 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 71268D2EB for ; Tue, 20 May 2008 08:01:41 +0000 (GMT) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Apache Wiki To: dev@commons.apache.org Date: Tue, 20 May 2008 08:01:41 -0000 Message-ID: <20080520080141.19757.26453@eos.apache.org> Subject: [Commons Wiki] Update of "CLI" by skolima X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Commons Wiki" for change notification. The following page has been changed by skolima: http://wiki.apache.org/commons/CLI The comment on the change is: there is a default shallow copy in .Net! ------------------------------------------------------------------------------ }}} - In C# all classes derive from Object, just like Java. Even primitive types are automatically boxed and unboxed into Object-derived subclasses, just like Java. For a class to be cloneable it must implement the interface ICloneable and the method 'public object Clone()', just like Java. However, unlike Java, Object does not implement a shallow clone method. This means that the logic you implement in your own clone method cannot call the super (or base as it is in C#) class's Clone method to get a typed, shallow clone. This would not necessarily be a big deal as you could just create a new class that you are attempting to clone, but if you do this you would have to be able to clone its properties (assuming they are publicly accessible or can be set via a constructor) manually -- a cumbersome task. + + '''check this.MemberwiseClone()''' You see the problem. Option is cloneable, and it relies on the Object's clone method. I toyed around porting this functionality via two methods. The first method looked like this: --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org