Buggy code:
private static final String ASSERTION_GUI = AssertionGui . class . getName ( ) ; private static final String LOGIC_CONTROLLER_GUI = LogicControllerGui . class . getName ( ) ; private static final String HEADER_PANEL = HeaderPanel . class . getName ( ) ; private transient Daemon server ; public static final int DEFAULT_PORT = 8080 ; public static final String DEFAULT_PORT_S = Integer . toString ( ProxyControl . DEFAULT_PORT ) ; private static final String PORT = "ProxyControlGui.port" ; private static final String EXCLUDE_LIST = "ProxyControlGui.exclude_list" ; private static final String INCLUDE_LIST = "ProxyControlGui.include_list" ; private static final String CAPTURE_HTTP_HEADERS = "ProxyControlGui.capture_http_headers" ; private static final String ADD_ASSERTIONS = "ProxyControlGui.add_assertion" ; private static final String GROUPING_MODE = "ProxyControlGui.grouping_mode" ; private static final String SAMPLER_TYPE_NAME = "ProxyControlGui.sampler_type_name" ; private static final String SAMPLER_REDIRECT_AUTOMATICALLY = "ProxyControlGui.sampler_redirect_automatically" ; private static final String SAMPLER_FOLLOW_REDIRECTS = "ProxyControlGui.sampler_follow_redirects" ; private static final String USE_KEEPALIVE = "ProxyControlGui.use_keepalive" ; private static final String SAMPLER_DOWNLOAD_IMAGES = "ProxyControlGui.sampler_download_images" ; private static final String REGEX_MATCH = "ProxyControlGui.regex_match" ; private static final String HTTPS_SPOOF = "ProxyControlGui.https_spoof" ; private static final String HTTPS_SPOOF_MATCH = "ProxyControlGui.https_spoof_match" ; private static final String CONTENT_TYPE_EXCLUDE = "ProxyControlGui.content_type_exclude" ; private static final String CONTENT_TYPE_INCLUDE = "ProxyControlGui.content_type_include" ; public static final int GROUPING_NO_GROUPS = 0 ; public static final int GROUPING_ADD_SEPARATORS = 1 ; public static final int GROUPING_IN_CONTROLLERS = 2 ; public static final int GROUPING_STORE_FIRST_ONLY = 3 ; public static final int SAMPLER_TYPE_HTTP_SAMPLER = 0 ; public static final int SAMPLER_TYPE_HTTP_SAMPLER2 = 1 ; private long lastTime = 0 ; private static final long sampleGap = JMeterUtils . getPropDefault ( "proxy.pause" , 1000 ) ; private boolean addAssertions ; private int groupingMode ; private boolean samplerRedirectAutomatically ; private boolean samplerFollowRedirects ; private boolean useKeepAlive ; private boolean samplerDownloadImages ; private boolean regexMatch = false ; private JMeterTreeNode target ; public ProxyControl ( ) { } public void setPort ( int port ) { } public void setPort ( String port ) { } public void setCaptureHttpHeaders ( boolean capture ) { } public void setGroupingMode ( int grouping ) { } public void setAssertions ( boolean b ) { } public void setSamplerTypeName ( int samplerTypeName ) { } public void setSamplerRedirectAutomatically ( boolean b ) { } public void setSamplerFollowRedirects ( boolean b ) { } public void setUseKeepAlive ( boolean b ) { } public void setSamplerDownloadImages ( boolean b ) { } public void setIncludeList ( Collection < String > list ) { } public void setExcludeList ( Collection < String > list ) { } public void setRegexMatch ( boolean b ) { } public void setHttpsSpoof ( boolean b ) { } public void setHttpsSpoofMatch ( String s ) { } public void setContentTypeExclude ( String contentTypeExclude ) { } public void setContentTypeInclude ( String contentTypeInclude ) { } public boolean getAssertions ( ) { } public int getGroupingMode ( ) { } public int getPort ( ) { } public String getPortString ( ) { } public int getDefaultPort ( ) { } public boolean getCaptureHttpHeaders ( ) { } public int getSamplerTypeName ( ) { } public boolean getSamplerRedirectAutomatically ( ) { } public boolean getSamplerFollowRedirects ( ) { } public boolean getUseKeepalive ( ) { } public boolean getSamplerDownloadImages ( ) { } public boolean getRegexMatch ( ) { } public boolean getHttpsSpoof ( ) { } public String getHttpsSpoofMatch ( ) { } public String getContentTypeExclude ( ) { } public String getContentTypeInclude ( ) { } public void addConfigElement ( ConfigElement config ) { } public void startProxy ( ) throws IOException { } public void addExcludedPattern ( String pattern ) { } public CollectionProperty getExcludePatterns ( ) { } public void addIncludedPattern ( String pattern ) { } public CollectionProperty getIncludePatterns ( ) { } public void clearExcludedPatterns ( ) { } public void clearIncludedPatterns ( ) { } public JMeterTreeNode getTarget ( ) { } public void setTarget ( JMeterTreeNode target ) { } public synchronized void deliverSampler ( HTTPSamplerBase sampler , TestElement [ ] subConfigs , SampleResult result ) { } public void stopProxy ( ) { } boolean filterUrl ( HTTPSamplerBase sampler ) { } boolean filterContentType ( SampleResult result ) { } private void addAssertion ( JMeterTreeModel model , JMeterTreeNode node ) throws IllegalUserActionException { } private void addDivider ( JMeterTreeModel model , JMeterTreeNode node ) throws IllegalUserActionException { } private void addSimpleController ( JMeterTreeModel model , JMeterTreeNode node , String name ) throws IllegalUserActionException { } private void addTimers ( JMeterTreeModel model , JMeterTreeNode node , long deltaT ) { } private JMeterTreeNode findFirstNodeOfType ( Class < ? > type ) { } private JMeterTreeNode findTargetControllerNode ( ) { } private Collection < ? > findApplicableElements ( JMeterTreeNode myTarget , Class < ? extends TestElement > myClass , boolean ascending ) { } private void placeSampler ( HTTPSamplerBase sampler , TestElement [ ] subConfigs , JMeterTreeNode myTarget ) { } private void removeValuesFromSampler ( HTTPSamplerBase sampler , Collection < ConfigTestElement > configurations ) { } private String generateMatchUrl ( HTTPSamplerBase sampler ) { <START_BUG> StringBuffer buf = new StringBuffer ( sampler . getDomain ( ) ) ; <END_BUG> buf . append ( ':' ) ; buf . append ( sampler . getPort ( ) ) ; buf . append ( sampler . getPath ( ) ) ; if ( ( sampler . getQueryString ( ) . length ( ) ) > 0 ) { buf . append ( '?' ) ; buf . append ( sampler . getQueryString ( ) ) ; } return buf . toString ( ) ; } private boolean matchesPatterns ( String url , CollectionProperty patterns ) { } private void replaceValues ( TestElement sampler , TestElement [ ] configs , Collection < Arguments > variables ) { } private void notifySampleListeners ( SampleEvent event ) { } private void notifyTestListenersOfStart ( ) { } private void notifyTestListenersOfEnd ( ) { } @ Override public boolean canRemove ( ) { } }

Fix:
StringBuilder buf = new StringBuilder ( sampler . getDomain ( ) ) ;