Buggy code:
public static final String CONTENT_TYPE = "HTTPSampler.CONTENT_TYPE" ; public static final String NORMAL_FORM = "normal_form" ; public static final String MULTIPART_FORM = "multipart_form" ; public static final String ENCODED_PATH = "HTTPSampler.encoded_path" ; public static final String IMAGE_PARSER = "HTTPSampler.image_parser" ; public static final int UNSPECIFIED_PORT = 0 ; private static final int MAX_REDIRECTS = 10 ; protected static String encoding = "iso-8859-1" ; private static final PostWriter postWriter = new PostWriter ( ) ; protected transient HttpURLConnection conn ; private HTTPSamplerFull imageSampler ; private static PatternCacheLRU patternCache = new PatternCacheLRU ( 1000 , new Perl5Compiler ( ) ) ; private static ThreadLocal localMatcher = new ThreadLocal ( ) { protected synchronized Object initialValue ( ) { } } ; private static Substitution spaceSub = new StringSubstitution ( "%20" ) ; private int connectionTries = 0 ; public void setFileField ( String value ) { } public String getFileField ( ) { } public void setFilename ( String value ) { } public String getFilename ( ) { } public void setProtocol ( String value ) { } public String getProtocol ( ) { } public void setPath ( String path ) { } public void setEncodedPath ( String path ) { } private String encodePath ( String path ) { } public String getEncodedPath ( ) { } public void setProperty ( JMeterProperty prop ) { } public void addProperty ( JMeterProperty prop ) { } public String getPath ( ) { } public void setFollowRedirects ( boolean value ) { } public boolean getFollowRedirects ( ) { } public void setMethod ( String value ) { } public String getMethod ( ) { } public void setUseKeepAlive ( boolean value ) { } public boolean getUseKeepAlive ( ) { } public void addEncodedArgument ( String name , String value , String metaData ) { } public void addArgument ( String name , String value ) { } public void addTestElement ( TestElement el ) { } public void addArgument ( String name , String value , String metadata ) { } public void setPort ( int value ) { } public int getPort ( ) { } public void setDomain ( String value ) { } public String getDomain ( ) { } public void setArguments ( Arguments value ) { } public Arguments getArguments ( ) { } public void setAuthManager ( AuthManager value ) { } public AuthManager getAuthManager ( ) { } public void setHeaderManager ( HeaderManager value ) { } public HeaderManager getHeaderManager ( ) { } public void setCookieManager ( CookieManager value ) { } public CookieManager getCookieManager ( ) { } public void setMimetype ( String value ) { } public String getMimetype ( ) { } public boolean isImageParser ( ) { } public void setImageParser ( boolean parseImages ) { } protected static final String NON_HTTP_RESPONSE_CODE = "Non<seq2seq4repair_space>HTTP<seq2seq4repair_space>response<seq2seq4repair_space>code" ; protected static final String NON_HTTP_RESPONSE_MESSAGE = "Non<seq2seq4repair_space>HTTP<seq2seq4repair_space>response<seq2seq4repair_space>message" ; private static transient Logger log = Hierarchy . getDefaultHierarchy ( ) . getLoggerFor ( "jmeter.protocol.http" ) ; private ArrayList m_sampledURLs = new ArrayList ( ) ; public HTTPSampler ( ) { } public HTTPSampler ( java . net . URL u ) { } public SampleResult sample ( Entry e ) { } public SampleResult sample ( ) { } public java . net . URL getUrl ( ) throws MalformedURLException { } public String getQueryString ( ) { } public void setPostHeaders ( URLConnection conn ) throws IOException { } public void sendPostData ( URLConnection connection ) throws IOException { } protected HttpURLConnection setupConnection ( java . net . URL u , String method ) throws IOException { } public void parseArguments ( String queryString ) { } protected byte [ ] readResponse ( HttpURLConnection conn ) throws IOException { } protected byte [ ] getResponseHeaders ( HttpURLConnection conn , SampleResult res ) throws IOException { } private void setConnectionCookie ( HttpURLConnection conn , java . net . URL u , CookieManager cookieManager ) { } private void setConnectionHeaders ( HttpURLConnection conn , java . net . URL u , HeaderManager headerManager ) { } private void setConnectionAuthorization ( HttpURLConnection conn , java . net . URL u , AuthManager authManager ) { } private int getErrorLevel ( HttpURLConnection conn , SampleResult res , long time ) throws IOException { int errorLevel = 200 ; String message = null ; errorLevel = ( ( HttpURLConnection ) ( conn ) ) . getResponseCode ( ) ; message = ( ( HttpURLConnection ) ( conn ) ) . getResponseMessage ( ) ; <START_BUG> res . setResponseCode ( String . valueOf ( errorLevel ) ) ; <END_BUG> res . setResponseMessage ( message ) ; return errorLevel ; } public void removeArguments ( ) { } private void redirectUrl ( HttpURLConnection conn , java . net . URL u ) throws MalformedURLException { } protected long connect ( ) throws IOException { } private SampleResult sample ( int redirects ) { } protected void disconnect ( HttpURLConnection conn ) { } private long bundleResponseInResult ( long time , SampleResult res , HttpURLConnection conn ) throws FileNotFoundException , IOException { } private void saveConnectionCookies ( HttpURLConnection conn , java . net . URL u , CookieManager cookieManager ) { } public String toString ( ) { } public static class Test extends TestCase { public Test ( String name ) { } public void testArgumentWithoutEquals ( ) throws Exception { } public void testMakingUrl ( ) throws Exception { } public void testMakingUrl2 ( ) throws Exception { } public void testMakingUrl3 ( ) throws Exception { } public void testMakingUrl4 ( ) throws Exception { } public void testMakingUrl5 ( ) throws Exception { } public void testMakingUrl6 ( ) throws Exception { } public void testMakingUrl7 ( ) throws Exception { } public void testMakingUrl8 ( ) throws Exception { } public void testMakingUrl9 ( ) throws Exception { } public void testMakingUrl10 ( ) throws Exception { } } }

Fix:
res . setResponseCode ( Integer . toString ( errorLevel ) ) ;