Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 74159 invoked from network); 9 May 2006 16:27:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 May 2006 16:27:15 -0000 Received: (qmail 18586 invoked by uid 500); 9 May 2006 16:27:04 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 18504 invoked by uid 500); 9 May 2006 16:27:04 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 18465 invoked by uid 99); 9 May 2006 16:27:04 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 May 2006 09:27:04 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 09 May 2006 09:27:02 -0700 Received: (qmail 73845 invoked by uid 65534); 9 May 2006 16:26:42 -0000 Message-ID: <20060509162642.73839.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r405458 - in /incubator/harmony/enhanced/classlib/trunk/modules/nio/src: main/java/java/nio/ test/java/org/apache/harmony/tests/java/nio/ Date: Tue, 09 May 2006 16:26:39 -0000 To: harmony-commits@incubator.apache.org From: tellison@apache.org X-Mailer: svnmailer-1.0.8 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: tellison Date: Tue May 9 09:26:34 2006 New Revision: 405458 URL: http://svn.apache.org/viewcvs?rev=405458&view=rev Log: Generics uplift for NIO buffers Remome type check tests that are now compile-time errors Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ByteBuffer.java incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/CharBuffer.java incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/DoubleBuffer.java incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/FloatBuffer.java incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/IntBuffer.java incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/LongBuffer.java incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ShortBuffer.java incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/ByteBufferTest.java incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/CharBufferTest.java incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/DoubleBufferTest.java incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/FloatBufferTest.java incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/IntBufferTest.java incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/LongBufferTest.java incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/ShortBufferTest.java Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ByteBuffer.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ByteBuffer.java?rev=405458&r1=405457&r2=405458&view=diff ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ByteBuffer.java (original) +++ incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ByteBuffer.java Tue May 9 09:26:34 2006 @@ -33,7 +33,7 @@ *

* */ -public abstract class ByteBuffer extends Buffer implements Comparable { +public abstract class ByteBuffer extends Buffer implements Comparable { /** * Creates a byte buffer based on a new allocated byte array. @@ -299,7 +299,7 @@ * Compare the remaining bytes of this buffer to another * byte buffer's remaining bytes. * - * @param other + * @param otherBuffer * Another byte buffer * @return a negative value if this is less than other; 0 if * this equals to other; a positive value if this is @@ -307,8 +307,7 @@ * @exception ClassCastException * If other is not a byte buffer */ - public int compareTo(Object other) { - ByteBuffer otherBuffer = (ByteBuffer) other; + public int compareTo(ByteBuffer otherBuffer) { int compareRemaining = (remaining() < otherBuffer.remaining()) ? remaining() : otherBuffer.remaining(); int thisPos = position; Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/CharBuffer.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/CharBuffer.java?rev=405458&r1=405457&r2=405458&view=diff ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/CharBuffer.java (original) +++ incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/CharBuffer.java Tue May 9 09:26:34 2006 @@ -36,7 +36,7 @@ *

* */ -public abstract class CharBuffer extends Buffer implements Comparable, +public abstract class CharBuffer extends Buffer implements Comparable, CharSequence, Appendable, Readable { /** @@ -246,7 +246,7 @@ * Compare the remaining chars of this buffer to another * char buffer's remaining chars. * - * @param other + * @param otherBuffer * Another char buffer * @return a negative value if this is less than other; 0 if * this equals to other; a positive value if this is @@ -254,8 +254,7 @@ * @exception ClassCastException * If other is not a char buffer */ - public int compareTo(Object other) { - CharBuffer otherBuffer = (CharBuffer) other; + public int compareTo(CharBuffer otherBuffer) { int compareRemaining = (remaining() < otherBuffer.remaining()) ? remaining() : otherBuffer.remaining(); int thisPos = position; Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/DoubleBuffer.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/DoubleBuffer.java?rev=405458&r1=405457&r2=405458&view=diff ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/DoubleBuffer.java (original) +++ incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/DoubleBuffer.java Tue May 9 09:26:34 2006 @@ -31,9 +31,8 @@ * create a double buffer based on a byte buffer. * *

- * */ -public abstract class DoubleBuffer extends Buffer implements Comparable { +public abstract class DoubleBuffer extends Buffer implements Comparable { /** * Creates a double buffer based on a new allocated double array. @@ -168,7 +167,7 @@ * Compare the remaining doubles of this buffer to another * double buffer's remaining doubles. * - * @param other + * @param otherBuffer * Another double buffer * @return a negative value if this is less than other; 0 if * this equals to other; a positive value if this is @@ -176,8 +175,7 @@ * @exception ClassCastException * If other is not a double buffer */ - public int compareTo(Object other) { - DoubleBuffer otherBuffer = (DoubleBuffer) other; + public int compareTo(DoubleBuffer otherBuffer) { int compareRemaining = (remaining() < otherBuffer.remaining()) ? remaining() : otherBuffer.remaining(); int thisPos = position; Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/FloatBuffer.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/FloatBuffer.java?rev=405458&r1=405457&r2=405458&view=diff ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/FloatBuffer.java (original) +++ incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/FloatBuffer.java Tue May 9 09:26:34 2006 @@ -32,7 +32,7 @@ *

* */ -public abstract class FloatBuffer extends Buffer implements Comparable { +public abstract class FloatBuffer extends Buffer implements Comparable { /** * Creates a float buffer based on a new allocated float array. @@ -167,7 +167,7 @@ * Compare the remaining floats of this buffer to another * float buffer's remaining floats. * - * @param other + * @param otherBuffer * Another float buffer * @return a negative value if this is less than other; 0 if * this equals to other; a positive value if this is @@ -175,8 +175,7 @@ * @exception ClassCastException * If other is not a float buffer */ - public int compareTo(Object other) { - FloatBuffer otherBuffer = (FloatBuffer) other; + public int compareTo(FloatBuffer otherBuffer) { int compareRemaining = (remaining() < otherBuffer.remaining()) ? remaining() : otherBuffer.remaining(); int thisPos = position; Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/IntBuffer.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/IntBuffer.java?rev=405458&r1=405457&r2=405458&view=diff ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/IntBuffer.java (original) +++ incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/IntBuffer.java Tue May 9 09:26:34 2006 @@ -29,9 +29,8 @@ * create a int buffer based on a byte buffer. * *

- * */ -public abstract class IntBuffer extends Buffer implements Comparable { +public abstract class IntBuffer extends Buffer implements Comparable { /** * Creates a int buffer based on a new allocated int array. @@ -173,7 +172,7 @@ * Compare the remaining ints of this buffer to another int * buffer's remaining ints. * - * @param other + * @param otherBuffer * Another int buffer * @return a negative value if this is less than other; 0 if * this equals to other; a positive value if this is @@ -181,8 +180,7 @@ * @exception ClassCastException * If other is not a int buffer */ - public int compareTo(Object other) { - IntBuffer otherBuffer = (IntBuffer) other; + public int compareTo(IntBuffer otherBuffer) { int compareRemaining = (remaining() < otherBuffer.remaining()) ? remaining() : otherBuffer.remaining(); int thisPos = position; Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/LongBuffer.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/LongBuffer.java?rev=405458&r1=405457&r2=405458&view=diff ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/LongBuffer.java (original) +++ incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/LongBuffer.java Tue May 9 09:26:34 2006 @@ -30,9 +30,8 @@ * to create a long buffer based on a byte buffer. * *

- * */ -public abstract class LongBuffer extends Buffer implements Comparable { +public abstract class LongBuffer extends Buffer implements Comparable { /** * Creates a long buffer based on a new allocated long array. @@ -174,7 +173,7 @@ * Compare the remaining longs of this buffer to another * long buffer's remaining longs. * - * @param other + * @param otherBuffer * Another long buffer * @return a negative value if this is less than other; 0 if * this equals to other; a positive value if this is @@ -182,8 +181,7 @@ * @exception ClassCastException * If other is not a long buffer */ - public int compareTo(Object other) { - LongBuffer otherBuffer = (LongBuffer) other; + public int compareTo(LongBuffer otherBuffer) { int compareRemaining = (remaining() < otherBuffer.remaining()) ? remaining() : otherBuffer.remaining(); int thisPos = position; Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ShortBuffer.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ShortBuffer.java?rev=405458&r1=405457&r2=405458&view=diff ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ShortBuffer.java (original) +++ incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ShortBuffer.java Tue May 9 09:26:34 2006 @@ -30,9 +30,8 @@ * to create a short buffer based on a byte buffer. * *

- * */ -public abstract class ShortBuffer extends Buffer implements Comparable { +public abstract class ShortBuffer extends Buffer implements Comparable { /** * Creates a short buffer based on a new allocated short array. @@ -174,7 +173,7 @@ * Compare the remaining shorts of this buffer to another * short buffer's remaining shorts. * - * @param other + * @param otherBuffer * Another short buffer * @return a negative value if this is less than other; 0 if * this equals to other; a positive value if this is @@ -182,8 +181,7 @@ * @exception ClassCastException * If other is not a short buffer */ - public int compareTo(Object other) { - ShortBuffer otherBuffer = (ShortBuffer) other; + public int compareTo(ShortBuffer otherBuffer) { int compareRemaining = (remaining() < otherBuffer.remaining()) ? remaining() : otherBuffer.remaining(); int thisPos = position; Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/ByteBufferTest.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/ByteBufferTest.java?rev=405458&r1=405457&r2=405458&view=diff ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/ByteBufferTest.java (original) +++ incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/ByteBufferTest.java Tue May 9 09:26:34 2006 @@ -264,14 +264,6 @@ } public static void testCompareTo(ByteBuffer buf) { - // compare to bad type - try { - buf.compareTo(CharBuffer.allocate(10)); - fail("Should throw Exception"); //$NON-NLS-1$ - } catch (ClassCastException e) { - // expected - } - // compare to self assertEquals(0, buf.compareTo(buf)); @@ -1981,15 +1973,6 @@ byte value = startValue; for (int i = 0; i < length; i++) { assertEquals(buf.get(startIndex + i), value); - value = (byte) (value + 1); - } - } - - private static void assertContentLikeTestData1(byte array[], - int startIndex, byte startValue, int length) { - byte value = startValue; - for (int i = 0; i < length; i++) { - assertEquals(array[startIndex + i], value); value = (byte) (value + 1); } } Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/CharBufferTest.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/CharBufferTest.java?rev=405458&r1=405457&r2=405458&view=diff ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/CharBufferTest.java (original) +++ incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/CharBufferTest.java Tue May 9 09:26:34 2006 @@ -233,14 +233,6 @@ } public static void testCompareTo(CharBuffer buf) { - // compare to bad type - try { - buf.compareTo(ByteBuffer.allocate(10)); - fail("Should throw Exception"); //$NON-NLS-1$ - } catch (ClassCastException e) { - // expected - } - // compare to self assertEquals(0, buf.compareTo(buf)); @@ -897,15 +889,6 @@ char value = startValue; for (int i = 0; i < length; i++) { assertEquals(buf.get(startIndex + i), value); - value = (char) (value + 1); - } - } - - private static void assertContentLikeTestData1(char array[], - int startIndex, char startValue, int length) { - char value = startValue; - for (int i = 0; i < length; i++) { - assertEquals(array[startIndex + i], value); value = (char) (value + 1); } } Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/DoubleBufferTest.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/DoubleBufferTest.java?rev=405458&r1=405457&r2=405458&view=diff ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/DoubleBufferTest.java (original) +++ incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/DoubleBufferTest.java Tue May 9 09:26:34 2006 @@ -249,14 +249,6 @@ } public static void testCompareTo(DoubleBuffer buf) { - // compare to bad type - try { - buf.compareTo(ByteBuffer.allocate(10)); - fail("Should throw Exception"); //$NON-NLS-1$ - } catch (ClassCastException e) { - // expected - } - // compare to self assertEquals(0, buf.compareTo(buf)); @@ -766,15 +758,6 @@ double value = startValue; for (int i = 0; i < length; i++) { assertEquals(buf.get(startIndex + i), value, 0.01); - value = value + 1.0; - } - } - - private static void assertContentLikeTestData1(double array[], - int startIndex, double startValue, int length) { - double value = startValue; - for (int i = 0; i < length; i++) { - assertEquals(array[startIndex + i], value, 0.01); value = value + 1.0; } } Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/FloatBufferTest.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/FloatBufferTest.java?rev=405458&r1=405457&r2=405458&view=diff ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/FloatBufferTest.java (original) +++ incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/FloatBufferTest.java Tue May 9 09:26:34 2006 @@ -226,14 +226,6 @@ } public static void testCompareTo(FloatBuffer buf) { - // compare to bad type - try { - buf.compareTo(ByteBuffer.allocate(10)); - fail("Should throw Exception"); //$NON-NLS-1$ - } catch (ClassCastException e) { - // expected - } - // compare to self assertEquals(0, buf.compareTo(buf)); @@ -743,15 +735,6 @@ float value = startValue; for (int i = 0; i < length; i++) { assertEquals(buf.get(startIndex + i), value, 0.01); - value = value + 1.0f; - } - } - - private static void assertContentLikeTestData1(float array[], - int startIndex, float startValue, int length) { - float value = startValue; - for (int i = 0; i < length; i++) { - assertEquals(array[startIndex + i], value, 0.01); value = value + 1.0f; } } Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/IntBufferTest.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/IntBufferTest.java?rev=405458&r1=405457&r2=405458&view=diff ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/IntBufferTest.java (original) +++ incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/IntBufferTest.java Tue May 9 09:26:34 2006 @@ -226,14 +226,6 @@ } public static void testCompareTo(IntBuffer buf) { - // compare to bad type - try { - buf.compareTo(ByteBuffer.allocate(10)); - fail("Should throw Exception"); //$NON-NLS-1$ - } catch (ClassCastException e) { - // expected - } - // compare to self assertEquals(0, buf.compareTo(buf)); @@ -743,15 +735,6 @@ int value = startValue; for (int i = 0; i < length; i++) { assertEquals(buf.get(startIndex + i), value); - value = value + 1; - } - } - - private static void assertContentLikeTestData1(int array[], int startIndex, - int startValue, int length) { - int value = startValue; - for (int i = 0; i < length; i++) { - assertEquals(array[startIndex + i], value); value = value + 1; } } Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/LongBufferTest.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/LongBufferTest.java?rev=405458&r1=405457&r2=405458&view=diff ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/LongBufferTest.java (original) +++ incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/LongBufferTest.java Tue May 9 09:26:34 2006 @@ -226,14 +226,6 @@ } public static void testCompareTo(LongBuffer buf) { - // compare to bad type - try { - buf.compareTo(ByteBuffer.allocate(10)); - fail("Should throw Exception"); //$NON-NLS-1$ - } catch (ClassCastException e) { - // expected - } - // compare to self assertEquals(0, buf.compareTo(buf)); @@ -743,15 +735,6 @@ long value = startValue; for (int i = 0; i < length; i++) { assertEquals(buf.get(startIndex + i), value); - value = value + 1; - } - } - - private static void assertContentLikeTestData1(long array[], - int startIndex, long startValue, int length) { - long value = startValue; - for (int i = 0; i < length; i++) { - assertEquals(array[startIndex + i], value); value = value + 1; } } Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/ShortBufferTest.java URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/ShortBufferTest.java?rev=405458&r1=405457&r2=405458&view=diff ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/ShortBufferTest.java (original) +++ incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/ShortBufferTest.java Tue May 9 09:26:34 2006 @@ -226,14 +226,6 @@ } public static void testCompareTo(ShortBuffer buf) { - // compare to bad type - try { - buf.compareTo(ByteBuffer.allocate(10)); - fail("Should throw Exception"); //$NON-NLS-1$ - } catch (ClassCastException e) { - // expected - } - // compare to self assertEquals(0, buf.compareTo(buf)); @@ -743,15 +735,6 @@ short value = startValue; for (int i = 0; i < length; i++) { assertEquals(buf.get(startIndex + i), value); - value = (short) (value + 1); - } - } - - private static void assertContentLikeTestData1(short array[], - int startIndex, short startValue, int length) { - short value = startValue; - for (int i = 0; i < length; i++) { - assertEquals(array[startIndex + i], value); value = (short) (value + 1); } }