Buggy code:
public final class RecommenderJob extends AbstractJob { public static final String BOOLEAN_DATA = "booleanData" ; private static final int DEFAULT_MAX_SIMILARITIES_PER_ITEM = 100 ; private static final int DEFAULT_MAX_PREFS_PER_USER = 1000 ; private static final int DEFAULT_MIN_PREFS_PER_USER = 1 ; @ Override public int run ( String [ ] args ) throws Exception { addInputOption ( ) ; addOutputOption ( ) ; addOption ( "numRecommendations" , "n" , "Number<seq2seq4repair_space>of<seq2seq4repair_space>recommendations<seq2seq4repair_space>per<seq2seq4repair_space>user" , String . valueOf ( DEFAULT_NUM_RECOMMENDATIONS ) ) ; addOption ( "usersFile" , null , "File<seq2seq4repair_space>of<seq2seq4repair_space>users<seq2seq4repair_space>to<seq2seq4repair_space>recommend<seq2seq4repair_space>for" , null ) ; addOption ( "itemsFile" , null , "File<seq2seq4repair_space>of<seq2seq4repair_space>items<seq2seq4repair_space>to<seq2seq4repair_space>recommend<seq2seq4repair_space>for" , null ) ; addOption ( "filterFile" , "f" , ( "File<seq2seq4repair_space>containing<seq2seq4repair_space>comma-separated<seq2seq4repair_space>userID,itemID<seq2seq4repair_space>pairs.<seq2seq4repair_space>Used<seq2seq4repair_space>to<seq2seq4repair_space>exclude<seq2seq4repair_space>the<seq2seq4repair_space>item<seq2seq4repair_space>from<seq2seq4repair_space>" + "the<seq2seq4repair_space>recommendations<seq2seq4repair_space>for<seq2seq4repair_space>that<seq2seq4repair_space>user<seq2seq4repair_space>(optional)" ) , null ) ; addOption ( "booleanData" , "b" , "Treat<seq2seq4repair_space>input<seq2seq4repair_space>as<seq2seq4repair_space>without<seq2seq4repair_space>pref<seq2seq4repair_space>values" , Boolean . FALSE . toString ( ) ) ; addOption ( "maxPrefsPerUser" , "mxp" , "Maximum<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>preferences<seq2seq4repair_space>considered<seq2seq4repair_space>per<seq2seq4repair_space>user<seq2seq4repair_space>in<seq2seq4repair_space>final<seq2seq4repair_space>recommendation<seq2seq4repair_space>phase" , String . valueOf ( DEFAULT_MAX_PREFS_PER_USER_CONSIDERED ) ) ; addOption ( "minPrefsPerUser" , "mp" , ( ( ( "ignore<seq2seq4repair_space>users<seq2seq4repair_space>with<seq2seq4repair_space>less<seq2seq4repair_space>preferences<seq2seq4repair_space>than<seq2seq4repair_space>this<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>similarity<seq2seq4repair_space>computation<seq2seq4repair_space>" + "(default:<seq2seq4repair_space>" ) + ( RecommenderJob . DEFAULT_MIN_PREFS_PER_USER ) ) + ')' ) , String . valueOf ( RecommenderJob . DEFAULT_MIN_PREFS_PER_USER ) ) ; addOption ( "maxSimilaritiesPerItem" , "m" , "Maximum<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>similarities<seq2seq4repair_space>considered<seq2seq4repair_space>per<seq2seq4repair_space>item<seq2seq4repair_space>" , String . valueOf ( RecommenderJob . DEFAULT_MAX_SIMILARITIES_PER_ITEM ) ) ; addOption ( "maxPrefsPerUserInItemSimilarity" , "mppuiis" , ( ( ( "max<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>preferences<seq2seq4repair_space>to<seq2seq4repair_space>consider<seq2seq4repair_space>per<seq2seq4repair_space>user<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>" + "item<seq2seq4repair_space>similarity<seq2seq4repair_space>computation<seq2seq4repair_space>phase,<seq2seq4repair_space>users<seq2seq4repair_space>with<seq2seq4repair_space>more<seq2seq4repair_space>preferences<seq2seq4repair_space>will<seq2seq4repair_space>be<seq2seq4repair_space>sampled<seq2seq4repair_space>down<seq2seq4repair_space>(default:<seq2seq4repair_space>" ) + ( RecommenderJob . DEFAULT_MAX_PREFS_PER_USER ) ) + ')' ) , String . valueOf ( RecommenderJob . DEFAULT_MAX_PREFS_PER_USER ) ) ; <START_BUG> addOption ( "similarityClassname" , "s" , ( ( ( "Name<seq2seq4repair_space>of<seq2seq4repair_space>distributed<seq2seq4repair_space>similarity<seq2seq4repair_space>measures<seq2seq4repair_space>class<seq2seq4repair_space>to<seq2seq4repair_space>instantiate,<seq2seq4repair_space>" + "alternatively<seq2seq4repair_space>use<seq2seq4repair_space>one<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>predefined<seq2seq4repair_space>similarities<seq2seq4repair_space>(" ) + ( VectorSimilarityMeasures . list ( ) ) ) + ')' ) ) ; <END_BUG> addOption ( "threshold" , "tr" , "discard<seq2seq4repair_space>item<seq2seq4repair_space>pairs<seq2seq4repair_space>with<seq2seq4repair_space>a<seq2seq4repair_space>similarity<seq2seq4repair_space>value<seq2seq4repair_space>below<seq2seq4repair_space>this" , false ) ; Map < String , String > parsedArgs = parseArguments ( args ) ; if ( parsedArgs == null ) { return - 1 ; } Path outputPath = getOutputPath ( ) ; int numRecommendations = Integer . parseInt ( parsedArgs . get ( "--numRecommendations" ) ) ; String usersFile = parsedArgs . get ( "--usersFile" ) ; String itemsFile = parsedArgs . get ( "--itemsFile" ) ; String filterFile = parsedArgs . get ( "--filterFile" ) ; boolean booleanData = Boolean . valueOf ( parsedArgs . get ( "--booleanData" ) ) ; int maxPrefsPerUser = Integer . parseInt ( parsedArgs . get ( "--maxPrefsPerUser" ) ) ; int minPrefsPerUser = Integer . parseInt ( parsedArgs . get ( "--minPrefsPerUser" ) ) ; int maxPrefsPerUserInItemSimilarity = Integer . parseInt ( parsedArgs . get ( "--maxPrefsPerUserInItemSimilarity" ) ) ; int maxSimilaritiesPerItem = Integer . parseInt ( parsedArgs . get ( "--maxSimilaritiesPerItem" ) ) ; String similarityClassname = parsedArgs . get ( "--similarityClassname" ) ; double threshold = ( parsedArgs . containsKey ( "--threshold" ) ) ? Double . parseDouble ( parsedArgs . get ( "--threshold" ) ) : RowSimilarityJob . NO_THRESHOLD ; Path prepPath = getTempPath ( "preparePreferenceMatrix" ) ; Path similarityMatrixPath = getTempPath ( "similarityMatrix" ) ; Path prePartialMultiplyPath1 = getTempPath ( "prePartialMultiply1" ) ; Path prePartialMultiplyPath2 = getTempPath ( "prePartialMultiply2" ) ; Path explicitFilterPath = getTempPath ( "explicitFilterPath" ) ; Path partialMultiplyPath = getTempPath ( "partialMultiply" ) ; AtomicInteger currentPhase = new AtomicInteger ( ) ; int numberOfUsers = - 1 ; if ( shouldRunNextPhase ( parsedArgs , currentPhase ) ) { ToolRunner . run ( getConf ( ) , new PreparePreferenceMatrixJob ( ) , new String [ ] { "--input" , getInputPath ( ) . toString ( ) , "--output" , prepPath . toString ( ) , "--maxPrefsPerUser" , String . valueOf ( maxPrefsPerUserInItemSimilarity ) , "--minPrefsPerUser" , String . valueOf ( minPrefsPerUser ) , "--booleanData" , String . valueOf ( booleanData ) , "--tempDir" , getTempPath ( ) . toString ( ) } ) ; numberOfUsers = TasteHadoopUtils . readInt ( new Path ( prepPath , PreparePreferenceMatrixJob . NUM_USERS ) , getConf ( ) ) ; } if ( shouldRunNextPhase ( parsedArgs , currentPhase ) ) { if ( numberOfUsers == ( - 1 ) ) { numberOfUsers = ( ( int ) ( HadoopUtil . countRecords ( new Path ( prepPath , PreparePreferenceMatrixJob . USER_VECTORS ) , LIST , null , getConf ( ) ) ) ) ; } ToolRunner . run ( getConf ( ) , new RowSimilarityJob ( ) , new String [ ] { "--input" , new Path ( prepPath , PreparePreferenceMatrixJob . RATING_MATRIX ) . toString ( ) , "--output" , similarityMatrixPath . toString ( ) , "--numberOfColumns" , String . valueOf ( numberOfUsers ) , "--similarityClassname" , similarityClassname , "--maxSimilaritiesPerRow" , String . valueOf ( maxSimilaritiesPerItem ) , "--excludeSelfSimilarity" , String . valueOf ( Boolean . TRUE ) , "--threshold" , String . valueOf ( threshold ) , "--tempDir" , getTempPath ( ) . toString ( ) } ) ; } if ( shouldRunNextPhase ( parsedArgs , currentPhase ) ) { Job prePartialMultiply1 = prepareJob ( similarityMatrixPath , prePartialMultiplyPath1 , SequenceFileInputFormat . class , SimilarityMatrixRowWrapperMapper . class , VarIntWritable . class , VectorOrPrefWritable . class , Reducer . class , VarIntWritable . class , VectorOrPrefWritable . class , SequenceFileOutputFormat . class ) ; prePartialMultiply1 . waitForCompletion ( true ) ; Job prePartialMultiply2 = prepareJob ( new Path ( prepPath , PreparePreferenceMatrixJob . USER_VECTORS ) , prePartialMultiplyPath2 , SequenceFileInputFormat . class , UserVectorSplitterMapper . class , VarIntWritable . class , VectorOrPrefWritable . class , Reducer . class , VarIntWritable . class , VectorOrPrefWritable . class , SequenceFileOutputFormat . class ) ; if ( usersFile != null ) { prePartialMultiply2 . getConfiguration ( ) . set ( USERS_FILE , usersFile ) ; } prePartialMultiply2 . getConfiguration ( ) . setInt ( MAX_PREFS_PER_USER_CONSIDERED , maxPrefsPerUser ) ; prePartialMultiply2 . waitForCompletion ( true ) ; Job partialMultiply = prepareJob ( new Path ( ( ( prePartialMultiplyPath1 + "," ) + prePartialMultiplyPath2 ) ) , partialMultiplyPath , SequenceFileInputFormat . class , Mapper . class , VarIntWritable . class , VectorOrPrefWritable . class , ToVectorAndPrefReducer . class , VarIntWritable . class , VectorAndPrefsWritable . class , SequenceFileOutputFormat . class ) ; setS3SafeCombinedInputPath ( partialMultiply , getTempPath ( ) , prePartialMultiplyPath1 , prePartialMultiplyPath2 ) ;

Fix:
addOption ( "similarityClassname" , "s" , ( ( ( "Name<seq2seq4repair_space>of<seq2seq4repair_space>distributed<seq2seq4repair_space>similarity<seq2seq4repair_space>measures<seq2seq4repair_space>class<seq2seq4repair_space>to<seq2seq4repair_space>instantiate,<seq2seq4repair_space>" + "alternatively<seq2seq4repair_space>use<seq2seq4repair_space>one<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>predefined<seq2seq4repair_space>similarities<seq2seq4repair_space>(" ) + ( VectorSimilarityMeasures . list ( ) ) ) + ')' ) , true ) ;