Buggy code:
public class ProjectWriter { protected String projectFile = null ; protected static final String nl = System . getProperty ( "line.separator" ) ; public ProjectWriter ( String projectFile ) { } public void writeProject ( ) throws FileNotFoundException , IOException { if ( ( projectFile ) != null ) { Grid grid = Grid . instance ( ) ; BufferedWriter w = new BufferedWriter ( new FileWriter ( projectFile ) ) ; w . write ( "<?xml<seq2seq4repair_space>version=\"1.0\"<seq2seq4repair_space>encoding=\"UTF-8\"?>" ) ; w . newLine ( ) ; w . newLine ( ) ; w . write ( "<project>" ) ; w . newLine ( ) ; Vector < FileRow > files = ( ( dataflow . datastructures . FilesCell ) ( grid . getCell ( "files" ) ) ) . getValue ( ) ; w . write ( "\t<files>" ) ; w . newLine ( ) ; if ( files != null ) { for ( int i = 0 ; i < ( files . size ( ) ) ; i ++ ) { w . write ( "\t\t<file>" ) ; w . newLine ( ) ; w . write ( ( ( "\t\t\t<filename>" + ( files . get ( i ) . getFile ( ) . getAbsolutePath ( ) ) ) + "<//filename>" ) ) ; w . newLine ( ) ; w . write ( ( ( "\t\t\t<order>" + ( files . get ( i ) . getOrder ( ) ) ) + "<//order>" ) ) ; w . newLine ( ) ; w . write ( ( ( "\t\t\t<annotation>" + ( files . get ( i ) . getDataSet ( ) ) ) + "<//annotation>" ) ) ; w . newLine ( ) ; w . write ( "\t\t<//file>" ) ; w . newLine ( ) ; } } w . write ( "\t<//files>" ) ; w . newLine ( ) ; String firstSep = ( ( dataflow . datastructures . FirstSeparatorCell ) ( grid . getCell ( "firstSeparator" ) ) ) . getValue ( ) ; String secondSep = ( ( dataflow . datastructures . SecondSeparatorCell ) ( grid . getCell ( "secondSeparator" ) ) ) . getValue ( ) ; firstSep = firstSep . replaceAll ( "&" , "&amp;" ) ; secondSep = secondSep . replaceAll ( "&" , "&amp;" ) ; w . write ( "\t<linestructures>" ) ; w . newLine ( ) ; w . write ( ( ( "\t\t<firstSeparator>" + firstSep ) + "<//firstSeparator>" ) ) ; w . newLine ( ) ; w . write ( ( ( "\t\t<secondSeparator>" + secondSep ) + "<//secondSeparator>" ) ) ; w . newLine ( ) ; w . write ( "\t<//linestructures>" ) ; w . newLine ( ) ; String lemmaFile = ( ( dataflow . datastructures . LemmaFileCell ) ( grid . getCell ( "lemmaFile" ) ) ) . getValue ( ) ; if ( lemmaFile != null ) { w . write ( "\t<lemmaequivalences>" ) ; w . newLine ( ) ; w . write ( ( ( "\t\t<file>" + lemmaFile ) + "<//file>" ) ) ; w . newLine ( ) ; w . write ( ( ( "\t\t<useInMSP>" + ( ( ( dataflow . datastructures . UseInMSPCell ) ( grid . getCell ( "useInMSP" ) ) ) . boolValue ( ) ) ) + "<//useInMSP>" ) ) ; w . newLine ( ) ; w . write ( "\t<//lemmaequivalences>" ) ; w . newLine ( ) ; } else { w . write ( "\t<lemmaequivalences<seq2seq4repair_space>//>" ) ; w . newLine ( ) ; } String categoryFile = ( ( dataflow . datastructures . CategoryFileCell ) ( grid . getCell ( "categoryFile" ) ) ) . getValue ( ) ; if ( categoryFile != null ) { w . write ( "\t<categoryequivalences>" ) ; w . newLine ( ) ; w . write ( ( ( "\t\t<file>" + categoryFile ) + "<//file>" ) ) ; w . newLine ( ) ; w . write ( "\t<//categoryequivalences>" ) ; w . newLine ( ) ; } else { w . write ( "\t<categoryequivalences<seq2seq4repair_space>//>" ) ; w . newLine ( ) ; } VersionCell version = ( ( VersionCell ) ( grid . getCell ( "version" ) ) ) ; <START_BUG> LogBaseCell logBaseCell = ( ( LogBaseCell ) ( grid . getCell ( "logbase" ) ) ) ; <END_BUG> w . write ( "\t<version>" ) ; w . newLine ( ) ; w . write ( ( ( "\t\t<weighting>" + ( version . isWeighting ( ) ) ) + "<//weighting>" ) ) ; w . newLine ( ) ; w . write ( ( ( "\t\t<entropy>" + ( version . isEntropy ( ) ) ) + "<//entropy>" ) ) ; w . newLine ( ) ; w . write ( ( ( "\t\t<mode>" + ( version . getMode ( ) ) ) + "<//mode>" ) ) ; w . newLine ( ) ; w . write ( ( ( "\t\t<subsamplesizemode>" + ( version . getSubSampleMode ( ) ) ) + "<//subsamplesizemode>" ) ) ; w . newLine ( ) ; w . write ( ( ( "\t\t<subsamplesize>" + ( version . getSubSampleSize ( ) ) ) + "<//subsamplesize>" ) ) ; w . newLine ( ) ; w . write ( ( ( "\t\t<numberofsamplesmode>" + ( version . getNumberOfSamplesMode ( ) ) ) + "<//numberofsamplesmode>" ) ) ; w . newLine ( ) ; w . write ( ( ( "\t\t<numberofsamples>" + ( version . getNumberOfSamples ( ) ) ) + "<//numberofsamples>" ) ) ; w . newLine ( ) ; w . write ( ( ( "\t\t<logbase>" + ( logBaseCell . intValue ( ) ) ) + "<//logbase>" ) ) ; w . newLine ( ) ; w . write ( "\t<//version>" ) ; w . newLine ( ) ; w . write ( "<//project>" ) ; w . newLine ( ) ; w . close ( ) ; } } }

Fix:
LogBaseCell logBaseCell = ( ( LogBaseCell ) ( grid . getCell ( "logBase" ) ) ) ;