Buggy code:
@ InterfaceAudience . LimitedPrivate ( HBaseInterfaceAudience . TOOLS ) public class ThriftServer { private static final Log LOG = LogFactory . getLog ( ThriftServer . class ) ; private static final String MIN_WORKERS_OPTION = "minWorkers" ; private static final String MAX_WORKERS_OPTION = "workers" ; private static final String MAX_QUEUE_SIZE_OPTION = "queue" ; private static final String KEEP_ALIVE_SEC_OPTION = "keepAliveSec" ; static final String BIND_OPTION = "bind" ; static final String COMPACT_OPTION = "compact" ; static final String FRAMED_OPTION = "framed" ; static final String PORT_OPTION = "port" ; private static final String DEFAULT_BIND_ADDR = "0.0.0.0" ; private static final int DEFAULT_LISTEN_PORT = 9090 ; private Configuration conf ; ThriftServerRunner serverRunner ; private InfoServer infoServer ; public ThriftServer ( Configuration conf ) { } private static void printUsageAndExit ( Options options , int exitCode ) throws ExitCodeException { } void doMain ( final String [ ] args ) throws Exception { } private void processOptions ( final String [ ] args ) throws Exception { Options options = new Options ( ) ; options . addOption ( "b" , ThriftServer . BIND_OPTION , true , ( ( ( "Address<seq2seq4repair_space>to<seq2seq4repair_space>bind<seq2seq4repair_space>" + "the<seq2seq4repair_space>Thrift<seq2seq4repair_space>server<seq2seq4repair_space>to.<seq2seq4repair_space>[default:<seq2seq4repair_space>" ) + ( ThriftServer . DEFAULT_BIND_ADDR ) ) + "]" ) ) ; options . addOption ( "p" , ThriftServer . PORT_OPTION , true , ( ( "Port<seq2seq4repair_space>to<seq2seq4repair_space>bind<seq2seq4repair_space>to<seq2seq4repair_space>[default:<seq2seq4repair_space>" + ( ThriftServer . DEFAULT_LISTEN_PORT ) ) + "]" ) ) ; options . addOption ( "f" , ThriftServer . FRAMED_OPTION , false , "Use<seq2seq4repair_space>framed<seq2seq4repair_space>transport" ) ; options . addOption ( "c" , ThriftServer . COMPACT_OPTION , false , "Use<seq2seq4repair_space>the<seq2seq4repair_space>compact<seq2seq4repair_space>protocol" ) ; options . addOption ( "h" , "help" , false , "Print<seq2seq4repair_space>help<seq2seq4repair_space>information" ) ; options . addOption ( null , "infoport" , true , "Port<seq2seq4repair_space>for<seq2seq4repair_space>web<seq2seq4repair_space>UI" ) ; options . addOption ( "m" , ThriftServer . MIN_WORKERS_OPTION , true , ( "The<seq2seq4repair_space>minimum<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>worker<seq2seq4repair_space>threads<seq2seq4repair_space>for<seq2seq4repair_space>" + ( THREAD_POOL . simpleClassName ( ) ) ) ) ; options . addOption ( "w" , ThriftServer . MAX_WORKERS_OPTION , true , ( "The<seq2seq4repair_space>maximum<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>worker<seq2seq4repair_space>threads<seq2seq4repair_space>for<seq2seq4repair_space>" + ( THREAD_POOL . simpleClassName ( ) ) ) ) ; options . addOption ( "q" , ThriftServer . MAX_QUEUE_SIZE_OPTION , true , ( "The<seq2seq4repair_space>maximum<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>queued<seq2seq4repair_space>requests<seq2seq4repair_space>in<seq2seq4repair_space>" + ( THREAD_POOL . simpleClassName ( ) ) ) ) ; options . addOption ( "k" , ThriftServer . KEEP_ALIVE_SEC_OPTION , true , ( "The<seq2seq4repair_space>amount<seq2seq4repair_space>of<seq2seq4repair_space>time<seq2seq4repair_space>in<seq2seq4repair_space>secods<seq2seq4repair_space>to<seq2seq4repair_space>keep<seq2seq4repair_space>a<seq2seq4repair_space>thread<seq2seq4repair_space>alive<seq2seq4repair_space>when<seq2seq4repair_space>idle<seq2seq4repair_space>in<seq2seq4repair_space>" + ( THREAD_POOL . simpleClassName ( ) ) ) ) ; options . addOptionGroup ( ImplType . createOptionGroup ( ) ) ; CommandLineParser parser = new PosixParser ( ) ; CommandLine cmd = parser . parse ( options , args ) ; List < String > commandLine = Arrays . asList ( args ) ; boolean stop = commandLine . contains ( "stop" ) ; boolean start = commandLine . contains ( "start" ) ; boolean invalidStartStop = ( start && stop ) || ( ( ! start ) && ( ! stop ) ) ; if ( ( cmd . hasOption ( "help" ) ) || invalidStartStop ) { if ( invalidStartStop ) { ThriftServer . LOG . error ( "Exactly<seq2seq4repair_space>one<seq2seq4repair_space>of<seq2seq4repair_space>'start'<seq2seq4repair_space>and<seq2seq4repair_space>'stop'<seq2seq4repair_space>has<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>specified" ) ; } ThriftServer . printUsageAndExit ( options , 1 ) ; } try { if ( cmd . hasOption ( ThriftServer . PORT_OPTION ) ) { int listenPort = Integer . parseInt ( cmd . getOptionValue ( ThriftServer . PORT_OPTION ) ) ; conf . setInt ( PORT_CONF_KEY , listenPort ) ; } } catch ( NumberFormatException e ) { ThriftServer . LOG . error ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>parse<seq2seq4repair_space>the<seq2seq4repair_space>value<seq2seq4repair_space>provided<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>port<seq2seq4repair_space>option" , e ) ; ThriftServer . printUsageAndExit ( options , ( - 1 ) ) ; } try { if ( cmd . hasOption ( "infoport" ) ) { String val = cmd . getOptionValue ( "infoport" ) ; <START_BUG> conf . setInt ( "hbase.thrift.info.port" , Integer . valueOf ( val ) ) ; <END_BUG> ThriftServer . LOG . debug ( ( "Web<seq2seq4repair_space>UI<seq2seq4repair_space>port<seq2seq4repair_space>set<seq2seq4repair_space>to<seq2seq4repair_space>" + val ) ) ; } } catch ( NumberFormatException e ) { ThriftServer . LOG . error ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>parse<seq2seq4repair_space>the<seq2seq4repair_space>value<seq2seq4repair_space>provided<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>infoport<seq2seq4repair_space>option" , e ) ; ThriftServer . printUsageAndExit ( options , ( - 1 ) ) ; } ThriftServer . optionToConf ( cmd , ThriftServer . MIN_WORKERS_OPTION , conf , MIN_WORKER_THREADS_CONF_KEY ) ; ThriftServer . optionToConf ( cmd , ThriftServer . MAX_WORKERS_OPTION , conf , MAX_WORKER_THREADS_CONF_KEY ) ; ThriftServer . optionToConf ( cmd , ThriftServer . MAX_QUEUE_SIZE_OPTION , conf , MAX_QUEUED_REQUESTS_CONF_KEY ) ; ThriftServer . optionToConf ( cmd , ThriftServer . KEEP_ALIVE_SEC_OPTION , conf , THREAD_KEEP_ALIVE_TIME_SEC_CONF_KEY ) ; boolean compact = ( cmd . hasOption ( ThriftServer . COMPACT_OPTION ) ) || ( conf . getBoolean ( COMPACT_CONF_KEY , false ) ) ; conf . setBoolean ( COMPACT_CONF_KEY , compact ) ; boolean framed = ( cmd . hasOption ( ThriftServer . FRAMED_OPTION ) ) || ( conf . getBoolean ( FRAMED_CONF_KEY , false ) ) ; conf . setBoolean ( FRAMED_CONF_KEY , framed ) ; if ( cmd . hasOption ( ThriftServer . BIND_OPTION ) ) { conf . set ( BIND_CONF_KEY , cmd . getOptionValue ( ThriftServer . BIND_OPTION ) ) ; } ImplType . setServerImpl ( cmd , conf ) ; } public void stop ( ) { } private static void optionToConf ( CommandLine cmd , String option , Configuration conf , String destConfKey ) { } public static void main ( String [ ] args ) throws Exception { } }

Fix:
conf . setInt ( "hbase.thrift.info.port" , Integer . parseInt ( val ) ) ;