Buggy code:
String javascript = va . getJavascript ( ) ; if ( ( javascript != null ) && ( ( javascript . length ( ) ) > 0 ) ) lActions . add ( va ) ; else i . remove ( ) ; } Collections . sort ( lActions , new Comparator ( ) { public int compare ( Object o1 , Object o2 ) { ValidatorAction va1 = ( ( ValidatorAction ) ( o1 ) ) ; ValidatorAction va2 = ( ( ValidatorAction ) ( o2 ) ) ; if ( ( ( ( va1 . getDepends ( ) ) == null ) || ( ( va1 . getDepends ( ) . length ( ) ) == 0 ) ) && ( ( ( va2 . getDepends ( ) ) == null ) || ( ( va2 . getDepends ( ) . length ( ) ) == 0 ) ) ) { return 0 ; } else if ( ( ( ( va1 . getDepends ( ) ) != null ) && ( ( va1 . getDepends ( ) . length ( ) ) > 0 ) ) && ( ( ( va2 . getDepends ( ) ) == null ) || ( ( va2 . getDepends ( ) . length ( ) ) == 0 ) ) ) { return 1 ; } else if ( ( ( ( va1 . getDepends ( ) ) == null ) || ( ( va1 . getDepends ( ) . length ( ) ) == 0 ) ) && ( ( ( va2 . getDepends ( ) ) != null ) && ( ( va2 . getDepends ( ) . length ( ) ) > 0 ) ) ) { return - 1 ; } else { return ( va1 . getDependencies ( ) . size ( ) ) - ( va2 . getDependencies ( ) . size ( ) ) ; } } } ) ; String methods = null ; for ( Iterator i = lActions . iterator ( ) ; i . hasNext ( ) ; ) { ValidatorAction va = ( ( ValidatorAction ) ( i . next ( ) ) ) ; if ( methods == null ) methods = ( va . getMethod ( ) ) + "(form)" ; else methods += ( "<seq2seq4repair_space>&&<seq2seq4repair_space>" + ( va . getMethod ( ) ) ) + "(form)" ; } results . append ( getJavascriptBegin ( methods ) ) ; for ( Iterator i = lActions . iterator ( ) ; i . hasNext ( ) ; ) { ValidatorAction va = ( ( ValidatorAction ) ( i . next ( ) ) ) ; String jscriptVar = null ; String functionName = null ; if ( ( ( va . getJsFunctionName ( ) ) != null ) && ( ( va . getJsFunctionName ( ) . length ( ) ) > 0 ) ) functionName = va . getJsFunctionName ( ) ; else functionName = va . getName ( ) ; results . append ( ( ( "<seq2seq4repair_space>function<seq2seq4repair_space>" + functionName ) + "<seq2seq4repair_space>()<seq2seq4repair_space>{<seq2seq4repair_space>\n" ) ) ; for ( Iterator x = form . getFields ( ) . iterator ( ) ; x . hasNext ( ) ; ) { Field field = ( ( Field ) ( x . next ( ) ) ) ; if ( ( ( field . getPage ( ) ) == ( page ) ) && ( field . isDependency ( va . getName ( ) ) ) ) { String message = ValidatorUtil . getMessage ( messages , locale , va , field ) ; message = ( message != null ) ? message : "" ; jscriptVar = getNextVar ( jscriptVar ) ; <START_BUG> results . append ( ( ( ( ( ( ( "<seq2seq4repair_space>this." + jscriptVar ) + "<seq2seq4repair_space>=<seq2seq4repair_space>new<seq2seq4repair_space>Array(\"" ) + ( field . getProperty ( ) ) ) + "\",<seq2seq4repair_space>\"" ) + message ) + "\",<seq2seq4repair_space>" ) ) ; <END_BUG> results . append ( "new<seq2seq4repair_space>Function<seq2seq4repair_space>(\"varName\",<seq2seq4repair_space>\"" ) ; Map hVars = field . getVars ( ) ; for ( Iterator iVars = hVars . keySet ( ) . iterator ( ) ; iVars . hasNext ( ) ; ) { String varKey = ( ( String ) ( iVars . next ( ) ) ) ; Var var = ( ( Var ) ( hVars . get ( varKey ) ) ) ; String varValue = var . getValue ( ) ; String jsType = var . getJsType ( ) ; if ( JSTYPE_INT . equalsIgnoreCase ( jsType ) ) results . append ( ( ( ( ( "this." + varKey ) + "=" ) + ( ValidatorUtil . replace ( varValue , "\\" , "\\\\" ) ) ) + ";<seq2seq4repair_space>" ) ) ; else if ( JSTYPE_REGEXP . equalsIgnoreCase ( jsType ) ) results . append ( ( ( ( ( "this." + varKey ) + "=//" ) + ( ValidatorUtil . replace ( varValue , "\\" , "\\\\" ) ) ) + "//;<seq2seq4repair_space>" ) ) ; else if ( JSTYPE_STRING . equalsIgnoreCase ( jsType ) ) results . append ( ( ( ( ( "this." + varKey ) + "='" ) + ( ValidatorUtil . replace ( varValue , "\\" , "\\\\" ) ) ) + "';<seq2seq4repair_space>" ) ) ; else if ( "mask" . equalsIgnoreCase ( varKey ) ) results . append ( ( ( ( ( "this." + varKey ) + "=//" ) + ( ValidatorUtil . replace ( varValue , "\\" , "\\\\" ) ) ) + "//;<seq2seq4repair_space>" ) ) ; else results . append ( ( ( ( ( "this." + varKey ) + "='" ) + ( ValidatorUtil . replace ( varValue , "\\" , "\\\\" ) ) ) + "';<seq2seq4repair_space>" ) ) ; } results . append ( "<seq2seq4repair_space>return<seq2seq4repair_space>this[varName];\"));\n" ) ; } } results . append ( "\t<seq2seq4repair_space>}<seq2seq4repair_space>\n\n" ) ; } }

Fix:
results . append ( ( ( ( ( ( ( "<seq2seq4repair_space>this." + jscriptVar ) + "<seq2seq4repair_space>=<seq2seq4repair_space>new<seq2seq4repair_space>Array(\"" ) + ( field . getKey ( ) ) ) + "\",<seq2seq4repair_space>\"" ) + message ) + "\",<seq2seq4repair_space>" ) ) ;