http-client-branch: merge http-client-branch
authorprappo
Fri, 17 Nov 2017 14:22:07 +0300
branchhttp-client-branch
changeset 55827 282ec9039187
parent 55826 66b5d6013d85 (current diff)
parent 55825 5928d92183d2 (diff)
child 55828 ac0c821cc75c
http-client-branch: merge
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpRequest.java	Fri Nov 17 14:04:38 2017 +0300
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpRequest.java	Fri Nov 17 14:22:07 2017 +0300
@@ -543,19 +543,25 @@
      */
     public abstract HttpHeaders headers();
 
-
     /**
-     * Two {@code HttpRequest} objects are equal if their URI, method and headers
-     * fields are all equal.
+     * Tests this HTTP request instance for equality with the given object.
+     *
+     * <p> If the given object is not an {@code HttpRequest} then this
+     * method returns {@code false}. Two HTTP requests are equal if their URI,
+     * method, and headers fields are all equal.
      *
-     * @param other
-     * @return true if this is equal to other
+     * <p> This method satisfies the general contract of the {@link
+     * Object#equals(Object) Object.equals} method.
+     *
+     * @param obj the object to which this object is to be compared
+     * @return {@code true} if, and only if, the given object is an {@code
+     *         HttpRequest} that is equal to this HTTP request
      */
     @Override
-    public final boolean equals(Object other) {
-       if (! (other instanceof HttpRequest))
+    public final boolean equals(Object obj) {
+       if (! (obj instanceof HttpRequest))
            return false;
-       HttpRequest that = (HttpRequest)other;
+       HttpRequest that = (HttpRequest)obj;
        if (!that.method().equals(this.method()))
            return false;
        if (!that.uri().equals(this.uri()))
@@ -564,12 +570,15 @@
            return false;
        return true;
     }
-
+    
     /**
-     * Returns this object's hash code. The hash code is calculated as the sum of the
-     * hash codes of its method, uri and headers fields.
+     * Computes a hash code for this HTTP request instance.
      *
-     * @return
+     * <p> The hash code is based upon the HTTP request's URI, method, and
+     * header components, and satisfies the general contract of the
+     * {@link Object#hashCode Object.hashCode} method.
+     *
+     * @return the hash-code value for this HTTP request
      */
     public final int hashCode() {
         return method().hashCode()