Buggy code:
public class HTTPHC4Impl extends HTTPHCAbstractImpl { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final int RETRY_COUNT = JMeterUtils . getPropDefault ( "httpclient4.retrycount" , 0 ) ; private static final String CONTEXT_METRICS = "jmeter_metrics" ; private static final HttpResponseInterceptor METRICS_SAVER = new HttpResponseInterceptor ( ) { public void process ( HttpResponse response , HttpContext context ) throws IOException , HttpException { } } ; private static final ThreadLocal < Map < HTTPHC4Impl . HttpClientKey , HttpClient > > HTTPCLIENTS = new ThreadLocal < Map < HTTPHC4Impl . HttpClientKey , HttpClient > > ( ) { @ Override protected Map < HTTPHC4Impl . HttpClientKey , HttpClient > initialValue ( ) { } } ; private static final Scheme SLOW_HTTP ; private static final Scheme HTTPS_SCHEME ; private static final HttpParams DEFAULT_HTTP_PARAMS ; private volatile HttpUriRequest currentRequest ; protected HTTPHC4Impl ( HTTPSamplerBase testElement ) { } @ Override protected HTTPSampleResult sample ( URL url , String method , boolean areFollowingRedirect , int frameDepth ) { } private static final class HttpClientKey { private final URL url ; private final boolean hasProxy ; private final String proxyHost ; private final int proxyPort ; private final String proxyUser ; private final String proxyPass ; private final int hashCode ; public HttpClientKey ( URL url , boolean b , String proxyHost , int proxyPort , String proxyUser , String proxyPass ) { } private int getHash ( ) { } private int getHash ( String s ) { } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } } private HttpClient setupClient ( URL url ) { } private void setupRequest ( URL url , HttpRequestBase httpRequest , HTTPSampleResult res ) throws IOException { } protected void setDefaultRequestHeaders ( HttpRequest request ) { } private String getResponseHeaders ( HttpResponse response ) { } private String setConnectionCookie ( HttpRequest request , URL url , CookieManager cookieManager ) { } private void setConnectionHeaders ( HttpRequestBase request , URL url , HeaderManager headerManager , CacheManager cacheManager ) { if ( headerManager != null ) { CollectionProperty headers = headerManager . getHeaders ( ) ; if ( headers != null ) { PropertyIterator i = headers . iterator ( ) ; while ( i . hasNext ( ) ) { Header header = ( ( Header ) ( i . next ( ) . getObjectValue ( ) ) ) ; String n = header . getName ( ) ; if ( ! ( HEADER_CONTENT_LENGTH . equalsIgnoreCase ( n ) ) ) { String v = header . getValue ( ) ; if ( HEADER_HOST . equalsIgnoreCase ( n ) ) { int port = url . getPort ( ) ; <START_BUG> v = removePortInHostHeader ( v , port ) ; <END_BUG> if ( port != ( - 1 ) ) { if ( port == ( url . getDefaultPort ( ) ) ) { port = - 1 ; } } request . getParams ( ) . setParameter ( VIRTUAL_HOST , new HttpHost ( v , port ) ) ; } else { request . addHeader ( n , v ) ; } } } } } if ( cacheManager != null ) { cacheManager . setHeaders ( url , request ) ; } } private String getConnectionHeaders ( HttpRequest method ) { } private void setConnectionAuthorization ( HttpClient client , URL url , AuthManager authManager ) { } private static class ViewableFileBody extends FileBody { private boolean hideFileData ; public ViewableFileBody ( File file , String mimeType ) { } @ Override public void writeTo ( final OutputStream out ) throws IOException { } } private String sendPostData ( HttpPost post ) throws IOException { } private String sendPutData ( HttpPut put ) throws IOException { } private void saveConnectionCookies ( HttpResponse method , URL u , CookieManager cookieManager ) { } @ Override public void threadFinished ( ) { } public boolean interrupt ( ) { } }

Fix:
v = v . replaceFirst ( ":\\d+$" , "" ) ;