Buggy code:
public abstract class AbstractFieldMatrix < T extends FieldElement < T > > implements Serializable , FieldMatrix < T > { private static final long serialVersionUID = - 3665653040524315561L ; private final Field < T > field ; protected static < T extends FieldElement < T > > Field < T > extractField ( final T [ ] [ ] d ) throws IllegalArgumentException { } protected static < T extends FieldElement < T > > Field < T > extractField ( final T [ ] d ) throws IllegalArgumentException { } @ SuppressWarnings ( "unchecked" ) protected static < T extends FieldElement < T > > T [ ] [ ] buildArray ( final Field < T > field , final int rows , final int columns ) { if ( columns < 0 ) { T [ ] dummyRow = ( ( T [ ] ) ( Array . newInstance ( field . getZero ( ) . getClass ( ) , 0 ) ) ) ; return ( ( T [ ] [ ] ) ( Array . newInstance ( dummyRow . getClass ( ) , rows ) ) ) ; } <START_BUG> T [ ] [ ] array = ( ( T [ ] [ ] ) ( Array . newInstance ( field . getZero ( ) . getClass ( ) , rows , columns ) ) ) ; <END_BUG> for ( int i = 0 ; i < ( array . length ) ; ++ i ) { Arrays . fill ( array [ i ] , field . getZero ( ) ) ; } return array ; } @ SuppressWarnings ( "unchecked" ) protected static < T extends FieldElement < T > > T [ ] buildArray ( final Field < T > field , final int length ) { } protected AbstractFieldMatrix ( final Field < T > field ) { } protected AbstractFieldMatrix ( final Field < T > field , final int rowDimension , final int columnDimension ) throws IllegalArgumentException { } public Field < T > getField ( ) { } public abstract FieldMatrix < T > createMatrix ( final int rowDimension , final int columnDimension ) throws IllegalArgumentException { } public abstract FieldMatrix < T > copy ( ) { } public FieldMatrix < T > add ( FieldMatrix < T > m ) throws IllegalArgumentException { } public FieldMatrix < T > subtract ( final FieldMatrix < T > m ) throws IllegalArgumentException { } public FieldMatrix < T > scalarAdd ( final T d ) { } public FieldMatrix < T > scalarMultiply ( final T d ) { } public FieldMatrix < T > multiply ( final FieldMatrix < T > m ) throws IllegalArgumentException { } public FieldMatrix < T > preMultiply ( final FieldMatrix < T > m ) throws IllegalArgumentException { } public T [ ] [ ] getData ( ) { } public FieldMatrix < T > getSubMatrix ( final int startRow , final int endRow , final int startColumn , final int endColumn ) throws MatrixIndexException { } public FieldMatrix < T > getSubMatrix ( final int [ ] selectedRows , final int [ ] selectedColumns ) throws MatrixIndexException { } public void copySubMatrix ( final int startRow , final int endRow , final int startColumn , final int endColumn , final T [ ] [ ] destination ) throws IllegalArgumentException , MatrixIndexException { } public void copySubMatrix ( int [ ] selectedRows , int [ ] selectedColumns , T [ ] [ ] destination ) throws IllegalArgumentException , MatrixIndexException { } public void setSubMatrix ( final T [ ] [ ] subMatrix , final int row , final int column ) throws MatrixIndexException { } public FieldMatrix < T > getRowMatrix ( final int row ) throws MatrixIndexException { } public void setRowMatrix ( final int row , final FieldMatrix < T > matrix ) throws InvalidMatrixException , MatrixIndexException { } public FieldMatrix < T > getColumnMatrix ( final int column ) throws MatrixIndexException { } public void setColumnMatrix ( final int column , final FieldMatrix < T > matrix ) throws InvalidMatrixException , MatrixIndexException { } public FieldVector < T > getRowVector ( final int row ) throws MatrixIndexException { } public void setRowVector ( final int row , final FieldVector < T > vector ) throws InvalidMatrixException , MatrixIndexException { } public FieldVector < T > getColumnVector ( final int column ) throws MatrixIndexException { } public void setColumnVector ( final int column , final FieldVector < T > vector ) throws InvalidMatrixException , MatrixIndexException { } public T [ ] getRow ( final int row ) throws MatrixIndexException { } public void setRow ( final int row , final T [ ] array ) throws InvalidMatrixException , MatrixIndexException { } public T [ ] getColumn ( final int column ) throws MatrixIndexException { } public void setColumn ( final int column , final T [ ] array ) throws InvalidMatrixException , MatrixIndexException { } public abstract T getEntry ( int row , int column ) throws MatrixIndexException { } public abstract void setEntry ( int row , int column , T value ) throws MatrixIndexException { } public abstract void addToEntry ( int row , int column , T increment ) throws MatrixIndexException { } public abstract void multiplyEntry ( int row , int column , T factor ) throws MatrixIndexException { } public FieldMatrix < T > transpose ( ) { } public boolean isSquare ( ) { } public abstract int getRowDimension ( ) { } public abstract int getColumnDimension ( ) { } public T getTrace ( ) throws NonSquareMatrixException { } public T [ ] operate ( final T [ ] v ) throws IllegalArgumentException { } public FieldVector < T > operate ( final FieldVector < T > v ) throws IllegalArgumentException { } public T [ ] preMultiply ( final T [ ] v ) throws IllegalArgumentException { }

Fix:
T [ ] [ ] array = ( ( T [ ] [ ] ) ( Array . newInstance ( field . getZero ( ) . getClass ( ) , new int [ ] { rows , columns } ) ) ) ;