Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 19367 invoked from network); 15 Sep 2009 05:55:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Sep 2009 05:55:37 -0000 Received: (qmail 2678 invoked by uid 500); 15 Sep 2009 05:55:37 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 2584 invoked by uid 500); 15 Sep 2009 05:55:36 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 2527 invoked by uid 99); 15 Sep 2009 05:55:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Sep 2009 05:55:36 +0000 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.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Sep 2009 05:55:33 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id CD5A223889FF; Tue, 15 Sep 2009 05:54:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r815032 - /commons/proper/collections/trunk/src/java/org/apache/commons/collections/buffer/UnmodifiableBuffer.java Date: Tue, 15 Sep 2009 05:54:35 -0000 To: commits@commons.apache.org From: bayard@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090915055435.CD5A223889FF@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: bayard Date: Tue Sep 15 05:54:35 2009 New Revision: 815032 URL: http://svn.apache.org/viewvc?rev=815032&view=rev Log: Merging from -r468106:814127 of collections_jdk5_branch - namely where this code was generified; mostly in r738956. Also see the following revisions: ------------------------------------------------------------------------ r471202 | scolebourne | 2006-11-04 06:21:44 -0800 (Sat, 04 Nov 2006) | 1 line Remove getCollection() - use covariant decorated() ------------------------------------------------------------------------ Modified: commons/proper/collections/trunk/src/java/org/apache/commons/collections/buffer/UnmodifiableBuffer.java Modified: commons/proper/collections/trunk/src/java/org/apache/commons/collections/buffer/UnmodifiableBuffer.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/java/org/apache/commons/collections/buffer/UnmodifiableBuffer.java?rev=815032&r1=815031&r2=815032&view=diff ============================================================================== --- commons/proper/collections/trunk/src/java/org/apache/commons/collections/buffer/UnmodifiableBuffer.java (original) +++ commons/proper/collections/trunk/src/java/org/apache/commons/collections/buffer/UnmodifiableBuffer.java Tue Sep 15 05:54:35 2009 @@ -39,8 +39,8 @@ * * @author Stephen Colebourne */ -public final class UnmodifiableBuffer - extends AbstractBufferDecorator +public final class UnmodifiableBuffer + extends AbstractBufferDecorator implements Unmodifiable, Serializable { /** Serialization version */ @@ -55,11 +55,11 @@ * @return an unmodifiable Buffer * @throws IllegalArgumentException if buffer is null */ - public static Buffer decorate(Buffer buffer) { + public static Buffer decorate(Buffer buffer) { if (buffer instanceof Unmodifiable) { return buffer; } - return new UnmodifiableBuffer(buffer); + return new UnmodifiableBuffer(buffer); } //----------------------------------------------------------------------- @@ -69,7 +69,7 @@ * @param buffer the buffer to decorate, must not be null * @throws IllegalArgumentException if buffer is null */ - private UnmodifiableBuffer(Buffer buffer) { + private UnmodifiableBuffer(Buffer buffer) { super(buffer); } @@ -92,21 +92,22 @@ * @throws IOException * @throws ClassNotFoundException */ + @SuppressWarnings("unchecked") private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); - collection = (Collection) in.readObject(); + collection = (Collection) in.readObject(); } //----------------------------------------------------------------------- - public Iterator iterator() { - return UnmodifiableIterator.decorate(getCollection().iterator()); + public Iterator iterator() { + return UnmodifiableIterator.decorate(decorated().iterator()); } public boolean add(Object object) { throw new UnsupportedOperationException(); } - public boolean addAll(Collection coll) { + public boolean addAll(Collection coll) { throw new UnsupportedOperationException(); } @@ -118,16 +119,16 @@ throw new UnsupportedOperationException(); } - public boolean removeAll(Collection coll) { + public boolean removeAll(Collection coll) { throw new UnsupportedOperationException(); } - public boolean retainAll(Collection coll) { + public boolean retainAll(Collection coll) { throw new UnsupportedOperationException(); } //----------------------------------------------------------------------- - public Object remove() { + public E remove() { throw new UnsupportedOperationException(); }