sebb        2004/01/07 15:34:38

  Modified:    src/protocol/http/org/apache/jmeter/protocol/http/sampler
                        Tag: testbeans_experimental_branch
                        HTTPSamplerBean.java
  Log:
  Initialise strings as empty rather than null to avoid NPEs
  don't try to disconnect null connection
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.2.4   +10 -9     
jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/sampler/Attic/HTTPSamplerBean.java
  
  Index: HTTPSamplerBean.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/sampler/Attic/HTTPSamplerBean.java,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- HTTPSamplerBean.java      7 Jan 2004 18:20:19 -0000       1.1.2.3
  +++ HTTPSamplerBean.java      7 Jan 2004 23:34:38 -0000       1.1.2.4
  @@ -199,18 +199,18 @@
       /*
        * Public properties:
        */
  -    private String fileField= null;
  +    private String fileField= "";
       private File filename= null;
  -    private String protocol= null;
  -    private String path= null;
  -    private String encodedPath= null;
  +    private String protocol= "";
  +    private String path= "";
  +    private String encodedPath= "";
       private boolean followRedirects= true;
  -    private String Method= null;
  +    private String Method= "";
       private boolean useKeepAlive= false;
       private int port= UNSPECIFIED_PORT;
  -    private String domain= null;
  +    private String domain= "";
       private Arguments arguments= null;
  -    private String mimeType= null;
  +    private String mimeType= "";
       private boolean imageParser= false;
   
       /*
  @@ -324,7 +324,7 @@
        */
       private URL getUrl() throws MalformedURLException
       {
  -        String pathAndQuery= null;
  +        String pathAndQuery= "";
           if (this.getMethod().equals(HTTPSamplerBean.GET)
               && getQueryString().length() > 0)
           {
  @@ -1115,6 +1115,7 @@
   
       private void disconnect(HttpURLConnection conn)
       {
  +     if (conn == null) return;
           String connection= conn.getHeaderField("Connection");
           String protocol= conn.getHeaderField(0);
           if ((connection == null && (protocol == null || 
!protocol.startsWith("HTTP/1.1")))
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to