Return-Path:
byte
s of this buffer to another
* byte buffer's remaining byte
s.
*
- * @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 Comparablechar
s of this buffer to another
* char buffer's remaining char
s.
*
- * @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 Comparabledouble
s of this buffer to another
* double buffer's remaining double
s.
*
- * @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 Comparablefloat
s of this buffer to another
* float buffer's remaining float
s.
*
- * @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 Comparableint
s of this buffer to another int
* buffer's remaining int
s.
*
- * @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 Comparablelong
s of this buffer to another
* long buffer's remaining long
s.
*
- * @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 Comparableshort
s of this buffer to another
* short buffer's remaining short
s.
*
- * @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);
}
}