JAVA-4669: Fix CircularBuffer constructor
This commit is contained in:
parent
c9bc95a5e2
commit
0545265255
@ -10,10 +10,8 @@ public class CircularBuffer<E> {
|
|||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public CircularBuffer(int capacity) {
|
public CircularBuffer(int capacity) {
|
||||||
|
|
||||||
this.capacity = (capacity < 1) ? DEFAULT_CAPACITY : capacity;
|
this.capacity = (capacity < 1) ? DEFAULT_CAPACITY : capacity;
|
||||||
this.data = (E[]) new Object[capacity];
|
this.data = (E[]) new Object[this.capacity];
|
||||||
|
|
||||||
this.readSequence = 0;
|
this.readSequence = 0;
|
||||||
this.writeSequence = -1;
|
this.writeSequence = -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user