Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 52569 invoked from network); 17 Apr 2002 17:55:58 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 17 Apr 2002 17:55:58 -0000 Received: (qmail 27290 invoked by uid 97); 17 Apr 2002 17:55:59 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 27273 invoked by uid 97); 17 Apr 2002 17:55:59 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 27256 invoked from network); 17 Apr 2002 17:55:58 -0000 Message-ID: <008401c1e639$13aa3250$8d011eac@LTRIBBLE> Reply-To: "Louis Tribble" From: "Louis Tribble" To: "Jakarta Commons Developers List" References: Subject: Re: [SUBMIT] OptimizedFastArrayList Date: Wed, 17 Apr 2002 10:55:35 -0700 Organization: WebGain 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 > "clone" I really mean "reallocate". java.util.ArrayList uses > System.arraycopy in its add(int, Object) implementation; and the javadoc > for System.arraycopy indicates that if the source and target arrays > are the same, a new array is allocated, the source is copied to the > new array, and then the contents of the new array replace the original: I don't read it that way at all. The javadoc says: "...then the copying is performed AS IF [my emphasis] the components at positions srcPos through srcPos+length-1 were first copied to a temporary array..." Reallocation is _not_ necessary when implementing arraycopy, just care in handling the overlap cases. Louis Tribble -- To unsubscribe, e-mail: For additional commands, e-mail: