Buggy code:
public class ArrayFieldVector < T extends FieldElement < T > > implements Serializable , FieldVector < T > { private static final long serialVersionUID = 7648186910365927050L ; protected T [ ] data ; private final Field < T > field ; public ArrayFieldVector ( final Field < T > field ) { } public ArrayFieldVector ( Field < T > field , int size ) { } public ArrayFieldVector ( int size , T preset ) { } public ArrayFieldVector ( T [ ] d ) { } public ArrayFieldVector ( Field < T > field , T [ ] d ) { } public ArrayFieldVector ( T [ ] d , boolean copyArray ) { } public ArrayFieldVector ( Field < T > field , T [ ] d , boolean copyArray ) { } public ArrayFieldVector ( T [ ] d , int pos , int size ) { } public ArrayFieldVector ( Field < T > field , T [ ] d , int pos , int size ) { } public ArrayFieldVector ( FieldVector < T > v ) { } public ArrayFieldVector ( ArrayFieldVector < T > v ) { } public ArrayFieldVector ( ArrayFieldVector < T > v , boolean deep ) { } public ArrayFieldVector ( ArrayFieldVector < T > v1 , ArrayFieldVector < T > v2 ) { } public ArrayFieldVector ( ArrayFieldVector < T > v1 , T [ ] v2 ) { } public ArrayFieldVector ( T [ ] v1 , ArrayFieldVector < T > v2 ) { } public ArrayFieldVector ( T [ ] v1 , T [ ] v2 ) { } public ArrayFieldVector ( Field < T > field , T [ ] v1 , T [ ] v2 ) { } @ SuppressWarnings ( "unchecked" ) private T [ ] buildArray ( final int length ) { <START_BUG> return ( ( T [ ] ) ( Array . newInstance ( field . getZero ( ) . getClass ( ) , length ) ) ) ; <END_BUG> } public Field < T > getField ( ) { } public FieldVector < T > copy ( ) { } public FieldVector < T > add ( FieldVector < T > v ) { } public ArrayFieldVector < T > add ( ArrayFieldVector < T > v ) { } public FieldVector < T > subtract ( FieldVector < T > v ) { } public ArrayFieldVector < T > subtract ( ArrayFieldVector < T > v ) { } public FieldVector < T > mapAdd ( T d ) { } public FieldVector < T > mapAddToSelf ( T d ) { } public FieldVector < T > mapSubtract ( T d ) { } public FieldVector < T > mapSubtractToSelf ( T d ) { } public FieldVector < T > mapMultiply ( T d ) { } public FieldVector < T > mapMultiplyToSelf ( T d ) { } public FieldVector < T > mapDivide ( T d ) { } public FieldVector < T > mapDivideToSelf ( T d ) { } public FieldVector < T > mapInv ( ) { } public FieldVector < T > mapInvToSelf ( ) { } public FieldVector < T > ebeMultiply ( FieldVector < T > v ) { } public ArrayFieldVector < T > ebeMultiply ( ArrayFieldVector < T > v ) { } public FieldVector < T > ebeDivide ( FieldVector < T > v ) { } public ArrayFieldVector < T > ebeDivide ( ArrayFieldVector < T > v ) { } public T [ ] getData ( ) { } public T [ ] getDataRef ( ) { } public T dotProduct ( FieldVector < T > v ) { } public T dotProduct ( ArrayFieldVector < T > v ) { } public FieldVector < T > projection ( FieldVector < T > v ) { } public ArrayFieldVector < T > projection ( ArrayFieldVector < T > v ) { } public FieldMatrix < T > outerProduct ( FieldVector < T > v ) { } public FieldMatrix < T > outerProduct ( ArrayFieldVector < T > v ) { } public T getEntry ( int index ) { } public int getDimension ( ) { } public FieldVector < T > append ( FieldVector < T > v ) { } public ArrayFieldVector < T > append ( ArrayFieldVector < T > v ) { } public FieldVector < T > append ( T in ) { } public FieldVector < T > getSubVector ( int index , int n ) { } public void setEntry ( int index , T value ) { } public void setSubVector ( int index , FieldVector < T > v ) { } public void set ( int index , ArrayFieldVector < T > v ) { } public void set ( T value ) { } public T [ ] toArray ( ) { } protected void checkVectorDimensions ( FieldVector < T > v ) { } protected void checkVectorDimensions ( int n ) { } @ Override public boolean equals ( Object other ) { } @ Override public int hashCode ( ) { } private void checkIndex ( final int index ) { } }

Fix:
return ( ( T [ ] ) ( Array . newInstance ( field . getRuntimeClass ( ) , length ) ) ) ;