Buggy code:
private static ArrayList < String > javascript = new ArrayList < String > ( ) ; private static ArrayList < ErrorFile > files = new ArrayList < ErrorFile > ( ) ; private static String folderSeparator ; private static Check check = new Check ( ) ; private static Parser parser ; private static boolean failureProject = false ; private static String projectPath ; private static String project_settings_path ; private static String project_settings_xml_path ; public static void getAllFiles ( String projectName , String settingsFile ) { } public static boolean isAFailFolder ( String path ) { } public static void writeTxt ( String path ) { } public static String cleanStr ( String str ) { } public static void js_tree_new ( String projectName , String defaultURI ) { ArrayList < String > relativeFiles = new ArrayList < String > ( ) ; for ( int i = 0 ; i < ( Web_TreeViewInitializator . files . size ( ) ) ; i ++ ) { relativeFiles . add ( Web_TreeViewInitializator . files . get ( i ) . getPath ( ) . substring ( ( ( Web_TreeViewInitializator . projectPath . length ( ) ) + 1 ) ) ) ; } String [ ] oldArr = new String [ ] { "" } ; for ( int i = 0 ; i < ( relativeFiles . size ( ) ) ; i ++ ) { int notEqual = - 1 ; String newPath = relativeFiles . get ( i ) ; String [ ] pathArr ; if ( Web_TreeViewInitializator . folderSeparator . equals ( "\\" ) ) { pathArr = relativeFiles . get ( i ) . split ( ( ( Web_TreeViewInitializator . folderSeparator ) + ( Web_TreeViewInitializator . folderSeparator ) ) ) ; } else { pathArr = relativeFiles . get ( i ) . split ( Web_TreeViewInitializator . folderSeparator ) ; } for ( int j = 0 ; j < ( pathArr . length ) ; j ++ ) { if ( ( oldArr . length ) > j ) { if ( ! ( pathArr [ j ] . equals ( oldArr [ j ] ) ) ) { notEqual = j ; break ; } } else { notEqual = j ; break ; } } if ( notEqual == ( - 1 ) ) { break ; } if ( ( ( pathArr . length ) - 1 ) != notEqual ) { for ( int j = notEqual ; j < ( ( pathArr . length ) - 1 ) ; j ++ ) { if ( j == 0 ) { Web_TreeViewInitializator . javascript . add ( ( ( ( ( Web_TreeViewInitializator . cleanStr ( pathArr [ 0 ] ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>insFld(foldersTree,<seq2seq4repair_space>gFld(\"" ) + ( pathArr [ 0 ] ) ) + "\",<seq2seq4repair_space>\"\"))" ) ) ; } else { Web_TreeViewInitializator . javascript . add ( ( ( ( ( ( ( Web_TreeViewInitializator . cleanStr ( pathArr [ j ] ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>insFld(" ) + ( Web_TreeViewInitializator . cleanStr ( pathArr [ ( j - 1 ) ] ) ) ) + ",<seq2seq4repair_space>gFld(\"" ) + ( pathArr [ j ] ) ) + "\",<seq2seq4repair_space>\"\"))" ) ) ; } String p = "" ; for ( int k = 0 ; k <= j ; k ++ ) { p += ( Web_TreeViewInitializator . folderSeparator ) + ( pathArr [ k ] ) ; } p = ( Web_TreeViewInitializator . projectPath ) + p ; if ( ! ( Web_TreeViewInitializator . isAFailFolder ( p ) ) ) { Web_TreeViewInitializator . javascript . add ( ( ( Web_TreeViewInitializator . cleanStr ( pathArr [ j ] ) ) + ".iconSrc<seq2seq4repair_space>=<seq2seq4repair_space>ICONPATH<seq2seq4repair_space>+<seq2seq4repair_space>\"folderopenok.gif\"" ) ) ; Web_TreeViewInitializator . javascript . add ( ( ( Web_TreeViewInitializator . cleanStr ( pathArr [ j ] ) ) + ".iconSrcClosed<seq2seq4repair_space>=<seq2seq4repair_space>ICONPATH<seq2seq4repair_space>+<seq2seq4repair_space>\"folderclosedok.gif\"" ) ) ; } else { Web_TreeViewInitializator . javascript . add ( ( ( Web_TreeViewInitializator . cleanStr ( pathArr [ j ] ) ) + ".iconSrc<seq2seq4repair_space>=<seq2seq4repair_space>ICONPATH<seq2seq4repair_space>+<seq2seq4repair_space>\"folderopenfail.gif\"" ) ) ; Web_TreeViewInitializator . javascript . add ( ( ( Web_TreeViewInitializator . cleanStr ( pathArr [ j ] ) ) + ".iconSrcClosed<seq2seq4repair_space>=<seq2seq4repair_space>ICONPATH<seq2seq4repair_space>+<seq2seq4repair_space>\"folderclosedfail.gif\"" ) ) ; } } } newPath = newPath . replace ( "\\" , "//" ) ; newPath = newPath . replace ( "<seq2seq4repair_space>" , "_" ) ; if ( ( pathArr . length ) == 1 ) { Web_TreeViewInitializator . javascript . add ( ( ( ( ( ( ( ( ( ( ( "doc" + i ) + "<seq2seq4repair_space>=<seq2seq4repair_space>insDoc(foldersTree,<seq2seq4repair_space>gLnk(\"S\",<seq2seq4repair_space>\"" ) + ( pathArr [ ( ( pathArr . length ) - 1 ) ] ) ) + "\",<seq2seq4repair_space>\"" ) + defaultURI ) + "//?files=" ) + newPath ) + "&project=" ) + projectName ) + "\"))" ) ) ; } else { Web_TreeViewInitializator . javascript . add ( ( ( ( ( ( ( ( ( ( ( ( ( "doc" + i ) + "<seq2seq4repair_space>=<seq2seq4repair_space>insDoc(" ) + ( Web_TreeViewInitializator . cleanStr ( pathArr [ ( ( pathArr . length ) - 2 ) ] ) ) ) + ",<seq2seq4repair_space>gLnk(\"S\",<seq2seq4repair_space>\"" ) + ( pathArr [ ( ( pathArr . length ) - 1 ) ] ) ) + "\",<seq2seq4repair_space>\"" ) + defaultURI ) + "//?files=" ) + newPath ) + "&project=" ) + projectName ) + "\"))" ) ) ; } if ( ! ( Web_TreeViewInitializator . files . get ( i ) . haveErrors ( ) ) ) { Web_TreeViewInitializator . javascript . add ( ( ( "doc" + i ) + ".iconSrc<seq2seq4repair_space>=<seq2seq4repair_space>ICONPATH<seq2seq4repair_space>+<seq2seq4repair_space>\"fileok.gif\"" ) ) ; } else { Web_TreeViewInitializator . javascript . add ( ( ( "doc" + i ) + ".iconSrc<seq2seq4repair_space>=<seq2seq4repair_space>ICONPATH<seq2seq4repair_space>+<seq2seq4repair_space>\"filefail.gif\"" ) ) ; } <START_BUG> Web_TreeViewInitializator . javascript . add ( ( ( ( ( "doc" + i ) + ".prependHTML<seq2seq4repair_space>=<seq2seq4repair_space>\"<td<seq2seq4repair_space>valign=middle><input<seq2seq4repair_space>type=checkbox<seq2seq4repair_space>id=\"" ) + i ) + "\"><//td>\"" ) ) ; <END_BUG> oldArr = pathArr ; } } public static void js_header ( String projectName , String iconPath ) { } public static void main ( String [ ] args ) { } }

Fix:
Web_TreeViewInitializator . javascript . add ( ( ( ( ( "doc" + i ) + ".prependHTML<seq2seq4repair_space>=<seq2seq4repair_space>\"<td<seq2seq4repair_space>valign=middle><input<seq2seq4repair_space>type=checkbox<seq2seq4repair_space>id=\\\"" ) + i ) + "\\\"><//td>\"" ) ) ;