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 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 InetAddress localAddress = null ; private static final String localHost ; static final ThreadLocal httpClients = new ThreadLocal ( ) ; private static Set nonProxyHostFull = new HashSet ( ) ; private static List nonProxyHostSuffix = new ArrayList ( ) ; private static final int nonProxyHostSuffixSize ; static boolean isNonProxy ( String host ) { } private static boolean isPartialMatch ( String host ) { } private static void setDefaultParams ( ) { } public HTTPSampler2 ( ) { } private String sendPostData ( PostMethod post ) throws IOException { } HttpClient setupConnection ( URL u , HttpMethodBase httpMethod , HTTPSampleResult res ) throws IOException { } protected void setDefaultRequestHeaders ( HttpMethod httpMethod ) { } protected String getResponseHeaders ( HttpMethod method ) { } String setConnectionCookie ( HttpMethod method , URL u , CookieManager cookieManager ) { } private void setConnectionHeaders ( HttpMethod method , URL u , HeaderManager headerManager ) { } private String getConnectionHeaders ( HttpMethod method ) { } 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 { StringBuffer putBody = new StringBuffer ( 1000 ) ; boolean hasPutBody = false ; Header contentTypeHeader = put . getRequestHeader ( HEADER_CONTENT_TYPE ) ; boolean hasContentTypeHeader = ( ( contentTypeHeader != null ) && ( ( contentTypeHeader . getValue ( ) ) != null ) ) && ( ( contentTypeHeader . getValue ( ) . length ( ) ) > 0 ) ; if ( ( ! ( hasArguments ( ) ) ) && ( getSendFileAsPostBody ( ) ) ) { hasPutBody = true ; HTTPSampler2 . FileRequestEntity fileRequestEntity = new HTTPSampler2 . FileRequestEntity ( new File ( getFilename ( ) ) , null ) ; put . setRequestEntity ( fileRequestEntity ) ; putBody . append ( "<actual<seq2seq4repair_space>file<seq2seq4repair_space>content,<seq2seq4repair_space>not<seq2seq4repair_space>shown<seq2seq4repair_space>here>" ) ; } else if ( getSendParameterValuesAsPostBody ( ) ) { hasPutBody = true ; final String contentEncoding = getContentEncoding ( ) ; boolean haveContentEncoding = false ; if ( ( contentEncoding != null ) && ( ( contentEncoding . trim ( ) . length ( ) ) > 0 ) ) { put . getParams ( ) . setContentCharset ( contentEncoding ) ; haveContentEncoding = true ; } StringBuffer putBodyContent = new StringBuffer ( ) ; PropertyIterator args = getArguments ( ) . iterator ( ) ; while ( args . hasNext ( ) ) { HTTPArgument arg = ( ( HTTPArgument ) ( args . next ( ) . getObjectValue ( ) ) ) ; String value = null ; if ( haveContentEncoding ) { value = arg . getEncodedValue ( contentEncoding ) ; } else { value = arg . getEncodedValue ( ) ; } <START_BUG> putBody . append ( value ) ; <END_BUG> } String contentTypeValue = null ; if ( hasContentTypeHeader ) { contentTypeValue = put . getRequestHeader ( HEADER_CONTENT_TYPE ) . getValue ( ) ; } StringRequestEntity requestEntity = new StringRequestEntity ( putBodyContent . toString ( ) , contentTypeValue , put . getRequestCharSet ( ) ) ; put . setRequestEntity ( requestEntity ) ; } if ( hasPutBody ) { if ( put . getRequestEntity ( ) . isRepeatable ( ) ) { ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; put . getRequestEntity ( ) . writeRequest ( bos ) ; bos . flush ( ) ; putBody . append ( new String ( bos . toByteArray ( ) , "UTF-8" ) ) ; bos . close ( ) ; } else { putBody . append ( "<RequestEntity<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>repeatable,<seq2seq4repair_space>cannot<seq2seq4repair_space>view<seq2seq4repair_space>what<seq2seq4repair_space>was<seq2seq4repair_space>sent>" ) ; } if ( ! hasContentTypeHeader ) { if ( ( ( getMimetype ( ) ) != null ) && ( ( getMimetype ( ) . length ( ) ) > 0 ) ) { put . setRequestHeader ( HEADER_CONTENT_TYPE , getMimetype ( ) ) ; } } put . setRequestHeader ( HEADER_CONTENT_LENGTH , Long . toString ( put . getRequestEntity ( ) . getContentLength ( ) ) ) ; return putBody . toString ( ) ; } else { return null ; } } private class FileRequestEntity implements RequestEntity { final File file ; final String contentType ; public FileRequestEntity ( final File file , final String contentType ) { } public long getContentLength ( ) { } public String getContentType ( ) { } public boolean isRepeatable ( ) { } public void writeRequest ( OutputStream out ) throws IOException { } } private 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 { } } void saveConnectionCookies ( HttpMethod method , URL u , CookieManager cookieManager ) { } public void threadStarted ( ) { } public void threadFinished ( ) { } }

Fix:
putBodyContent . append ( value ) ;