We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aefc96b commit 2b18e0cCopy full SHA for 2b18e0c
1 file changed
data-structures/src/main/java/com/baeldung/circularbuffer/CircularBuffer.java
@@ -10,10 +10,8 @@ public class CircularBuffer<E> {
10
11
@SuppressWarnings("unchecked")
12
public CircularBuffer(int capacity) {
13
-
14
this.capacity = (capacity < 1) ? DEFAULT_CAPACITY : capacity;
15
- this.data = (E[]) new Object[capacity];
16
+ this.data = (E[]) new Object[this.capacity];
17
this.readSequence = 0;
18
this.writeSequence = -1;
19
}
0 commit comments