Author: sebb
Date: Thu Jan 21 00:15:28 2010
New Revision: 901453
URL: http://svn.apache.org/viewvc?rev=901453&view=rev
Log:
Use Map interface rather than specific Hashtable
Modified:
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java
Modified: jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java?rev=901453&r1=901452&r2=901453&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java (original)
+++ jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java Thu Jan 21 00:15:28 2010
@@ -26,9 +26,9 @@
import java.io.StringWriter;
import java.net.URL;
import java.net.MalformedURLException;
-import java.util.Enumeration;
+import java.util.Map;
import java.util.Random;
-import java.util.Hashtable;
+import java.util.Map.Entry;
import javax.xml.parsers.DocumentBuilder;
@@ -508,7 +508,7 @@
msg.setSOAPTransport(spconn);
msg.send(this.getUrl(), this.getSoapAction(), msgEnv);
@SuppressWarnings("unchecked") // API uses raw types
- final Hashtable<String, String> headers = spconn.getHeaders();
+ final Map<String, String> headers = spconn.getHeaders();
result.setResponseHeaders(convertSoapHeaders(headers));
if (this.getHeaderManager() != null) {
@@ -617,12 +617,10 @@
public void addEncodedArgument(String name, String value, String metaData) {
}
- public String convertSoapHeaders(Hashtable<String, String> ht) {
- Enumeration<String> en = ht.keys();
+ public String convertSoapHeaders(Map<String, String> ht) {
StringBuilder buf = new StringBuilder();
- while (en.hasMoreElements()) {
- String key = en.nextElement();
- buf.append(key).append("=").append(ht.get(key)).append("\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ for (Entry<String, String> entry : ht.entrySet()) {
+ buf.append(entry.getKey()).append("=").append(entry.getValue()).append("\n"); //$NON-NLS-1$ //$NON-NLS-2$
}
return buf.toString();
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.