Buggy code:
public class SoapSampler extends HTTPSampler2 implements Interruptible { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; public static final String XML_DATA = "HTTPSamper.xml_data" ; public static final String URL_DATA = "SoapSampler.URL_DATA" ; public static final String SOAP_ACTION = "SoapSampler.SOAP_ACTION" ; public static final String SEND_SOAP_ACTION = "SoapSampler.SEND_SOAP_ACTION" ; public static final String XML_DATA_FILE = "SoapSampler.xml_data_file" ; private static final String DOUBLE_QUOTE = "\"" ; private static final String SOAPACTION = "SOAPAction" ; private static final String ENCODING = "utf-8" ; private static final String DEFAULT_CONTENT_TYPE = "text//xml" ; public void setXmlData ( String data ) { } public String getXmlData ( ) { } public void setXmlFile ( String filename ) { } public String getXmlFile ( ) { } public String getURLData ( ) { } public void setURLData ( String url ) { } public String getSOAPAction ( ) { } public String getSOAPActionQuoted ( ) { } public void setSOAPAction ( String action ) { } public boolean getSendSOAPAction ( ) { } public void setSendSOAPAction ( boolean action ) { } protected int setPostHeaders ( PostMethod post ) { } private String sendPostData ( PostMethod post , final int length ) { } @ Override protected HTTPSampleResult sample ( URL url , String method , boolean areFollowingRedirect , int frameDepth ) { String urlStr = url . toString ( ) ; SoapSampler . log . debug ( ( "Start<seq2seq4repair_space>:<seq2seq4repair_space>sample<seq2seq4repair_space>" + urlStr ) ) ; PostMethod httpMethod ; httpMethod = new PostMethod ( urlStr ) ; HTTPSampleResult res = new HTTPSampleResult ( ) ; res . setMonitor ( false ) ; res . setSampleLabel ( urlStr ) ; res . setHTTPMethod ( POST ) ; res . setURL ( url ) ; res . sampleStart ( ) ; HttpClient client = null ; InputStream instream = null ; try { int content_len = setPostHeaders ( httpMethod ) ; client = setupConnection ( url , httpMethod , res ) ; savedClient = client ; res . setQueryString ( sendPostData ( httpMethod , content_len ) ) ; int statusCode = client . executeMethod ( httpMethod ) ; res . setRequestHeaders ( getConnectionHeaders ( httpMethod ) ) ; instream = httpMethod . getResponseBodyAsStream ( ) ; if ( instream != null ) { <START_BUG> Header responseHeader = httpMethod . getResponseHeader ( TRANSFER_ENCODING ) ; <END_BUG> if ( ( responseHeader != null ) && ( ENCODING_GZIP . equals ( responseHeader . getValue ( ) ) ) ) { instream = new GZIPInputStream ( instream ) ; } ByteArrayOutputStream outstream = new ByteArrayOutputStream ( ( 4 * 1024 ) ) ; byte [ ] buffer = new byte [ 4096 ] ; int len ; boolean first = true ; while ( ( len = instream . read ( buffer ) ) > 0 ) { if ( first ) { res . latencyEnd ( ) ; first = false ; } outstream . write ( buffer , 0 , len ) ; } res . setResponseData ( outstream . toByteArray ( ) ) ; outstream . close ( ) ; } res . sampleEnd ( ) ; res . setSampleLabel ( httpMethod . getURI ( ) . toString ( ) ) ; res . setResponseCode ( Integer . toString ( statusCode ) ) ; res . setSuccessful ( isSuccessCode ( statusCode ) ) ; res . setResponseMessage ( httpMethod . getStatusText ( ) ) ; res . setDataEncoding ( SoapSampler . ENCODING ) ; res . setContentType ( SoapSampler . DEFAULT_CONTENT_TYPE ) ; String ct = null ; Header h = httpMethod . getResponseHeader ( HEADER_CONTENT_TYPE ) ; if ( h != null ) { ct = h . getValue ( ) ; res . setContentType ( ct ) ; res . setEncodingAndType ( ct ) ; } res . setResponseHeaders ( getResponseHeaders ( httpMethod ) ) ; if ( res . isRedirect ( ) ) { res . setRedirectLocation ( httpMethod . getResponseHeader ( HEADER_LOCATION ) . getValue ( ) ) ; } if ( getAutoRedirects ( ) ) { res . setURL ( new URL ( httpMethod . getURI ( ) . toString ( ) ) ) ; } saveConnectionCookies ( httpMethod , res . getURL ( ) , getCookieManager ( ) ) ; final CacheManager cacheManager = getCacheManager ( ) ; if ( cacheManager != null ) { cacheManager . saveDetails ( httpMethod , res ) ; } res = resultProcessing ( areFollowingRedirect , frameDepth , res ) ; SoapSampler . log . debug ( "End<seq2seq4repair_space>:<seq2seq4repair_space>sample" ) ; httpMethod . releaseConnection ( ) ; return res ; } catch ( IllegalArgumentException e ) { res . sampleEnd ( ) ; HTTPSampleResult err = errorResult ( e , res ) ; err . setSampleLabel ( ( "Error:<seq2seq4repair_space>" + ( url . toString ( ) ) ) ) ; return err ; } catch ( IOException e ) { res . sampleEnd ( ) ; HTTPSampleResult err = errorResult ( e , res ) ; err . setSampleLabel ( ( "Error:<seq2seq4repair_space>" + ( url . toString ( ) ) ) ) ; return err ; } finally { JOrphanUtils . closeQuietly ( instream ) ; savedClient = null ; httpMethod . releaseConnection ( ) ; } } @ Override public URL getUrl ( ) throws MalformedURLException { } }

Fix:
Header responseHeader = httpMethod . getResponseHeader ( HEADER_CONTENT_ENCODING ) ;