[wpiutil] Fix Java struct array unpacking (#5801)

This commit is contained in:
Jonah
2023-10-21 23:13:50 -04:00
committed by GitHub
parent 1fa7445667
commit 3d618bdbfd

View File

@@ -211,7 +211,7 @@ public final class StructBuffer<T> {
}
int nelem = len / m_structSize;
@SuppressWarnings("unchecked")
T[] arr = (T[]) Array.newInstance(m_struct.getClass(), nelem);
T[] arr = (T[]) Array.newInstance(m_struct.getTypeClass(), nelem);
for (int i = 0; i < nelem; i++) {
arr[i] = m_struct.unpack(buf);
}