@@ -, +, @@ --- .../jmeter/testbeans/gui/ComboStringEditor.java | 16 ++++------ .../org/apache/jmeter/util/BeanShellClient.java | 8 ++--- .../jmeter/protocol/http/sampler/HTTPHC4Impl.java | 9 +++--- .../protocol/http/sampler/HTTPHCAbstractImpl.java | 4 +-- .../jmeter/protocol/http/sampler/HTTPJavaImpl.java | 36 ++++++++++------------ .../protocol/http/util/HTTPConstantsInterface.java | 1 - .../jmeter/report/gui/action/ReportDragNDrop.java | 3 -- 7 files changed, 33 insertions(+), 44 deletions(-) --- a/src/core/org/apache/jmeter/testbeans/gui/ComboStringEditor.java +++ a/src/core/org/apache/jmeter/testbeans/gui/ComboStringEditor.java @@ -51,14 +51,10 @@ class ComboStringEditor extends PropertyEditorSupport implements ItemListener, C private static final String[] EMPTY_STRING_ARRAY = new String[0]; - /** - * The list of options to be offered by this editor. - */ + /** The list of options to be offered by this editor. */ private final String[] tags; - /** - * The edited property's default value. - */ + /** The edited property's default value. */ private String initialEditValue; private final JComboBox combo; @@ -113,12 +109,12 @@ class ComboStringEditor extends PropertyEditorSupport implements ItemListener, C model = new DefaultComboBoxModel(); if (rb != null && tags.length > 0) { - validTranslations=new HashMap(); + validTranslations = new HashMap(); for (String tag : this.tags) { validTranslations.put(tag, rb.getString(tag)); } } else { - validTranslations=null; + validTranslations = null; } if (!noUndefined) { @@ -128,11 +124,11 @@ class ComboStringEditor extends PropertyEditorSupport implements ItemListener, C this.minTagIndex = Integer.MAX_VALUE; this.maxTagIndex = Integer.MIN_VALUE; } else { - this.minTagIndex=model.getSize(); // track where tags start ... + this.minTagIndex = model.getSize(); // track where tags start ... for (String tag : this.tags) { model.addElement(translate(tag)); } - this.maxTagIndex=model.getSize(); // ... and where they end + this.maxTagIndex = model.getSize(); // ... and where they end } if (!noEdit) { model.addElement(EDIT); --- a/src/core/org/apache/jmeter/util/BeanShellClient.java +++ a/src/core/org/apache/jmeter/util/BeanShellClient.java @@ -27,7 +27,6 @@ import java.net.Socket; // N.B. Do not call any JMeter methods; the jar is standalone - /** * Implements a client that can talk to the JMeter BeanShell server. */ @@ -60,8 +59,8 @@ public class BeanShellClient { sendLine("bsh.prompt=\"\";",os);// Prompt is unnecessary sendLine("String [] args={",os); - for (int i=MINARGS; i> HTTPCLIENTS = - new ThreadLocal>(){ + new ThreadLocal>() { @Override protected Map initialValue() { return new HashMap(); } }; - // Scheme used for slow HTTP sockets. Cannot be set as a default, because must be set on an HttpClient instance. + /* Scheme used for slow HTTP sockets. + * Cannot be set as a default, because must be set on an HttpClient instance. */ private static final Scheme SLOW_HTTP; // We always want to override the HTTPS scheme, because we want to trust all certificates and hosts @@ -422,7 +421,7 @@ public class HTTPHC4Impl extends HTTPHCAbstractImpl { return res; } - /** + /** * Calls sendPostData if method is POST and sendEntityData if method is PUT or PATCH * Field HTTPSampleResult#queryString of result is modified in the 2 cases * @param method String HTTP method --- a/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHCAbstractImpl.java +++ a/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHCAbstractImpl.java @@ -95,7 +95,7 @@ public abstract class HTTPHCAbstractImpl extends HTTPAbstractImpl { } nonProxyHostSuffixSize=nonProxyHostSuffix.size(); - InetAddress inet=null; + InetAddress inet = null; String localHostOrIP = JMeterUtils.getPropDefault("httpclient.localaddress",""); // $NON-NLS-1$ if (localHostOrIP.length() > 0){ @@ -124,7 +124,7 @@ public abstract class HTTPHCAbstractImpl extends HTTPAbstractImpl { } protected static boolean isPartialMatch(String host) { - for (int i=0;i> requestHeaders = conn.getRequestProperties(); - for(Map.Entry> entry : requestHeaders.entrySet()) { - String headerKey=entry.getKey(); + for (Map.Entry> entry : requestHeaders.entrySet()) { + String headerKey = entry.getKey(); // Exclude the COOKIE header, since cookie is reported separately in the sample - if(!HTTPConstants.HEADER_COOKIE.equalsIgnoreCase(headerKey)) { + if (!HTTPConstants.HEADER_COOKIE.equalsIgnoreCase(headerKey)) { // value is a List of Strings for (String value : entry.getValue()){ hdrs.append(headerKey); @@ -520,12 +519,11 @@ public class HTTPJavaImpl extends HTTPAbstractImpl { res.setResponseData(responseData); - @SuppressWarnings("null") // Cannot be null here int errorLevel = conn.getResponseCode(); String respMsg = conn.getResponseMessage(); - String hdr=conn.getHeaderField(0); + String hdr = conn.getHeaderField(0); if (hdr == null) { - hdr="(null)"; // $NON-NLS-1$ + hdr = "(null)"; // $NON-NLS-1$ } if (errorLevel == -1){// Bug 38902 - sometimes -1 seems to be returned unnecessarily if (respMsg != null) {// Bug 41902 - NPE @@ -536,7 +534,7 @@ public class HTTPJavaImpl extends HTTPAbstractImpl { log.warn("ResponseCode==-1; could not parse "+respMsg+" hdr: "+hdr); } } else { - respMsg=hdr; // for result + respMsg = hdr; // for result log.warn("ResponseCode==-1 & null ResponseMessage. Header(0)= "+hdr); } } @@ -548,7 +546,7 @@ public class HTTPJavaImpl extends HTTPAbstractImpl { res.setSuccessful(isSuccessCode(errorLevel)); if (respMsg == null) {// has been seen in a redirect - respMsg=hdr; // use header (if possible) if no message found + respMsg = hdr; // use header (if possible) if no message found } res.setResponseMessage(respMsg); @@ -596,7 +594,7 @@ public class HTTPJavaImpl extends HTTPAbstractImpl { if (conn != null) { // May not exist conn.disconnect(); } - conn=null; // Don't process again + conn = null; // Don't process again return errorResult(e, res); } finally { // calling disconnect doesn't close the connection immediately, --- a/src/protocol/http/org/apache/jmeter/protocol/http/util/HTTPConstantsInterface.java +++ a/src/protocol/http/org/apache/jmeter/protocol/http/util/HTTPConstantsInterface.java @@ -22,7 +22,6 @@ package org.apache.jmeter.protocol.http.util; /** * Constants used in HTTP, mainly header names. */ - public interface HTTPConstantsInterface { int DEFAULT_HTTPS_PORT = 443; --- a/src/reports/org/apache/jmeter/report/gui/action/ReportDragNDrop.java +++ a/src/reports/org/apache/jmeter/report/gui/action/ReportDragNDrop.java @@ -72,14 +72,12 @@ public class ReportDragNDrop extends AbstractAction { } else if (INSERT_BEFORE.equals(action) && canAddTo(parentNode)) { removeNodesFromParents(draggedNodes); for (int i = 0; i < draggedNodes.length; i++) { - @SuppressWarnings("null") int index = parentNode.getIndex(currentNode); // can't be null - this is checked by canAddTo ReportGuiPackage.getInstance().getTreeModel().insertNodeInto(draggedNodes[i], parentNode, index); } } else if (INSERT_AFTER.equals(action) && canAddTo(parentNode)) { removeNodesFromParents(draggedNodes); for (int i = 0; i < draggedNodes.length; i++) { - @SuppressWarnings("null") int index = parentNode.getIndex(currentNode) + 1; // can't be null - this is checked by canAddTo ReportGuiPackage.getInstance().getTreeModel().insertNodeInto(draggedNodes[i], parentNode, index); } @@ -99,7 +97,6 @@ public class ReportDragNDrop extends AbstractAction { return false; } TestElement te = parentNode.getTestElement(); - // System.out.println("Add to: "+te.getClass().getName()); if (te instanceof Controller) { return true; } --