Buggy code:
Option maxOpt = obuilder . withLongName ( "max" ) . withRequired ( false ) . withArgument ( abuilder . withName ( "max" ) . withMinimum ( 1 ) . withMaximum ( 1 ) . create ( ) ) . withDescription ( "The<seq2seq4repair_space>maximum<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>vectors<seq2seq4repair_space>to<seq2seq4repair_space>output.<seq2seq4repair_space>If<seq2seq4repair_space>not<seq2seq4repair_space>specified,<seq2seq4repair_space>then<seq2seq4repair_space>it<seq2seq4repair_space>will<seq2seq4repair_space>loop<seq2seq4repair_space>over<seq2seq4repair_space>all<seq2seq4repair_space>docs" ) . withShortName ( "m" ) . create ( ) ; Option outWriterOpt = obuilder . withLongName ( "outputWriter" ) . withRequired ( false ) . withArgument ( abuilder . withName ( "outputWriter" ) . withMinimum ( 1 ) . withMaximum ( 1 ) . create ( ) ) . withDescription ( ( "The<seq2seq4repair_space>VectorWriter<seq2seq4repair_space>to<seq2seq4repair_space>use,<seq2seq4repair_space>either<seq2seq4repair_space>seq<seq2seq4repair_space>" + "(SequenceFileVectorWriter<seq2seq4repair_space>-<seq2seq4repair_space>default)<seq2seq4repair_space>or<seq2seq4repair_space>file<seq2seq4repair_space>(Writes<seq2seq4repair_space>to<seq2seq4repair_space>a<seq2seq4repair_space>File<seq2seq4repair_space>using<seq2seq4repair_space>JSON<seq2seq4repair_space>format)" ) ) . withShortName ( "e" ) . create ( ) ; Option minDFOpt = obuilder . withLongName ( "minDF" ) . withRequired ( false ) . withArgument ( abuilder . withName ( "minDF" ) . withMinimum ( 1 ) . withMaximum ( 1 ) . create ( ) ) . withDescription ( "The<seq2seq4repair_space>minimum<seq2seq4repair_space>document<seq2seq4repair_space>frequency.<seq2seq4repair_space>Default<seq2seq4repair_space>is<seq2seq4repair_space>1" ) . withShortName ( "md" ) . create ( ) ; Option maxDFPercentOpt = obuilder . withLongName ( "maxDFPercent" ) . withRequired ( false ) . withArgument ( abuilder . withName ( "maxDFPercent" ) . withMinimum ( 1 ) . withMaximum ( 1 ) . create ( ) ) . withDescription ( ( "The<seq2seq4repair_space>max<seq2seq4repair_space>percentage<seq2seq4repair_space>of<seq2seq4repair_space>docs<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>DF.<seq2seq4repair_space>Can<seq2seq4repair_space>be<seq2seq4repair_space>used<seq2seq4repair_space>to<seq2seq4repair_space>remove<seq2seq4repair_space>really<seq2seq4repair_space>high<seq2seq4repair_space>frequency<seq2seq4repair_space>terms." + "<seq2seq4repair_space>Expressed<seq2seq4repair_space>as<seq2seq4repair_space>an<seq2seq4repair_space>integer<seq2seq4repair_space>between<seq2seq4repair_space>0<seq2seq4repair_space>and<seq2seq4repair_space>100.<seq2seq4repair_space>Default<seq2seq4repair_space>is<seq2seq4repair_space>99." ) ) . withShortName ( "x" ) . create ( ) ; Option helpOpt = obuilder . withLongName ( "help" ) . withDescription ( "Print<seq2seq4repair_space>out<seq2seq4repair_space>help" ) . withShortName ( "h" ) . create ( ) ; Group group = gbuilder . withName ( "Options" ) . withOption ( inputOpt ) . withOption ( idFieldOpt ) . withOption ( outputOpt ) . withOption ( delimiterOpt ) . withOption ( helpOpt ) . withOption ( fieldOpt ) . withOption ( maxOpt ) . withOption ( dictOutOpt ) . withOption ( powerOpt ) . withOption ( outWriterOpt ) . withOption ( maxDFPercentOpt ) . withOption ( weightOpt ) . withOption ( minDFOpt ) . create ( ) ; try { Parser parser = new Parser ( ) ; parser . setGroup ( group ) ; CommandLine cmdLine = parser . parse ( args ) ; if ( cmdLine . hasOption ( helpOpt ) ) { CommandLineUtil . printHelp ( group ) ; return ; } if ( cmdLine . hasOption ( inputOpt ) ) { File file = new File ( cmdLine . getValue ( inputOpt ) . toString ( ) ) ; if ( ! ( file . isDirectory ( ) ) ) { <START_BUG> throw new IllegalArgumentException ( ( ( "Lucene<seq2seq4repair_space>directory:<seq2seq4repair_space>" + ( file . getName ( ) ) ) + "<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist<seq2seq4repair_space>or<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>directory" ) ) ; <END_BUG> } long maxDocs = Long . MAX_VALUE ; if ( cmdLine . hasOption ( maxOpt ) ) { maxDocs = Long . parseLong ( cmdLine . getValue ( maxOpt ) . toString ( ) ) ; } if ( maxDocs < 0 ) { throw new IllegalArgumentException ( "maxDocs<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>>=<seq2seq4repair_space>0" ) ; } Directory dir = FSDirectory . open ( file ) ; IndexReader reader = IndexReader . open ( dir , true ) ; Weight weight ; if ( cmdLine . hasOption ( weightOpt ) ) { String wString = cmdLine . getValue ( weightOpt ) . toString ( ) ; if ( wString . equalsIgnoreCase ( "tf" ) ) { weight = new TF ( ) ; } else if ( wString . equalsIgnoreCase ( "tfidf" ) ) { weight = new TFIDF ( ) ; } else { throw new OptionException ( weightOpt ) ; } } else { weight = new TFIDF ( ) ; } String field = cmdLine . getValue ( fieldOpt ) . toString ( ) ; int minDf = 1 ; if ( cmdLine . hasOption ( minDFOpt ) ) { minDf = Integer . parseInt ( cmdLine . getValue ( minDFOpt ) . toString ( ) ) ; } int maxDFPercent = 99 ; if ( cmdLine . hasOption ( maxDFPercentOpt ) ) { maxDFPercent = Integer . parseInt ( cmdLine . getValue ( maxDFPercentOpt ) . toString ( ) ) ; } TermInfo termInfo = new CachedTermInfo ( reader , field , minDf , maxDFPercent ) ; VectorMapper mapper = new TFDFMapper ( reader , weight , termInfo ) ; double norm = LuceneIterable . NO_NORMALIZING ; if ( cmdLine . hasOption ( powerOpt ) ) { String power = cmdLine . getValue ( powerOpt ) . toString ( ) ; if ( power . equals ( "INF" ) ) { norm = Double . POSITIVE_INFINITY ; } else { norm = Double . parseDouble ( power ) ; } } String idField = null ; if ( cmdLine . hasOption ( idFieldOpt ) ) { idField = cmdLine . getValue ( idFieldOpt ) . toString ( ) ; } LuceneIterable iterable ; if ( norm == ( LuceneIterable . NO_NORMALIZING ) ) { iterable = new LuceneIterable ( reader , idField , field , mapper , LuceneIterable . NO_NORMALIZING ) ; } else { iterable = new LuceneIterable ( reader , idField , field , mapper , norm ) ; } String outFile = cmdLine . getValue ( outputOpt ) . toString ( ) ; Driver . log . info ( "Output<seq2seq4repair_space>File:<seq2seq4repair_space>{}" , outFile ) ; VectorWriter vectorWriter ; if ( cmdLine . hasOption ( outWriterOpt ) ) { String outWriter = cmdLine . getValue ( outWriterOpt ) . toString ( ) ; if ( outWriter . equals ( "file" ) ) { BufferedWriter writer = new BufferedWriter ( new FileWriter ( outFile ) ) ; vectorWriter = new JWriterVectorWriter ( writer ) ; } else { vectorWriter = Driver . getSeqFileWriter ( outFile ) ; } } else { vectorWriter = Driver . getSeqFileWriter ( outFile ) ; } long numDocs = vectorWriter . write ( iterable , maxDocs ) ; vectorWriter . close ( ) ; Driver . log . info ( "Wrote:<seq2seq4repair_space>{}<seq2seq4repair_space>vectors" , numDocs ) ; String delimiter = ( cmdLine . hasOption ( delimiterOpt ) ) ? cmdLine . getValue ( delimiterOpt ) . toString ( ) : "\t" ; File dictOutFile = new File ( cmdLine . getValue ( dictOutOpt ) . toString ( ) ) ; Driver . log . info ( "Dictionary<seq2seq4repair_space>Output<seq2seq4repair_space>file:<seq2seq4repair_space>{}"

Fix:
throw new IllegalArgumentException ( ( ( "Lucene<seq2seq4repair_space>directory:<seq2seq4repair_space>" + ( file . getAbsolutePath ( ) ) ) + "<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist<seq2seq4repair_space>or<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>directory" ) ) ;