Buggy code:
public class Dispatcher { static final Logger log = Logger . getLogger ( "org.hypertable.examples" ) ; private static class RequestHandler implements DispatchHandler { public RequestHandler ( long timeout ) { } public void handle ( Event event ) { } public synchronized Event GetRequest ( ) throws InterruptedException { } public synchronized int waitForConnections ( int clients ) throws InterruptedException , HypertableException { } private LinkedList < Event > mQueue = new LinkedList < Event > ( ) ; private int mConnections = 0 ; private long mStartTime = 0 ; private long mTimeout ; } private static class HandlerFactory implements ConnectionHandlerFactory { public HandlerFactory ( DispatchHandler cb ) { } public DispatchHandler newInstance ( ) { } private DispatchHandler mDispatchHandler ; } static String [ ] usage = new String [ ] { "" , "usage:<seq2seq4repair_space>Dispatcher<seq2seq4repair_space>[OPTIONS]<seq2seq4repair_space>read|write|scan|incr<seq2seq4repair_space><keyCount><seq2seq4repair_space><valueSize>" , "" , "OPTIONS:" , "<seq2seq4repair_space>--help<seq2seq4repair_space>Display<seq2seq4repair_space>this<seq2seq4repair_space>help<seq2seq4repair_space>text<seq2seq4repair_space>and<seq2seq4repair_space>exit" , "<seq2seq4repair_space>--clients=<n><seq2seq4repair_space>Wait<seq2seq4repair_space>for<seq2seq4repair_space><n><seq2seq4repair_space>clients<seq2seq4repair_space>to<seq2seq4repair_space>connect" , "<seq2seq4repair_space>--driver=
<seq2seq4repair_space>Which<seq2seq4repair_space>DB<seq2seq4repair_space>driver<seq2seq4repair_space>to<seq2seq4repair_space>use.<seq2seq4repair_space>Valid<seq2seq4repair_space>values<seq2seq4repair_space>include:" , "<seq2seq4repair_space>hypertable,<seq2seq4repair_space>hbase<seq2seq4repair_space>(default<seq2seq4repair_space>=<seq2seq4repair_space>hypertable)" , "<seq2seq4repair_space>--key-max=<n><seq2seq4repair_space>When<seq2seq4repair_space>generating<seq2seq4repair_space>random<seq2seq4repair_space>keys,<seq2seq4repair_space>modulo<seq2seq4repair_space>resulting<seq2seq4repair_space>key<seq2seq4repair_space>by<seq2seq4repair_space><n>" , "<seq2seq4repair_space>--key-size=<n><seq2seq4repair_space>Key<seq2seq4repair_space>size<seq2seq4repair_space>(default<seq2seq4repair_space>=<seq2seq4repair_space>10)" , "<seq2seq4repair_space>--measure-latency<seq2seq4repair_space>Measure<seq2seq4repair_space>request<seq2seq4repair_space>latency<seq2seq4repair_space>(default<seq2seq4repair_space>is<seq2seq4repair_space>false)" , "<seq2seq4repair_space>--output-dir=<dir><seq2seq4repair_space>Directory<seq2seq4repair_space>to<seq2seq4repair_space>write<seq2seq4repair_space>test<seq2seq4repair_space>report<seq2seq4repair_space>into<seq2seq4repair_space>(default<seq2seq4repair_space>is<seq2seq4repair_space>cwd)" , "<seq2seq4repair_space>--parallel=<n><seq2seq4repair_space>Run<seq2seq4repair_space>test<seq2seq4repair_space>in<seq2seq4repair_space>parallel<seq2seq4repair_space>mode<seq2seq4repair_space>by<seq2seq4repair_space>spawning<seq2seq4repair_space><n><seq2seq4repair_space>threads<seq2seq4repair_space>per<seq2seq4repair_space>client" , "<seq2seq4repair_space>--port=<n><seq2seq4repair_space>Specifies<seq2seq4repair_space>the<seq2seq4repair_space>listen<seq2seq4repair_space>port<seq2seq4repair_space>(default<seq2seq4repair_space>=<seq2seq4repair_space>11256)" , "<seq2seq4repair_space>--timeout=<ms><seq2seq4repair_space>Wait<seq2seq4repair_space>for<seq2seq4repair_space>connection<seq2seq4repair_space>timeout<seq2seq4repair_space>in<seq2seq4repair_space>milliseconds" , "<seq2seq4repair_space>(default<seq2seq4repair_space>=<seq2seq4repair_space>5000)" , "<seq2seq4repair_space>--random<seq2seq4repair_space>Generate<seq2seq4repair_space>random<seq2seq4repair_space>keys" , "<seq2seq4repair_space>--randomize-tasks<seq2seq4repair_space>Randomize<seq2seq4repair_space>the<seq2seq4repair_space>task<seq2seq4repair_space>queue<seq2seq4repair_space>before<seq2seq4repair_space>starting<seq2seq4repair_space>test" , "<seq2seq4repair_space>--scan-buffer-size=<n><seq2seq4repair_space>Size<seq2seq4repair_space>of<seq2seq4repair_space>scan<seq2seq4repair_space>result<seq2seq4repair_space>transfer<seq2seq4repair_space>buffer<seq2seq4repair_space>in<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>bytes" , "<seq2seq4repair_space>(default<seq2seq4repair_space>=<seq2seq4repair_space>65K)" , "<seq2seq4repair_space>--submit-at-most=<n><seq2seq4repair_space>Submit<seq2seq4repair_space>no<seq2seq4repair_space>more<seq2seq4repair_space>than<seq2seq4repair_space><n><seq2seq4repair_space>keys,<seq2seq4repair_space>regardless<seq2seq4repair_space>of<seq2seq4repair_space><keyCount>" , "<seq2seq4repair_space>--submit-exactly=<n><seq2seq4repair_space>Submit<seq2seq4repair_space>exactly<seq2seq4repair_space><n><seq2seq4repair_space>keys,<seq2seq4repair_space>replicating<seq2seq4repair_space>sequence<seq2seq4repair_space>generated<seq2seq4repair_space>by" , "<seq2seq4repair_space><keyCount><seq2seq4repair_space>if<seq2seq4repair_space>necessary" , "<seq2seq4repair_space>--test-name=<name><seq2seq4repair_space>Test<seq2seq4repair_space>name<seq2seq4repair_space>used<seq2seq4repair_space>as<seq2seq4repair_space>filename<seq2seq4repair_space>prefix<seq2seq4repair_space>for<seq2seq4repair_space>summary<seq2seq4repair_space>output<seq2seq4repair_space>file" , "<seq2seq4repair_space>--value-data=<fname><seq2seq4repair_space>Absolute<seq2seq4repair_space>path<seq2seq4repair_space>to<seq2seq4repair_space>file,<seq2seq4repair_space>on<seq2seq4repair_space>Client<seq2seq4repair_space>machines,<seq2seq4repair_space>containing<seq2seq4repair_space>data" , "<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>randomly<seq2seq4repair_space>sampled<seq2seq4repair_space>for<seq2seq4repair_space>value<seq2seq4repair_space>content" , "<seq2seq4repair_space>--zipf<seq2seq4repair_space>For<seq2seq4repair_space>random<seq2seq4repair_space>order,<seq2seq4repair_space>use<seq2seq4repair_space>Zipfian<seq2seq4repair_space>distribution" , "<seq2seq4repair_space>(default<seq2seq4repair_space>is<seq2seq4repair_space>uniform)" , "" , "This<seq2seq4repair_space>program<seq2seq4repair_space>is<seq2seq4repair_space>part<seq2seq4repair_space>of<seq2seq4repair_space>a<seq2seq4repair_space>performance<seq2seq4repair_space>test<seq2seq4repair_space>suite.<seq2seq4repair_space>It<seq2seq4repair_space>acts<seq2seq4repair_space>as<seq2seq4repair_space>a" , "dispatcher,<seq2seq4repair_space>handing<seq2seq4repair_space>out<seq2seq4repair_space>parcels<seq2seq4repair_space>of<seq2seq4repair_space>work<seq2seq4repair_space>to<seq2seq4repair_space>test<seq2seq4repair_space>clients." , "" , null } ; static final int DEFAULT_PORT = 11256 ; static final int DEFAULT_KEY_SIZE = 10 ; public static String testTypeString ( Task . Order order , Task . Type testType ) { } public static void main ( String [ ] args ) throws IOException , InterruptedException { int port = Dispatcher . DEFAULT_PORT ; Event event ; CommHeader header ; long timeout = 15000 ; int clients = 0 ; Task . Type testType = Type . READ ; Task . Order order = Order . SEQUENTIAL ; Task . Distribution distribution = Distribution . UNIFORM ; String driver = "hypertable" ; String outputDir = null ; String testName = null ; boolean testTypeSet = false ; long keyCount = - 1 ; long submitExactly = - 1 ; long submitAtMost = - 1 ; long keysSubmitted = 0 ; long keyMax = - 1 ; int keySize = Dispatcher . DEFAULT_KEY_SIZE ; int valueSize = - 1 ; int scanBufferSize = 65536 ; boolean randomizeTasks = false ; String argString = "" ; <START_BUG> String valueData = "" ; <END_BUG> int parallel = 0 ; if ( ( ( args . length ) == 1 ) && ( args [ 0 ] . equals ( "--help" ) ) ) Usage . DumpAndExit ( Dispatcher . usage ) ; for ( int i = 0 ; i < ( args . length ) ; i ++ ) { if ( args [ i ] . startsWith ( "--port=" ) ) port = Integer . parseInt ( args [ i ] . substring ( 7 ) ) ; else if ( args [ i ] . startsWith ( "--clients=" ) ) clients = Integer . parseInt ( args [ i ] . substring ( 10 ) ) ; else if ( args [ i ] . startsWith ( "--driver=" ) ) driver = args [ i ] . substring ( 9 ) ; else if ( args [ i ] . startsWith ( "--parallel=" ) ) parallel = Integer . parseInt ( args [ i ] . substring ( 11 ) ) ; else if ( args [ i ] . startsWith ( "--key-max=" ) ) keyMax = Long . parseLong ( args [ i ] . substring ( 10 ) ) ; else if ( args [ i ] . startsWith ( "--key-size=" ) ) keySize = Integer . parseInt ( args [ i ] . substring ( 11 ) ) ; else if ( args [ i ] . startsWith ( "--submit-at-most=" ) ) submitAtMost = Long . parseLong ( args [ i ] . substring ( 17 ) ) ; else if ( args [ i ] . startsWith ( "--submit-exactly=" ) ) submitExactly = Long . parseLong ( args [ i ] . substring ( 17 ) ) ; else if ( args [ i ] . startsWith ( "--output-dir=" ) ) outputDir = args [ i ] . substring ( 13 ) ; else if ( args [ i ] . equals ( "--random" ) ) order = Order . RANDOM ; else if ( args [ i ] . equals ( "--randomize-tasks" ) ) randomizeTasks = true ; else if ( args [ i ] . equals ( "--timeout=" ) ) timeout = Long . parseLong ( args [ i ] . substring ( 10 ) ) ; else if ( args [ i ] . startsWith ( "--scan-buffer-size=" ) ) scanBufferSize = Integer . parseInt ( args [ i ] . substring ( 19 ) ) ; else if ( args [ i ] . startsWith ( "--test-name=" ) ) testName = args [ i ] . substring ( 12 ) ; else if ( args [ i ] . startsWith ( "--value-data=" ) ) valueData = args [ i ] . substring ( 13 ) ; else if ( args [ i ] . equals ( "--zipf" ) ) distribution = Distribution . ZIPFIAN ; else if ( testTypeSet == false ) { if ( args [ i ] . equals ( "read" ) ) testType = Type . READ ; else if ( args [ i ] . equals ( "write" ) ) testType = Type . WRITE ; else if ( args [ i ] . equals ( "scan" ) ) testType = Type . SCAN ; else if ( args [ i ] . equals ( "incr" ) ) testType = Type . INCR ; else Usage . DumpAndExit ( Dispatcher . usage ) ; testTypeSet = true ; } else if ( keyCount == ( - 1 ) ) { keyCount = Long . parseLong ( args [ i ] ) ; }

Fix:
String valueData = null ;