Buggy code:
public class HDA extends SimpleBatchFilter { private static final long serialVersionUID = 1L ; private final boolean DEBUG = true ; public String globalInfo ( ) { } public Capabilities getCapabilities ( ) { } protected Instances determineOutputFormat ( Instances inputFormat ) { } protected ArrayList < Instances > seperateDatasetByClass ( Instances inst ) { } protected ArrayList < Matrix > findSampleMeans ( ArrayList < Instances > datasets ) { } protected ArrayList < Matrix > findCovarianceMatrices ( ArrayList < Instances > datasets ) { } protected ArrayList < Double > calculateProbability ( ArrayList < Instances > datasets ) { } protected Instances process ( Instances inst ) { double [ ] [ ] double_matrix = new double [ inst . size ( ) ] [ inst . numAttributes ( ) ] ; ArrayList < Instances > disjointDataset = seperateDatasetByClass ( inst ) ; ArrayList < Matrix > sampleMeans = findSampleMeans ( disjointDataset ) ; ArrayList < Matrix > covarianceMatrices = findCovarianceMatrices ( disjointDataset ) ; ArrayList < Double > probabilities = calculateProbability ( disjointDataset ) ; Instances result = new Instances ( determineOutputFormat ( inst ) , 0 ) ; if ( DEBUG ) { System . out . println ( ( "Instances<seq2seq4repair_space>as<seq2seq4repair_space>passed<seq2seq4repair_space>in\n" + inst ) ) ; System . out . println ( ( "result<seq2seq4repair_space>at<seq2seq4repair_space>the<seq2seq4repair_space>start:\n" + ( result . numAttributes ( ) ) ) ) ; System . out . println ( result ) ; System . out . println ( ( ( ( "instance<seq2seq4repair_space>class<seq2seq4repair_space>index<seq2seq4repair_space>is<seq2seq4repair_space>" + ( inst . instance ( 0 ) . classIndex ( ) ) ) + "<seq2seq4repair_space>vs<seq2seq4repair_space>num<seq2seq4repair_space>attributes<seq2seq4repair_space>" ) + ( inst . numAttributes ( ) ) ) ) ; } for ( int i = 0 ; i < ( inst . numInstances ( ) ) ; i ++ ) { double [ ] values = new double [ result . numAttributes ( ) ] ; for ( int n = 0 ; n < ( inst . numAttributes ( ) ) ; n ++ ) { values [ n ] = inst . instance ( i ) . value ( n ) ; } values [ ( ( values . length ) - 1 ) ] = i ; double_matrix [ i ] = values ; result . add ( new DenseInstance ( 1 , values ) ) ; } Matrix matrix = new Matrix ( double_matrix ) ; if ( DEBUG ) { System . out . println ( "Matrix<seq2seq4repair_space>was<seq2seq4repair_space>constructed<seq2seq4repair_space>as:" ) ; System . out . println ( ( "first<seq2seq4repair_space>columns<seq2seq4repair_space>are<seq2seq4repair_space>attributes<seq2seq4repair_space>values,<seq2seq4repair_space>and<seq2seq4repair_space>second<seq2seq4repair_space>last<seq2seq4repair_space>column<seq2seq4repair_space>is<seq2seq4repair_space>class<seq2seq4repair_space>number,<seq2seq4repair_space>last<seq2seq4repair_space>column<seq2seq4repair_space>is<seq2seq4repair_space>Attribute<seq2seq4repair_space>bla:\n" + matrix ) ) ; System . out . println ( "We<seq2seq4repair_space>have<seq2seq4repair_space>constructed<seq2seq4repair_space>the<seq2seq4repair_space>following<seq2seq4repair_space>disjointDataset" ) ; for ( int i = 0 ; i < ( disjointDataset . size ( ) ) ; ++ i ) { System . out . println ( ( ( "\ndisjointDataset<seq2seq4repair_space>number<seq2seq4repair_space>" + i ) + "<seq2seq4repair_space>is<seq2seq4repair_space>\n" ) ) ; for ( int j = 0 ; j < ( disjointDataset . get ( i ) . size ( ) ) ; ++ j ) { for ( int k = 0 ; k < ( disjointDataset . get ( i ) . instance ( j ) . numAttributes ( ) ) ; ++ k ) { System . out . print ( ( "<seq2seq4repair_space>" + ( disjointDataset . get ( i ) . instance ( j ) . value ( k ) ) ) ) ; } System . out . println ( "" ) ; } } } for ( int i = 0 ; i < ( sampleMeans . size ( ) ) ; ++ i ) { System . out . println ( ( ( "We<seq2seq4repair_space>found<seq2seq4repair_space>that<seq2seq4repair_space>sample<seq2seq4repair_space>mean<seq2seq4repair_space>" + i ) + "<seq2seq4repair_space>was\n" ) ) ; System . out . println ( sampleMeans . get ( i ) ) ; } for ( int i = 0 ; i < ( covarianceMatrices . size ( ) ) ; ++ i ) { System . out . println ( ( ( "We<seq2seq4repair_space>found<seq2seq4repair_space>that<seq2seq4repair_space>covariance<seq2seq4repair_space>matrix<seq2seq4repair_space>" + i ) + "<seq2seq4repair_space>was\n" ) ) ; System . out . println ( covarianceMatrices . get ( i ) ) ; } for ( int i = 0 ; i < ( probabilities . size ( ) ) ; ++ i ) { <START_BUG> System . out . println ( ( ( "We<seq2seq4repair_space>found<seq2seq4repair_space>probability<seq2seq4repair_space>fo<seq2seq4repair_space>class<seq2seq4repair_space>" + i ) + "<seq2seq4repair_space>was\n" ) ) ; <END_BUG> System . out . println ( probabilities . get ( i ) ) ; } return result ; } public static void main ( String [ ] args ) { } }

Fix:
System . out . println ( ( ( "We<seq2seq4repair_space>found<seq2seq4repair_space>probability<seq2seq4repair_space>for<seq2seq4repair_space>class<seq2seq4repair_space>" + i ) + "<seq2seq4repair_space>was\n" ) ) ;