harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
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 GMT
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 @@
  * </p>
  * 
  */
-public abstract class ByteBuffer extends Buffer implements Comparable {
+public abstract class ByteBuffer extends Buffer implements Comparable<ByteBuffer> {
 
 	/**
 	 * Creates a byte buffer based on a new allocated byte array.
@@ -299,7 +299,7 @@
 	 * Compare the remaining <code>byte</code>s of this buffer to another
 	 * byte buffer's remaining <code>byte</code>s.
 	 * 
-	 * @param other
+	 * @param otherBuffer
 	 *            Another byte buffer
 	 * @return a negative value if this is less than <code>other</code>; 0 if
 	 *         this equals to <code>other</code>; a positive value if this is
@@ -307,8 +307,7 @@
 	 * @exception ClassCastException
 	 *                If <code>other</code> 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 @@
  * </p>
  * 
  */
-public abstract class CharBuffer extends Buffer implements Comparable,
+public abstract class CharBuffer extends Buffer implements Comparable<CharBuffer>,
 		CharSequence, Appendable, Readable {
 
 	/**
@@ -246,7 +246,7 @@
 	 * Compare the remaining <code>char</code>s of this buffer to another
 	 * char buffer's remaining <code>char</code>s.
 	 * 
-	 * @param other
+	 * @param otherBuffer
 	 *            Another char buffer
 	 * @return a negative value if this is less than <code>other</code>; 0 if
 	 *         this equals to <code>other</code>; a positive value if this is
@@ -254,8 +254,7 @@
 	 * @exception ClassCastException
 	 *                If <code>other</code> 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.</li>
  * </ul>
  * </p>
- * 
  */
-public abstract class DoubleBuffer extends Buffer implements Comparable {
+public abstract class DoubleBuffer extends Buffer implements Comparable<DoubleBuffer>
{
 
 	/**
 	 * Creates a double buffer based on a new allocated double array.
@@ -168,7 +167,7 @@
 	 * Compare the remaining <code>double</code>s of this buffer to another
 	 * double buffer's remaining <code>double</code>s.
 	 * 
-	 * @param other
+	 * @param otherBuffer
 	 *            Another double buffer
 	 * @return a negative value if this is less than <code>other</code>; 0 if
 	 *         this equals to <code>other</code>; a positive value if this is
@@ -176,8 +175,7 @@
 	 * @exception ClassCastException
 	 *                If <code>other</code> 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 @@
  * </p>
  * 
  */
-public abstract class FloatBuffer extends Buffer implements Comparable {
+public abstract class FloatBuffer extends Buffer implements Comparable<FloatBuffer>
{
 
 	/**
 	 * Creates a float buffer based on a new allocated float array.
@@ -167,7 +167,7 @@
 	 * Compare the remaining <code>float</code>s of this buffer to another
 	 * float buffer's remaining <code>float</code>s.
 	 * 
-	 * @param other
+	 * @param otherBuffer
 	 *            Another float buffer
 	 * @return a negative value if this is less than <code>other</code>; 0 if
 	 *         this equals to <code>other</code>; a positive value if this is
@@ -175,8 +175,7 @@
 	 * @exception ClassCastException
 	 *                If <code>other</code> 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.</li>
  * </ul>
  * </p>
- * 
  */
-public abstract class IntBuffer extends Buffer implements Comparable {
+public abstract class IntBuffer extends Buffer implements Comparable<IntBuffer> {
 
 	/**
 	 * Creates a int buffer based on a new allocated int array.
@@ -173,7 +172,7 @@
 	 * Compare the remaining <code>int</code>s of this buffer to another int
 	 * buffer's remaining <code>int</code>s.
 	 * 
-	 * @param other
+	 * @param otherBuffer
 	 *            Another int buffer
 	 * @return a negative value if this is less than <code>other</code>; 0 if
 	 *         this equals to <code>other</code>; a positive value if this is
@@ -181,8 +180,7 @@
 	 * @exception ClassCastException
 	 *                If <code>other</code> 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.</li>
  * </ul>
  * </p>
- * 
  */
-public abstract class LongBuffer extends Buffer implements Comparable {
+public abstract class LongBuffer extends Buffer implements Comparable<LongBuffer> {
 
 	/**
 	 * Creates a long buffer based on a new allocated long array.
@@ -174,7 +173,7 @@
 	 * Compare the remaining <code>long</code>s of this buffer to another
 	 * long buffer's remaining <code>long</code>s.
 	 * 
-	 * @param other
+	 * @param otherBuffer
 	 *            Another long buffer
 	 * @return a negative value if this is less than <code>other</code>; 0 if
 	 *         this equals to <code>other</code>; a positive value if this is
@@ -182,8 +181,7 @@
 	 * @exception ClassCastException
 	 *                If <code>other</code> 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.</li>
  * </ul>
  * </p>
- * 
  */
-public abstract class ShortBuffer extends Buffer implements Comparable {
+public abstract class ShortBuffer extends Buffer implements Comparable<ShortBuffer>
{
 
 	/**
 	 * Creates a short buffer based on a new allocated short array.
@@ -174,7 +173,7 @@
 	 * Compare the remaining <code>short</code>s of this buffer to another
 	 * short buffer's remaining <code>short</code>s.
 	 * 
-	 * @param other
+	 * @param otherBuffer
 	 *            Another short buffer
 	 * @return a negative value if this is less than <code>other</code>; 0 if
 	 *         this equals to <code>other</code>; a positive value if this is
@@ -182,8 +181,7 @@
 	 * @exception ClassCastException
 	 *                If <code>other</code> 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);
         }
     }



Mime
View raw message