Buggy code:
public static final String FILE_DATA = "HTTPSampler.FILE_DATA" ; public static final String FILE_MIMETYPE = "HTTPSampler.FILE_MIMETYPE" ; 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" ; 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 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 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 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 ( ) { } protected void addCustomTestElement ( TestElement element ) { } 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 { String pathAndQuery = null ; if ( ( this . getMethod ( ) . equals ( HTTPSampler . GET ) ) && ( ( getQueryString ( ) . length ( ) ) > 0 ) ) { if ( ( this . getPath ( ) . indexOf ( "?" ) ) > ( - 1 ) ) { pathAndQuery = ( ( this . getPath ( ) ) + "&" ) + ( getQueryString ( ) ) ; } else { pathAndQuery = ( ( this . getPath ( ) ) + "?" ) + ( getQueryString ( ) ) ; } } else { pathAndQuery = this . getPath ( ) ; } if ( ! ( pathAndQuery . startsWith ( "//" ) ) ) { pathAndQuery = "//" + pathAndQuery ; } if ( ( getPort ( ) ) == 0 ) { return new java . net . URL ( getProtocol ( ) , getDomain ( ) , pathAndQuery ) ; } else { <START_BUG> return new java . net . URL ( getProtocol ( ) , ( ( String ) ( getProperty ( HTTPSampler . DOMAIN ) ) ) , getPort ( ) , pathAndQuery ) ; <END_BUG> } } 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 { } public void removeArguments ( ) { } private void redirectUrl ( HttpURLConnection conn , java . net . URL u ) throws MalformedURLException { } protected long connect ( ) throws IOException { } private SampleResult sample ( int redirects ) { } 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 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:
return new java . net . URL ( getProtocol ( ) , getPropertyAsString ( HTTPSampler . DOMAIN ) , getPort ( ) , pathAndQuery ) ;