Buggy code:
public class ClassComparison extends BabelomicsTool { private Dataset dataset ; private String test ; private String className = null ; private List < String > classValues = null ; private String correction ; private double pValue = 0.05 ; private double foldChangeValue = 2 ; private int minDisplay = 10 ; private int maxDisplay = Integer . MAX_VALUE ; private String msg = "" ; public ClassComparison ( ) { } @ Override public void initOptions ( ) { } @ Override public void execute ( ) { } public void executeT ( ) { } public void executeFoldChange ( ) { } private void setFoldChangeResults ( Dataset subDataset , String test , String testLabel , double [ ] res , String className ) throws IOException , InvalidIndexException { int [ ] rowOrder = ListUtils . order ( ArrayUtils . toList ( res ) , true ) ; DataFrame dataFrame = new DataFrame ( subDataset . getFeatureNames ( ) . size ( ) , 0 ) ; dataFrame . addColumn ( test , ListUtils . ordered ( ArrayUtils . toStringList ( res ) , rowOrder ) ) ; dataFrame . setRowNames ( ListUtils . ordered ( subDataset . getFeatureNames ( ) , rowOrder ) ) ; FeatureData featureData = new FeatureData ( dataFrame ) ; File file = new File ( ( ( ( ( outdir ) + "//" ) + test ) + "_foldchange.txt" ) ) ; IOUtils . write ( file , dataFrame . toString ( true , true ) ) ; List < String > featureNames = new ArrayList < String > ( ) ; List < String > featureValues = new ArrayList < String > ( ) ; List < String > featureNamesUp = new ArrayList < String > ( ) ; List < String > featureNamesDown = new ArrayList < String > ( ) ; for ( String rowName : dataFrame . getRowNames ( ) ) { List < String > row = dataFrame . getRow ( rowName ) ; double stats = Double . parseDouble ( row . get ( 0 ) ) ; if ( ( Math . abs ( stats ) ) >= ( foldChangeValue ) ) { featureNames . add ( rowName ) ; featureValues . add ( row . get ( 0 ) ) ; if ( stats >= 0 ) featureNamesUp . add ( rowName ) ; else featureNamesDown . add ( rowName ) ; } } dataFrame = new DataFrame ( featureNames . size ( ) , 0 ) ; dataFrame . addColumn ( test , featureValues ) ; dataFrame . setRowNames ( featureNames ) ; List < Integer > sigRowIndexes = new ArrayList < Integer > ( ) ; for ( String feat : featureNames ) { int idx = 0 ; for ( String featSub : subDataset . getFeatureNames ( ) ) { <START_BUG> if ( feat . equalsIgnoreCase ( featSub ) ) <END_BUG> sigRowIndexes . add ( idx ) ; idx ++ ; } } if ( ( dataFrame . getRowDimension ( ) ) > 0 ) { DoubleMatrix doubleMatrix = new DoubleMatrix ( dataFrame . getRowDimension ( ) , subDataset . getColumnDimension ( ) ) ; for ( int i = 0 ; i < ( sigRowIndexes . size ( ) ) ; i ++ ) { doubleMatrix . setRow ( i , subDataset . getDoubleMatrix ( ) . getRow ( sigRowIndexes . get ( i ) ) ) ; } File fileXX = new File ( ( ( ( ( outdir ) + "//" ) + test ) + "_foldchange_significative_dataset.txt" ) ) ; Dataset sigDataset = new Dataset ( subDataset . getSampleNames ( ) , featureNames , doubleMatrix ) ; sigDataset . save ( fileXX ) ; File fileAux = new File ( ( ( ( ( outdir ) + "//" ) + test ) + "_foldchange_significative_table.txt" ) ) ; IOUtils . write ( fileAux , dataFrame . toString ( true , true ) ) ; fileAux = new File ( ( ( ( ( outdir ) + "//" ) + test ) + "_foldchange_significative_table_up.txt" ) ) ; IOUtils . write ( fileAux , featureNamesUp ) ; fileAux = new File ( ( ( ( ( outdir ) + "//" ) + test ) + "_foldchange_significative_table_down.txt" ) ) ; IOUtils . write ( fileAux , featureNamesDown ) ; } if ( file . exists ( ) ) { result . addOutputItem ( new org . bioinfo . tool . result . Item ( ( test + "_foldchange" ) , file . getName ( ) , ( testLabel + "<seq2seq4repair_space>fold-change<seq2seq4repair_space>output<seq2seq4repair_space>file" ) , TYPE . FILE , new ArrayList < String > ( ) , new HashMap < String , String > ( ) , ( testLabel + "<seq2seq4repair_space>fold-change.Output<seq2seq4repair_space>files" ) ) ) ; String json = ( "{\\\"paramfilename\\\":<seq2seq4repair_space>\\\"input_params.txt\\\",<seq2seq4repair_space>\\\"testfilename\\\":<seq2seq4repair_space>\\\"" + ( file . getName ( ) ) ) + "\\\"}" ; result . addOutputItem ( new org . bioinfo . tool . result . Item ( ( "diff_expr_" + ( StringUtils . randomString ( 8 ) ) ) , json , "Significative<seq2seq4repair_space>results" , TYPE . FILE , StringUtils . toList ( "DIFF_EXPRESSION_VIEWER" ) , new HashMap < String , String > ( ) , ( testLabel + "<seq2seq4repair_space>fold-change.<seq2seq4repair_space>Significative<seq2seq4repair_space>results" ) ) ) ; DiffExpressionUtils . createFatiScanRedirection ( dataFrame , test , test , result , outdir , ( testLabel + "<seq2seq4repair_space>fold-change." ) ) ; } } public void executeAnova ( ) { } public void executeLimma ( ) { } }

Fix:
if ( ( feat . equalsIgnoreCase ( featSub ) ) && ( ! ( sigRowIndexes . contains ( idx ) ) ) )