2006-07-14 Sven de Marothy <[EMAIL PROTECTED]>
* java/awt/image/DataBuffer.java
(DataBuffer): Call constructors in the correct order,
Index: java/awt/image/DataBuffer.java
===================================================================
RCS file: /sources/classpath/classpath/java/awt/image/DataBuffer.java,v
retrieving revision 1.6
diff -U3 -r1.6 DataBuffer.java
--- java/awt/image/DataBuffer.java 2 Jul 2005 20:32:30 -0000 1.6
+++ java/awt/image/DataBuffer.java 14 Jul 2006 22:40:23 -0000
@@ -114,8 +114,7 @@
*/
protected DataBuffer(int dataType, int size)
{
- this.dataType = dataType;
- this.size = size;
+ this(dataType, size, 1);
}
/**
@@ -132,9 +131,7 @@
* @param numBanks the number of data banks.
*/
protected DataBuffer(int dataType, int size, int numBanks) {
- this(dataType, size);
- banks = numBanks;
- offsets = new int[numBanks];
+ this(dataType, size, numBanks, 0);
}
/**
@@ -153,11 +150,14 @@
* @param offset the offset to the first element for all banks.
*/
protected DataBuffer(int dataType, int size, int numBanks, int offset) {
- this(dataType, size, numBanks);
-
- java.util.Arrays.fill(offsets, offset);
-
+ banks = numBanks;
+ this.dataType = dataType;
+ this.size = size;
this.offset = offset;
+
+ offsets = new int[ numBanks ];
+ for(int i = 0; i < numBanks; i++ )
+ offsets[i] = offset;
}
/**
@@ -179,10 +179,11 @@
* <code>numBanks != offsets.length</code>.
*/
protected DataBuffer(int dataType, int size, int numBanks, int[] offsets) {
- this(dataType, size);
if (numBanks != offsets.length)
throw new ArrayIndexOutOfBoundsException();
-
+
+ this.dataType = dataType;
+ this.size = size;
banks = numBanks;
this.offsets = offsets;