Buggy code:
public class HTTPSampler extends HTTPSamplerBase { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final int MAX_CONN_RETRIES = JMeterUtils . getPropDefault ( "http.java.sampler.retries" , 10 ) ; private static final byte [ ] NULL_BA = new byte [ 0 ] ; private transient PostWriter postWriter ; public HTTPSampler ( ) { } protected void setPostHeaders ( URLConnection conn ) throws IOException { } private void setPutHeaders ( URLConnection conn ) throws IOException { } protected String sendPostData ( URLConnection connection ) throws IOException { } private String sendPutData ( URLConnection connection ) throws IOException { } protected HttpURLConnection setupConnection ( URL u , String method , HTTPSampleResult res ) throws IOException { } protected byte [ ] readResponse ( HttpURLConnection conn , SampleResult res ) throws IOException { } protected String getResponseHeaders ( HttpURLConnection conn ) { } private String setConnectionCookie ( HttpURLConnection conn , URL u , CookieManager cookieManager ) { } private void setConnectionHeaders ( HttpURLConnection conn , URL u , HeaderManager headerManager ) { } private String getConnectionHeaders ( HttpURLConnection conn ) { } private void setConnectionAuthorization ( HttpURLConnection conn , URL u , AuthManager authManager ) { } protected HTTPSampleResult sample ( URL url , String method , boolean areFollowingRedirect , int frameDepth ) { HttpURLConnection conn = null ; String urlStr = url . toString ( ) ; HTTPSampler . log . debug ( ( "Start<seq2seq4repair_space>:<seq2seq4repair_space>sample<seq2seq4repair_space>" + urlStr ) ) ; HTTPSampleResult res = new HTTPSampleResult ( ) ; res . setMonitor ( isMonitor ( ) ) ; res . setSampleLabel ( urlStr ) ; res . sampleStart ( ) ; try { int retry ; for ( retry = 0 ; retry <= ( HTTPSampler . MAX_CONN_RETRIES ) ; retry ++ ) { try { conn = setupConnection ( url , method , res ) ; conn . connect ( ) ; break ; } catch ( BindException e ) { if ( retry >= ( HTTPSampler . MAX_CONN_RETRIES ) ) { <START_BUG> HTTPSampler . log . error ( "Can't<seq2seq4repair_space>connect" , e ) ; <END_BUG> throw e ; } HTTPSampler . log . debug ( "Bind<seq2seq4repair_space>exception,<seq2seq4repair_space>try<seq2seq4repair_space>again" ) ; if ( conn != null ) conn . disconnect ( ) ; this . setUseKeepAlive ( false ) ; continue ; } catch ( IOException e ) { HTTPSampler . log . debug ( "Connection<seq2seq4repair_space>failed,<seq2seq4repair_space>giving<seq2seq4repair_space>up" ) ; throw e ; } } if ( retry > ( HTTPSampler . MAX_CONN_RETRIES ) ) { throw new BindException ( ) ; } if ( method . equals ( POST ) ) { String postBody = sendPostData ( conn ) ; res . setQueryString ( postBody ) ; } else if ( method . equals ( PUT ) ) { String putBody = sendPutData ( conn ) ; res . setQueryString ( putBody ) ; } byte [ ] responseData = readResponse ( conn , res ) ; res . sampleEnd ( ) ; res . setResponseData ( responseData ) ; int errorLevel = conn . getResponseCode ( ) ; String respMsg = conn . getResponseMessage ( ) ; String hdr = conn . getHeaderField ( 0 ) ; if ( hdr == null ) hdr = "(null)" ; if ( errorLevel == ( - 1 ) ) { if ( respMsg != null ) { try { errorLevel = Integer . parseInt ( respMsg . substring ( 0 , 3 ) ) ; HTTPSampler . log . warn ( ( ( ( "ResponseCode==-1;<seq2seq4repair_space>parsed<seq2seq4repair_space>" + respMsg ) + "<seq2seq4repair_space>as<seq2seq4repair_space>" ) + errorLevel ) ) ; } catch ( NumberFormatException e ) { HTTPSampler . log . warn ( ( ( ( "ResponseCode==-1;<seq2seq4repair_space>could<seq2seq4repair_space>not<seq2seq4repair_space>parse<seq2seq4repair_space>" + respMsg ) + "<seq2seq4repair_space>hdr:<seq2seq4repair_space>" ) + hdr ) ) ; } } else { respMsg = hdr ; HTTPSampler . log . warn ( ( "ResponseCode==-1<seq2seq4repair_space>&<seq2seq4repair_space>null<seq2seq4repair_space>ResponseMessage.<seq2seq4repair_space>Header(0)=<seq2seq4repair_space>" + hdr ) ) ; } } if ( errorLevel == ( - 1 ) ) { res . setResponseCode ( "(null)" ) ; } else { res . setResponseCode ( Integer . toString ( errorLevel ) ) ; } res . setSuccessful ( isSuccessCode ( errorLevel ) ) ; if ( respMsg == null ) { respMsg = hdr ; } res . setResponseMessage ( respMsg ) ; String ct = conn . getContentType ( ) ; if ( ct != null ) { res . setContentType ( ct ) ; res . setEncodingAndType ( ct ) ; } res . setResponseHeaders ( getResponseHeaders ( conn ) ) ; if ( res . isRedirect ( ) ) { res . setRedirectLocation ( conn . getHeaderField ( HEADER_LOCATION ) ) ; } if ( getAutoRedirects ( ) ) { res . setURL ( conn . getURL ( ) ) ; } saveConnectionCookies ( conn , url , getCookieManager ( ) ) ; res = resultProcessing ( areFollowingRedirect , frameDepth , res ) ; HTTPSampler . log . debug ( "End<seq2seq4repair_space>:<seq2seq4repair_space>sample" ) ; return res ; } catch ( IOException e ) { res . sampleEnd ( ) ; if ( conn != null ) { conn . disconnect ( ) ; } conn = null ; return errorResult ( e , res ) ; } finally { disconnect ( conn ) ; } } protected void disconnect ( HttpURLConnection conn ) { } private void saveConnectionCookies ( HttpURLConnection conn , URL u , CookieManager cookieManager ) { } }

Fix:
HTTPSampler . log . error ( ( ( ( "Can't<seq2seq4repair_space>connect<seq2seq4repair_space>after<seq2seq4repair_space>" + retry ) + "<seq2seq4repair_space>retries,<seq2seq4repair_space>" ) + e ) ) ;