Commit 79d54213 authored by Daniel Le Berre's avatar Daniel Le Berre

Creating Serializable arrays instead of Object arrays.

parent a778dd74
Pipeline #3360 failed with stages
in 3 minutes and 2 seconds
......@@ -98,7 +98,7 @@ public final class Vec<T extends Serializable> implements IVec<T> {
*/
@SuppressWarnings("unchecked")
public Vec(int size) {
this.myarray = (T[]) new Object[size];
this.myarray = (T[]) new Serializable[size];
}
/**
......@@ -112,7 +112,7 @@ public final class Vec<T extends Serializable> implements IVec<T> {
*/
@SuppressWarnings("unchecked")
public Vec(int size, T pad) {
this.myarray = (T[]) new Object[size];
this.myarray = (T[]) new Serializable[size];
for (int i = 0; i < size; i++) {
this.myarray[i] = pad;
}
......@@ -174,7 +174,8 @@ public final class Vec<T extends Serializable> implements IVec<T> {
@SuppressWarnings("unchecked")
public void ensure(final int nsize) {
if (nsize >= this.myarray.length) {
T[] narray = (T[]) new Object[Math.max(nsize, this.nbelem * 2)];
T[] narray = (T[]) new Serializable[Math.max(nsize,
this.nbelem * 2)];
System.arraycopy(this.myarray, 0, narray, 0, this.nbelem);
this.myarray = narray;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment