hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: svn commit: r604514 - in /jakarta/httpcomponents/httpcore/trunk/module-main/src: main/java/org/apache/http/ main/java/org/apache/http/params/ main/java/org/apache/http/protocol/ test/java/org/apache/http/ test/java/org/apache/http/protocol/
Date Sat, 15 Dec 2007 21:47:15 GMT
On 15/12/2007, olegk@apache.org <olegk@apache.org> wrote:
> Author: olegk
> Date: Sat Dec 15 12:49:40 2007
> New Revision: 604514
>
> URL: http://svn.apache.org/viewvc?rev=604514&view=rev
> Log:
> HTTPCORE-133: Clone support
> * updated classes in packages o.a.h, o.a.h.params, o.a.h.protocol (HttpHost, ProtocolVersion,
BasicHttpParams, BasicHttpProcessor)
>

...

==============================================================================
> --- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/params/BasicHttpParams.java
(original)
> +++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/params/BasicHttpParams.java
Sat Dec 15 12:49:40 2007
> @@ -49,8 +49,8 @@
>  *
>  * @version $Revision$
>  */
> -public class BasicHttpParams extends AbstractHttpParams
> -    implements HttpLinkedParams, Serializable {
> +public final class BasicHttpParams extends AbstractHttpParams
> +    implements HttpLinkedParams, Serializable, Cloneable {
>
>     static final long serialVersionUID = 4571099216197814749L;

Should perhaps be private?

Also, perhaps it should change as there's a new method?

> @@ -171,11 +171,17 @@
>      *          are <i>not</i> copied.
>      */
>     public HttpParams copy() {
> -        BasicHttpParams bhp = new BasicHttpParams(this.defaults);
> -        copyParams(bhp);
> -        return bhp;
> +        BasicHttpParams clone = new BasicHttpParams(this.defaults);
> +        copyParams(clone);
> +        return clone;
>     }
>
> +    public Object clone() throws CloneNotSupportedException {
> +        BasicHttpParams clone = (BasicHttpParams) super.clone();
> +        copyParams(clone);
> +        return clone;
> +    }
> +
>     /**
>      * Copies the locally defined parameters to the argument parameters.
>      * Default parameters accessible via {@link #getDefaults}
>
> Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/BasicHttpProcessor.java
> URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/BasicHttpProcessor.java?rev=604514&r1=604513&r2=604514&view=diff
>

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


Mime
View raw message