Buggy code:
public abstract class AbstractMatrix implements Matrix { protected Map < String , Integer > columnLabelBindings ; protected Map < String , Integer > rowLabelBindings ; public Iterator < MatrixSlice > iterator ( ) { } public Iterator < MatrixSlice > iterateAll ( ) { } protected Vector slice ( int index ) { } public int numSlices ( ) { } public double get ( String rowLabel , String columnLabel ) throws IndexException , UnboundLabelException { } public Map < String , Integer > getColumnLabelBindings ( ) { } public Map < String , Integer > getRowLabelBindings ( ) { } public void set ( String rowLabel , double [ ] rowData ) { } public void set ( String rowLabel , int row , double [ ] rowData ) { } public void set ( String rowLabel , String columnLabel , double value ) throws IndexException , UnboundLabelException { } public void set ( String rowLabel , String columnLabel , int row , int column , double value ) throws IndexException , UnboundLabelException { } public void setColumnLabelBindings ( Map < String , Integer > bindings ) { } public void setRowLabelBindings ( Map < String , Integer > bindings ) { } public static final int COL = 1 ; public static final int ROW = 0 ; public int numRows ( ) { } public int numCols ( ) { } public static Matrix decodeMatrix ( String formatString ) { } public String asFormatString ( ) { } public Matrix assign ( double value ) { } public Matrix assign ( double [ ] [ ] values ) { } public Matrix assign ( Matrix other , BinaryFunction function ) { } public Matrix assign ( Matrix other ) { } public Matrix assign ( UnaryFunction function ) { } public double determinant ( ) { } @ Override public Matrix clone ( ) { } public Matrix divide ( double x ) { } public double get ( int row , int column ) { } public Matrix minus ( Matrix other ) { } public Matrix plus ( double x ) { } public Matrix plus ( Matrix other ) { } public void set ( int row , int column , double value ) { } public void set ( int row , double [ ] data ) { } public Matrix times ( double x ) { } public Matrix times ( Matrix other ) { int [ ] c = size ( ) ; int [ ] o = other . size ( ) ; if ( ( c [ AbstractMatrix . COL ] ) != ( o [ AbstractMatrix . ROW ] ) ) { <START_BUG> throw new CardinalityException ( ) ; <END_BUG> } Matrix result = like ( c [ AbstractMatrix . ROW ] , o [ AbstractMatrix . COL ] ) ; for ( int row = 0 ; row < ( c [ AbstractMatrix . ROW ] ) ; row ++ ) { for ( int col = 0 ; col < ( o [ AbstractMatrix . COL ] ) ; col ++ ) { double sum = 0 ; for ( int k = 0 ; k < ( c [ AbstractMatrix . COL ] ) ; k ++ ) { sum += ( getQuick ( row , k ) ) * ( other . getQuick ( k , col ) ) ; } result . setQuick ( row , col , sum ) ; } } return result ; } public Vector times ( Vector v ) { } public Vector timesSquared ( Vector v ) { } public Matrix transpose ( ) { } public double zSum ( ) { } protected class TransposeViewVector extends AbstractVector { private final Matrix matrix ; private final int transposeOffset ; private final int numCols ; private final boolean rowToColumn ; protected TransposeViewVector ( Matrix m , int offset ) { } protected TransposeViewVector ( Matrix m , int offset , boolean rowToColumn ) { } @ Override public Vector clone ( ) { } @ Override protected Matrix matrixLike ( int rows , int columns ) { } public Iterator < Element > iterateAll ( ) { } public Iterator < Element > iterateNonZero ( ) { } public Element getElement ( final int i ) { } public double getQuick ( int index ) { } public void setQuick ( int index , double value ) { } protected Vector newVector ( int cardinality ) { } public Vector like ( ) { } public Vector like ( int cardinality ) { } public int getNumNondefaultElements ( ) { } } }

Fix:
throw new CardinalityException ( c [ AbstractMatrix . COL ] , o [ AbstractMatrix . ROW ] ) ;