Buggy code:
public class HTTPSampler2 extends HTTPSamplerBase { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final String HTTP_AUTHENTICATION_PREEMPTIVE = "http.authentication.preemptive" ; private static final boolean canSetPreEmptive ; static final String PROXY_HOST = System . getProperty ( "http.proxyHost" , "" ) ; private static final String NONPROXY_HOSTS = System . getProperty ( "http.nonProxyHosts" , "" ) ; static final int PROXY_PORT = Integer . parseInt ( System . getProperty ( "http.proxyPort" , "0" ) ) ; private static final boolean PROXY_DEFINED = ( ( HTTPSampler2 . PROXY_HOST . length ( ) ) > 0 ) && ( ( HTTPSampler2 . PROXY_PORT ) > 0 ) ; static final String PROXY_USER = JMeterUtils . getPropDefault ( HTTP_PROXY_USER , "" ) ; static final String PROXY_PASS = JMeterUtils . getPropDefault ( HTTP_PROXY_PASS , "" ) ; private static final String PROXY_DOMAIN = JMeterUtils . getPropDefault ( "http.proxyDomain" , "" ) ; static final InetAddress localAddress ; private static final String localHost ; static final ThreadLocal httpClients = new ThreadLocal ( ) ; private static final Set nonProxyHostFull = new HashSet ( ) ; private static final List nonProxyHostSuffix = new ArrayList ( ) ; private static final int nonProxyHostSuffixSize ; private static boolean isNonProxy ( String host ) { } private static boolean isPartialMatch ( String host ) { } public HTTPSampler2 ( ) { } private String sendPostData ( PostMethod post ) throws IOException { } protected HttpClient setupConnection ( URL u , HttpMethodBase httpMethod , HTTPSampleResult res ) throws IOException { } protected void setDefaultRequestHeaders ( HttpMethod httpMethod ) { } protected String getResponseHeaders ( HttpMethod method ) { } private String setConnectionCookie ( HttpMethod method , URL u , CookieManager cookieManager ) { } private void setConnectionHeaders ( HttpMethod method , URL u , HeaderManager headerManager ) { } private String getConnectionHeaders ( HttpMethod method ) { } private void setConnectionAuthorization ( HttpClient client , URL u , AuthManager authManager ) { } protected HTTPSampleResult sample ( URL url , String method , boolean areFollowingRedirect , int frameDepth ) { } private String sendPutData ( PutMethod put ) throws IOException { } private static class ViewableFilePart extends FilePart { private boolean hideFileData ; public ViewableFilePart ( String name , File file , String contentType , String charset ) throws FileNotFoundException { } public void setHideFileData ( boolean hideFileData ) { } protected void sendData ( OutputStream out ) throws IOException { } } protected void saveConnectionCookies ( HttpMethod method , URL u , CookieManager cookieManager ) { } public void threadStarted ( ) { } public void threadFinished ( ) { HTTPSampler2 . log . debug ( "Thread<seq2seq4repair_space>Finished" ) ; Map map = ( ( Map ) ( HTTPSampler2 . httpClients . get ( ) ) ) ; if ( map != null ) { for ( Iterator it = map . entrySet ( ) . iterator ( ) ; it . hasNext ( ) ; ) { Map . Entry entry = ( ( Map . Entry ) ( it . next ( ) ) ) ; HttpClient cl = ( ( HttpClient ) ( entry . getValue ( ) ) ) ; <START_BUG> cl . getHttpConnectionManager ( ) . closeIdleConnections ( ( - 1000 ) ) ; <END_BUG> } map . clear ( ) ; } } }

Fix:
( ( org . apache . commons . httpclient . SimpleHttpConnectionManager ) ( cl . getHttpConnectionManager ( ) ) ) . shutdown ( ) ;