Buggy code:
public class JMeter implements JMeterPlugin { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; public static final int UDP_PORT_DEFAULT = 4445 ; public static final String HTTP_PROXY_PASS = "http.proxyPass" ; public static final String HTTP_PROXY_USER = "http.proxyUser" ; public static final String JMETER_NON_GUI = "JMeter.NonGui" ; private static final String USE_LAST_JMX = "LAST" ; private static final int PROXY_PASSWORD = 'a' ; private static final int JMETER_HOME_OPT = 'd' ; private static final int HELP_OPT = 'h' ; private static final int JMLOGFILE_OPT = 'j' ; private static final int LOGFILE_OPT = 'l' ; private static final int NONGUI_OPT = 'n' ; private static final int PROPFILE_OPT = 'p' ; private static final int PROPFILE2_OPT = 'q' ; private static final int REMOTE_OPT = 'r' ; private static final int SERVER_OPT = 's' ; private static final int TESTFILE_OPT = 't' ; private static final int PROXY_USERNAME = 'u' ; private static final int VERSION_OPT = 'v' ; private static final int SYSTEM_PROPERTY = 'D' ; private static final int JMETER_GLOBAL_PROP = 'G' ; private static final int PROXY_HOST = 'H' ; private static final int JMETER_PROPERTY = 'J' ; private static final int LOGLEVEL = 'L' ; private static final int NONPROXY_HOSTS = 'N' ; private static final int PROXY_PORT = 'P' ; private static final int REMOTE_OPT_PARAM = 'R' ; private static final int SYSTEM_PROPFILE = 'S' ; private static final int REMOTE_STOP = 'X' ; private static final CLOptionDescriptor [ ] options = new CLOptionDescriptor [ ] { new CLOptionDescriptor ( "help" , CLOptionDescriptor . ARGUMENT_DISALLOWED , JMeter . HELP_OPT , "print<seq2seq4repair_space>usage<seq2seq4repair_space>information<seq2seq4repair_space>and<seq2seq4repair_space>exit" ) , new CLOptionDescriptor ( "version" , CLOptionDescriptor . ARGUMENT_DISALLOWED , JMeter . VERSION_OPT , "print<seq2seq4repair_space>the<seq2seq4repair_space>version<seq2seq4repair_space>information<seq2seq4repair_space>and<seq2seq4repair_space>exit" ) , new CLOptionDescriptor ( "propfile" , CLOptionDescriptor . ARGUMENT_REQUIRED , JMeter . PROPFILE_OPT , "the<seq2seq4repair_space>jmeter<seq2seq4repair_space>property<seq2seq4repair_space>file<seq2seq4repair_space>to<seq2seq4repair_space>use" ) , new CLOptionDescriptor ( "addprop" , ( ( CLOptionDescriptor . ARGUMENT_REQUIRED ) | ( CLOptionDescriptor . DUPLICATES_ALLOWED ) ) , JMeter . PROPFILE2_OPT , "additional<seq2seq4repair_space>JMeter<seq2seq4repair_space>property<seq2seq4repair_space>file(s)" ) , new CLOptionDescriptor ( "testfile" , CLOptionDescriptor . ARGUMENT_REQUIRED , JMeter . TESTFILE_OPT , "the<seq2seq4repair_space>jmeter<seq2seq4repair_space>test(.jmx)<seq2seq4repair_space>file<seq2seq4repair_space>to<seq2seq4repair_space>run" ) , new CLOptionDescriptor ( "logfile" , CLOptionDescriptor . ARGUMENT_REQUIRED , JMeter . LOGFILE_OPT , "the<seq2seq4repair_space>file<seq2seq4repair_space>to<seq2seq4repair_space>log<seq2seq4repair_space>samples<seq2seq4repair_space>to" ) , new CLOptionDescriptor ( "jmeterlogfile" , CLOptionDescriptor . ARGUMENT_REQUIRED , JMeter . JMLOGFILE_OPT , "jmeter<seq2seq4repair_space>run<seq2seq4repair_space>log<seq2seq4repair_space>file<seq2seq4repair_space>(jmeter.log)" ) , new CLOptionDescriptor ( "nongui" , CLOptionDescriptor . ARGUMENT_DISALLOWED , JMeter . NONGUI_OPT , "run<seq2seq4repair_space>JMeter<seq2seq4repair_space>in<seq2seq4repair_space>nongui<seq2seq4repair_space>mode" ) , new CLOptionDescriptor ( "server" , CLOptionDescriptor . ARGUMENT_DISALLOWED , JMeter . SERVER_OPT , "run<seq2seq4repair_space>the<seq2seq4repair_space>JMeter<seq2seq4repair_space>server" ) , new CLOptionDescriptor ( "proxyHost" , CLOptionDescriptor . ARGUMENT_REQUIRED , JMeter . PROXY_HOST , "Set<seq2seq4repair_space>a<seq2seq4repair_space>proxy<seq2seq4repair_space>server<seq2seq4repair_space>for<seq2seq4repair_space>JMeter<seq2seq4repair_space>to<seq2seq4repair_space>use" ) , new CLOptionDescriptor ( "proxyPort" , CLOptionDescriptor . ARGUMENT_REQUIRED , JMeter . PROXY_PORT , "Set<seq2seq4repair_space>proxy<seq2seq4repair_space>server<seq2seq4repair_space>port<seq2seq4repair_space>for<seq2seq4repair_space>JMeter<seq2seq4repair_space>to<seq2seq4repair_space>use" ) , new CLOptionDescriptor ( "nonProxyHosts" , CLOptionDescriptor . ARGUMENT_REQUIRED , JMeter . NONPROXY_HOSTS , "Set<seq2seq4repair_space>nonproxy<seq2seq4repair_space>host<seq2seq4repair_space>list<seq2seq4repair_space>(e.g.<seq2seq4repair_space>*.apache.org|localhost)" ) , new CLOptionDescriptor ( "username" , CLOptionDescriptor . ARGUMENT_REQUIRED , JMeter . PROXY_USERNAME , "Set<seq2seq4repair_space>username<seq2seq4repair_space>for<seq2seq4repair_space>proxy<seq2seq4repair_space>server<seq2seq4repair_space>that<seq2seq4repair_space>JMeter<seq2seq4repair_space>is<seq2seq4repair_space>to<seq2seq4repair_space>use" ) , new CLOptionDescriptor ( "password" , CLOptionDescriptor . ARGUMENT_REQUIRED , JMeter . PROXY_PASSWORD , "Set<seq2seq4repair_space>password<seq2seq4repair_space>for<seq2seq4repair_space>proxy<seq2seq4repair_space>server<seq2seq4repair_space>that<seq2seq4repair_space>JMeter<seq2seq4repair_space>is<seq2seq4repair_space>to<seq2seq4repair_space>use" ) , new CLOptionDescriptor ( "jmeterproperty" , ( ( CLOptionDescriptor . DUPLICATES_ALLOWED ) | ( CLOptionDescriptor . ARGUMENTS_REQUIRED_2 ) ) , JMeter . JMETER_PROPERTY , "Define<seq2seq4repair_space>additional<seq2seq4repair_space>JMeter<seq2seq4repair_space>properties" ) , new CLOptionDescriptor ( "globalproperty" , ( ( CLOptionDescriptor . DUPLICATES_ALLOWED ) | ( CLOptionDescriptor . ARGUMENTS_REQUIRED_2 ) ) , JMeter . JMETER_GLOBAL_PROP , "Define<seq2seq4repair_space>Global<seq2seq4repair_space>properties<seq2seq4repair_space>(sent<seq2seq4repair_space>to<seq2seq4repair_space>servers)\n\t\te.g.<seq2seq4repair_space>-Gport=123<seq2seq4repair_space>or<seq2seq4repair_space>-Gglobal.properties" ) , new CLOptionDescriptor ( "systemproperty" , ( ( CLOptionDescriptor . DUPLICATES_ALLOWED ) | ( CLOptionDescriptor . ARGUMENTS_REQUIRED_2 ) ) , JMeter . SYSTEM_PROPERTY , "Define<seq2seq4repair_space>additional<seq2seq4repair_space>system<seq2seq4repair_space>properties" ) , new CLOptionDescriptor ( "systemPropertyFile" , ( ( CLOptionDescriptor . DUPLICATES_ALLOWED ) | ( CLOptionDescriptor . ARGUMENT_REQUIRED ) ) , JMeter . SYSTEM_PROPFILE , "additional<seq2seq4repair_space>system<seq2seq4repair_space>property<seq2seq4repair_space>file(s)" ) , new CLOptionDescriptor ( "loglevel" , ( ( CLOptionDescriptor . DUPLICATES_ALLOWED ) | ( CLOptionDescriptor . ARGUMENTS_REQUIRED_2 ) ) , JMeter . LOGLEVEL , "[category=]level<seq2seq4repair_space>e.g.<seq2seq4repair_space>jorphan=INFO<seq2seq4repair_space>or<seq2seq4repair_space>jmeter.util=DEBUG" ) , new CLOptionDescriptor ( "runremote" , CLOptionDescriptor . ARGUMENT_DISALLOWED , JMeter . REMOTE_OPT , "Start<seq2seq4repair_space>remote<seq2seq4repair_space>servers<seq2seq4repair_space>(as<seq2seq4repair_space>defined<seq2seq4repair_space>in<seq2seq4repair_space>remote_hosts)" ) , new CLOptionDescriptor ( "remotestart" , CLOptionDescriptor . ARGUMENT_REQUIRED , JMeter . REMOTE_OPT_PARAM , "Start<seq2seq4repair_space>these<seq2seq4repair_space>remote<seq2seq4repair_space>servers<seq2seq4repair_space>(overrides<seq2seq4repair_space>remote_hosts)" ) , new CLOptionDescriptor ( "homedir" , CLOptionDescriptor . ARGUMENT_REQUIRED , JMeter . JMETER_HOME_OPT , "the<seq2seq4repair_space>jmeter<seq2seq4repair_space>home<seq2seq4repair_space>directory<seq2seq4repair_space>to<seq2seq4repair_space>use" ) , new CLOptionDescriptor ( "remoteexit" , CLOptionDescriptor . ARGUMENT_DISALLOWED , JMeter . REMOTE_STOP , "Exit<seq2seq4repair_space>the<seq2seq4repair_space>remote<seq2seq4repair_space>servers<seq2seq4repair_space>at<seq2seq4repair_space>end<seq2seq4repair_space>of<seq2seq4repair_space>test<seq2seq4repair_space>(non-GUI)" ) } ; public JMeter ( ) { } private JMeter parent ; private Properties remoteProps ; private boolean remoteStop ; private void startGui ( String testFile ) { PluginManager . install ( this , true ) ; JMeterTreeModel treeModel = new JMeterTreeModel ( ) ; JMeterTreeListener treeLis = new JMeterTreeListener ( treeModel ) ; treeLis . setActionHandler ( ActionRouter . getInstance ( ) ) ; GuiPackage . getInstance ( treeLis , treeModel ) ; <START_BUG> MainFrame main = new MainFrame ( ActionRouter . getInstance ( ) , treeModel , treeLis ) ; <END_BUG> ComponentUtil . centerComponentInWindow ( main , 80 ) ; main . setVisible ( true ) ; ActionRouter . getInstance ( ) . actionPerformed ( new ActionEvent ( main , 1 , ActionNames . ADD_ALL ) ) ; if ( testFile != null ) { FileInputStream reader = null ; try { File f = new File ( testFile ) ; JMeter . log . info ( ( "Loading<seq2seq4repair_space>file:<seq2seq4repair_space>" + f ) ) ; FileServer . getFileServer ( ) . setBaseForScript ( f ) ; reader = new FileInputStream ( f ) ; HashTree tree = SaveService . loadTree ( reader ) ; GuiPackage . getInstance ( ) . setTestPlanFile ( f . getAbsolutePath ( ) ) ; Load . insertLoadedTree ( 1 , tree ) ; } catch ( ConversionException e ) { JMeter . log . error ( "Failure<seq2seq4repair_space>loading<seq2seq4repair_space>test<seq2seq4repair_space>file" , e ) ; JMeterUtils . reportErrorToUser ( SaveService . CEtoString ( e ) ) ; } catch ( Exception e ) { JMeter . log . error ( "Failure<seq2seq4repair_space>loading<seq2seq4repair_space>test<seq2seq4repair_space>file" , e ) ; JMeterUtils . reportErrorToUser ( e . toString ( ) ) ; } finally { JOrphanUtils . closeQuietly ( reader ) ; } } else { JTree jTree = GuiPackage . getInstance ( ) . getMainFrame ( ) . getTree ( ) ;

Fix:
MainFrame main = new MainFrame ( treeModel , treeLis ) ;