@@ -84,16 +84,16 @@ public T get(final int index) {
84
84
@ Override
85
85
public T set (final int index , final T object ) {
86
86
checkIndex (index );
87
- T value = (T ) this .elementData [index ];
87
+ final T value = (T ) this .elementData [index ];
88
88
this .elementData [index ] = object ;
89
89
return value ;
90
90
}
91
91
92
92
@ Override
93
93
public T remove (final int index ) {
94
94
checkIndex (index );
95
- T value = (T ) this .elementData [index ];
96
- int numMoved = this .size - index - 1 ;
95
+ final T value = (T ) this .elementData [index ];
96
+ final int numMoved = this .size - index - 1 ;
97
97
System .arraycopy (this .elementData , index + 1 , this .elementData , index , numMoved );
98
98
this .elementData [--this .size ] = null ;
99
99
return value ;
@@ -197,7 +197,7 @@ public boolean equals(final Object object) {
197
197
if (this .getClass () != object .getClass ()) {
198
198
return false ;
199
199
}
200
- MyArrayList other = (MyArrayList ) object ;
200
+ final MyArrayList other = (MyArrayList ) object ;
201
201
if (this .size != other .size ) {
202
202
return false ;
203
203
}
@@ -216,7 +216,7 @@ public int hashCode() {
216
216
217
217
private void ensureCapacity (final int minCapacity ) throws IndexOutOfBoundsException {
218
218
if (minCapacity > this .elementData .length ) {
219
- Object [] oldData = new Object [this .size ];
219
+ final Object [] oldData = new Object [this .size ];
220
220
System .arraycopy (this .elementData , 0 , oldData , 0 , this .size );
221
221
int newCapacity = this .size * 3 / 2 + 1 ;
222
222
this .elementData = new Object [newCapacity ];
0 commit comments