commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r354155 - in /jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient: ./ auth/ methods/multipart/ params/ util/
Date Mon, 05 Dec 2005 20:18:26 GMT
Author: olegk
Date: Mon Dec  5 12:18:10 2005
New Revision: 354155

URL: http://svn.apache.org/viewcvs?rev=354155&view=rev
Log:
PR #37616 (Findbugs reports and fixes)

Fixes for problems discovered by running findbugs 0.94.rc1 on HttpClient 3.0rc4

Submitted by Sebb <sebb at apache.org>
Reviewed by Oleg Kalnichevski & Michael Becke

Modified:
    jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HostConfiguration.java
    jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpClient.java
    jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ProxyClient.java
    jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/StatusLine.java
    jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/auth/AuthScope.java
    jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/auth/DigestScheme.java
    jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/multipart/FilePart.java
    jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java
    jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/HttpClientParams.java
    jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/HttpConnectionManagerParams.java
    jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/HttpMethodParams.java
    jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/util/LangUtils.java

Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HostConfiguration.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HostConfiguration.java?rev=354155&r1=354154&r2=354155&view=diff
==============================================================================
--- jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HostConfiguration.java
(original)
+++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HostConfiguration.java
Mon Dec  5 12:18:10 2005
@@ -503,7 +503,7 @@
     /**
      * @see java.lang.Object#hashCode()
      */
-    public int hashCode() {
+    public synchronized int hashCode() {
         int hash = LangUtils.HASH_SEED;
         hash = LangUtils.hashCode(hash, this.host);
         hash = LangUtils.hashCode(hash, this.proxyHost);

Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpClient.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpClient.java?rev=354155&r1=354154&r2=354155&view=diff
==============================================================================
--- jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpClient.java
(original)
+++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpClient.java
Mon Dec  5 12:18:10 2005
@@ -389,7 +389,7 @@
         }
         
         HttpMethodDirector methodDirector = new HttpMethodDirector(
-                this.httpConnectionManager,
+                getHttpConnectionManager(),
                 hostconfig,
                 this.params,
                 (state == null ? getState() : state));

Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ProxyClient.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ProxyClient.java?rev=354155&r1=354154&r2=354155&view=diff
==============================================================================
--- jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ProxyClient.java
(original)
+++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/ProxyClient.java
Mon Dec  5 12:18:10 2005
@@ -261,7 +261,7 @@
     /**
      * A connection manager that creates a single connection.  Meant to be used only once.
      */
-    class DummyConnectionManager implements HttpConnectionManager {
+    static class DummyConnectionManager implements HttpConnectionManager {
 
         private HttpConnection httpConnection;
         

Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/StatusLine.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/StatusLine.java?rev=354155&r1=354154&r2=354155&view=diff
==============================================================================
--- jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/StatusLine.java
(original)
+++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/StatusLine.java
Mon Dec  5 12:18:10 2005
@@ -129,7 +129,7 @@
             throw new HttpException("Status-Line '" + statusLine + "' is not valid"); 
         }
         //save the original Status-Line
-        this.statusLine = new String(statusLine);
+        this.statusLine = statusLine;
     }
 
 

Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/auth/AuthScope.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/auth/AuthScope.java?rev=354155&r1=354154&r2=354155&view=diff
==============================================================================
--- jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/auth/AuthScope.java
(original)
+++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/auth/AuthScope.java
Mon Dec  5 12:18:10 2005
@@ -69,7 +69,7 @@
      * In the future versions of HttpClient the use of this parameter will be 
      * discontinued.  
      */
-    public static AuthScope ANY = new AuthScope(ANY_HOST, ANY_PORT, ANY_REALM, ANY_SCHEME);
+    public static final AuthScope ANY = new AuthScope(ANY_HOST, ANY_PORT, ANY_REALM, ANY_SCHEME);
 
     /** The authentication scheme the credentials apply to. */
     private String scheme = null;

Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/auth/DigestScheme.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/auth/DigestScheme.java?rev=354155&r1=354154&r2=354155&view=diff
==============================================================================
--- jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/auth/DigestScheme.java
(original)
+++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/auth/DigestScheme.java
Mon Dec  5 12:18:10 2005
@@ -459,10 +459,8 @@
         String uri = getParameter("uri");
         String realm = getParameter("realm");
         String nonce = getParameter("nonce");
-        String nc = getParameter("nc");
         String opaque = getParameter("opaque");
         String response = digest;
-        String qop = getParameter("qop");
         String algorithm = getParameter("algorithm");
 
         List params = new ArrayList(20);

Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/multipart/FilePart.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/multipart/FilePart.java?rev=354155&r1=354154&r2=354155&view=diff
==============================================================================
--- jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/multipart/FilePart.java
(original)
+++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/multipart/FilePart.java
Mon Dec  5 12:18:10 2005
@@ -71,7 +71,7 @@
     protected static final String FILE_NAME = "; filename=";
 
     /** Attachment's file name as a byte array */
-    protected static final byte[] FILE_NAME_BYTES = 
+    private static final byte[] FILE_NAME_BYTES = 
         EncodingUtil.getAsciiBytes(FILE_NAME);
 
     /** Source of the file part. */

Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java?rev=354155&r1=354154&r2=354155&view=diff
==============================================================================
--- jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java
(original)
+++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java
Mon Dec  5 12:18:10 2005
@@ -39,8 +39,6 @@
 import org.apache.commons.httpclient.util.DateUtil;
 
 /**
- * TODO: comment type
- * 
  * @since 3.0
  */
 public class DefaultHttpParamsFactory implements HttpParamsFactory {

Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/HttpClientParams.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/HttpClientParams.java?rev=354155&r1=354154&r2=354155&view=diff
==============================================================================
--- jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/HttpClientParams.java
(original)
+++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/HttpClientParams.java
Mon Dec  5 12:18:10 2005
@@ -199,12 +199,12 @@
 
     public void makeStrict() {
         super.makeStrict();
-        setParameters(PROTOCOL_STRICTNESS_PARAMETERS, new Boolean(true));
+        setParameters(PROTOCOL_STRICTNESS_PARAMETERS, Boolean.TRUE);
     }
 
 
     public void makeLenient() {
         super.makeLenient();
-        setParameters(PROTOCOL_STRICTNESS_PARAMETERS, new Boolean(false));
+        setParameters(PROTOCOL_STRICTNESS_PARAMETERS, Boolean.FALSE);
     }
 }

Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/HttpConnectionManagerParams.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/HttpConnectionManagerParams.java?rev=354155&r1=354154&r2=354155&view=diff
==============================================================================
--- jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/HttpConnectionManagerParams.java
(original)
+++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/HttpConnectionManagerParams.java
Mon Dec  5 12:18:10 2005
@@ -62,7 +62,7 @@
      * {@link org.apache.commons.httpclient.HostConfiguration#ANY_HOST_CONFIGURATION}.
      * </p>
      */
-    public static String MAX_HOST_CONNECTIONS = "http.connection-manager.max-per-host";
+    public static final String MAX_HOST_CONNECTIONS = "http.connection-manager.max-per-host";
 
     /** 
      * Defines the maximum number of connections allowed overall. This value only applies
@@ -71,7 +71,7 @@
      * This parameter expects a value of type {@link Integer}.
      * </p>
      */
-    public static String MAX_TOTAL_CONNECTIONS = "http.connection-manager.max-total";
+    public static final String MAX_TOTAL_CONNECTIONS = "http.connection-manager.max-total";
     
     /**
      * Sets the default maximum number of connections allowed for a given

Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/HttpMethodParams.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/HttpMethodParams.java?rev=354155&r1=354154&r2=354155&view=diff
==============================================================================
--- jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/HttpMethodParams.java
(original)
+++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/params/HttpMethodParams.java
Mon Dec  5 12:18:10 2005
@@ -475,7 +475,7 @@
      * strictly adhere to the HTTP specification.  
      */
     public void makeStrict() {
-        setParameters(PROTOCOL_STRICTNESS_PARAMETERS, new Boolean(true));
+        setParameters(PROTOCOL_STRICTNESS_PARAMETERS, Boolean.TRUE);
         setIntParameter(STATUS_LINE_GARBAGE_LIMIT, 0);
     }
 
@@ -486,7 +486,7 @@
      * the HTTP protocol specification (RFC 2616 and other relevant RFCs).
      */
     public void makeLenient() {
-        setParameters(PROTOCOL_STRICTNESS_PARAMETERS, new Boolean(false));
+        setParameters(PROTOCOL_STRICTNESS_PARAMETERS, Boolean.FALSE);
         setIntParameter(STATUS_LINE_GARBAGE_LIMIT, Integer.MAX_VALUE);
     }
 

Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/util/LangUtils.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/util/LangUtils.java?rev=354155&r1=354154&r2=354155&view=diff
==============================================================================
--- jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/util/LangUtils.java
(original)
+++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/util/LangUtils.java
Mon Dec  5 12:18:10 2005
@@ -39,8 +39,8 @@
  */
 public class LangUtils {
     
-    public static int HASH_SEED = 17;
-    public static int HASH_OFFSET = 37;
+    public static final int HASH_SEED = 17;
+    public static final int HASH_OFFSET = 37;
     
     private LangUtils() {
         super();



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message