hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1369783 [2/2] - in /httpcomponents/httpcore/trunk: httpcore-ab/src/main/java/org/apache/http/benchmark/ httpcore-nio/src/examples/org/apache/http/examples/nio/ httpcore-nio/src/main/java/org/apache/http/impl/nio/ httpcore-nio/src/main/java...
Date Mon, 06 Aug 2012 11:22:44 GMT
Modified: httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpGet.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpGet.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpGet.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpGet.java Mon Aug  6 11:22:42 2012
@@ -84,7 +84,7 @@ public class ElementalHttpGet {
         HttpHost host = new HttpHost("localhost", 8080);
 
         DefaultHttpClientConnection conn = new DefaultHttpClientConnection();
-        ConnectionReuseStrategy connStrategy = new DefaultConnectionReuseStrategy();
+        ConnectionReuseStrategy connStrategy = DefaultConnectionReuseStrategy.INSTANCE;
 
         context.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
         context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, host);

Modified: httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpPost.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpPost.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpPost.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpPost.java Mon Aug  6 11:22:42 2012
@@ -90,7 +90,7 @@ public class ElementalHttpPost {
         HttpHost host = new HttpHost("localhost", 8080);
 
         DefaultHttpClientConnection conn = new DefaultHttpClientConnection();
-        ConnectionReuseStrategy connStrategy = new DefaultConnectionReuseStrategy();
+        ConnectionReuseStrategy connStrategy = DefaultConnectionReuseStrategy.INSTANCE;
 
         context.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
         context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, host);

Modified: httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpServer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpServer.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpServer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpServer.java Mon Aug  6 11:22:42 2012
@@ -177,8 +177,8 @@ public class ElementalHttpServer {
             // Set up the HTTP service
             this.httpService = new HttpService(
                     httpproc,
-                    new DefaultConnectionReuseStrategy(),
-                    new DefaultHttpResponseFactory(),
+                    DefaultConnectionReuseStrategy.INSTANCE,
+                    DefaultHttpResponseFactory.INSTANCE,
                     reqistry,
                     this.params);
         }

Modified: httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalPoolingHttpGet.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalPoolingHttpGet.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalPoolingHttpGet.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalPoolingHttpGet.java Mon Aug  6 11:22:42 2012
@@ -130,7 +130,7 @@ public class ElementalPoolingHttpGet {
                         System.out.println("<< Response: " + response.getStatusLine());
                         System.out.println(EntityUtils.toString(response.getEntity()));
 
-                        ConnectionReuseStrategy connStrategy = new DefaultConnectionReuseStrategy();
+                        ConnectionReuseStrategy connStrategy = DefaultConnectionReuseStrategy.INSTANCE;
                         reusable = connStrategy.keepAlive(response, context);
                     } catch (IOException ex) {
                         throw ex;

Modified: httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalReverseProxy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalReverseProxy.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalReverseProxy.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalReverseProxy.java Mon Aug  6 11:22:42 2012
@@ -116,7 +116,7 @@ public class ElementalReverseProxy {
             this.target = target;
             this.httpproc = httpproc;
             this.httpexecutor = httpexecutor;
-            this.connStrategy = new DefaultConnectionReuseStrategy();
+            this.connStrategy = DefaultConnectionReuseStrategy.INSTANCE;
         }
 
         public void handle(
@@ -217,8 +217,8 @@ public class ElementalReverseProxy {
             // Set up the HTTP service
             this.httpService = new HttpService(
                     inhttpproc,
-                    new DefaultConnectionReuseStrategy(),
-                    new DefaultHttpResponseFactory(),
+                    DefaultConnectionReuseStrategy.INSTANCE,
+                    DefaultHttpResponseFactory.INSTANCE,
                     reqistry,
                     this.params);
         }

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/AbstractHttpClientConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/AbstractHttpClientConnection.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/AbstractHttpClientConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/AbstractHttpClientConnection.java Mon Aug  6 11:22:42 2012
@@ -146,7 +146,7 @@ public abstract class AbstractHttpClient
      * @return HTTP response factory.
      */
     protected HttpResponseFactory createHttpResponseFactory() {
-        return new DefaultHttpResponseFactory();
+        return DefaultHttpResponseFactory.INSTANCE;
     }
 
     /**

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/AbstractHttpServerConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/AbstractHttpServerConnection.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/AbstractHttpServerConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/AbstractHttpServerConnection.java Mon Aug  6 11:22:42 2012
@@ -147,7 +147,7 @@ public abstract class AbstractHttpServer
      * @return HTTP request factory.
      */
     protected HttpRequestFactory createHttpRequestFactory() {
-        return new DefaultHttpRequestFactory();
+        return DefaultHttpRequestFactory.INSTANCE;
     }
 
     /**

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultConnectionReuseStrategy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultConnectionReuseStrategy.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultConnectionReuseStrategy.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultConnectionReuseStrategy.java Mon Aug  6 11:22:42 2012
@@ -61,6 +61,8 @@ import org.apache.http.message.BasicToke
 @Immutable
 public class DefaultConnectionReuseStrategy implements ConnectionReuseStrategy {
 
+    public static final ConnectionReuseStrategy INSTANCE = new DefaultConnectionReuseStrategy();
+
     public DefaultConnectionReuseStrategy() {
         super();
     }
@@ -69,12 +71,10 @@ public class DefaultConnectionReuseStrat
     public boolean keepAlive(final HttpResponse response,
                              final HttpContext context) {
         if (response == null) {
-            throw new IllegalArgumentException
-                ("HTTP response may not be null.");
+            throw new IllegalArgumentException("HTTP response may not be null");
         }
         if (context == null) {
-            throw new IllegalArgumentException
-                ("HTTP context may not be null.");
+            throw new IllegalArgumentException("HTTP context may not be null");
         }
 
         // Check for a self-terminating entity. If the end of the entity will

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultHttpRequestFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultHttpRequestFactory.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultHttpRequestFactory.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultHttpRequestFactory.java Mon Aug  6 11:22:42 2012
@@ -43,6 +43,8 @@ import org.apache.http.message.BasicHttp
 @Immutable
 public class DefaultHttpRequestFactory implements HttpRequestFactory {
 
+    public static final HttpRequestFactory INSTANCE = new DefaultHttpRequestFactory();
+
     private static final String[] RFC2616_COMMON_METHODS = {
         "GET"
     };

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultHttpResponseFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultHttpResponseFactory.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultHttpResponseFactory.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultHttpResponseFactory.java Mon Aug  6 11:22:42 2012
@@ -48,6 +48,8 @@ import org.apache.http.impl.EnglishReaso
 @Immutable
 public class DefaultHttpResponseFactory implements HttpResponseFactory {
 
+    public static final HttpResponseFactory INSTANCE = new DefaultHttpResponseFactory();
+
     /** The catalog for looking up reason phrases. */
     protected final ReasonPhraseCatalog reasonCatalog;
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/NoConnectionReuseStrategy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/NoConnectionReuseStrategy.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/NoConnectionReuseStrategy.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/NoConnectionReuseStrategy.java Mon Aug  6 11:22:42 2012
@@ -40,10 +40,12 @@ import org.apache.http.protocol.HttpCont
 @Immutable
 public class NoConnectionReuseStrategy implements ConnectionReuseStrategy {
 
-    // default constructor
+    public static final ConnectionReuseStrategy INSTANCE = new NoConnectionReuseStrategy();
 
+    public NoConnectionReuseStrategy() {
+        super();
+    }
 
-    // non-JavaDoc, see interface ConnectionReuseStrategy
     public boolean keepAlive(final HttpResponse response, final HttpContext context) {
         if (response == null) {
             throw new IllegalArgumentException("HTTP response may not be null");

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractMessageParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractMessageParser.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractMessageParser.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractMessageParser.java Mon Aug  6 11:22:42 2012
@@ -96,7 +96,7 @@ public abstract class AbstractMessagePar
                 CoreConnectionPNames.MAX_HEADER_COUNT, -1);
         this.maxLineLen = params.getIntParameter(
                 CoreConnectionPNames.MAX_LINE_LENGTH, -1);
-        this.lineParser = (parser != null) ? parser : BasicLineParser.DEFAULT;
+        this.lineParser = (parser != null) ? parser : BasicLineParser.INSTANCE;
         this.headerLines = new ArrayList<CharArrayBuffer>();
         this.state = HEAD_LINE;
     }
@@ -127,7 +127,7 @@ public abstract class AbstractMessagePar
             LineParser parser)
         throws HttpException, IOException {
         if (parser == null) {
-            parser = BasicLineParser.DEFAULT;
+            parser = BasicLineParser.INSTANCE;
         }
         List<CharArrayBuffer> headerLines = new ArrayList<CharArrayBuffer>();
         return parseHeaders(inbuffer, maxHeaderCount, maxLineLen, parser, headerLines);

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractMessageWriter.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractMessageWriter.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractMessageWriter.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractMessageWriter.java Mon Aug  6 11:22:42 2012
@@ -70,8 +70,7 @@ public abstract class AbstractMessageWri
         }
         this.sessionBuffer = buffer;
         this.lineBuf = new CharArrayBuffer(128);
-        this.lineFormatter = (formatter != null) ?
-            formatter : BasicLineFormatter.DEFAULT;
+        this.lineFormatter = (formatter != null) ? formatter : BasicLineFormatter.INSTANCE;
     }
 
     /**

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHeader.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHeader.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHeader.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHeader.java Mon Aug  6 11:22:42 2012
@@ -73,7 +73,7 @@ public class BasicHeader implements Head
     @Override
     public String toString() {
         // no need for non-default formatting in toString()
-        return BasicLineFormatter.DEFAULT.formatHeader(null, this).toString();
+        return BasicLineFormatter.INSTANCE.formatHeader(null, this).toString();
     }
 
     public HeaderElement[] getElements() throws ParseException {

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHeaderElementIterator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHeaderElementIterator.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHeaderElementIterator.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHeaderElementIterator.java Mon Aug  6 11:22:42 2012
@@ -70,7 +70,7 @@ public class BasicHeaderElementIterator 
 
 
     public BasicHeaderElementIterator(final HeaderIterator headerIterator) {
-        this(headerIterator, BasicHeaderValueParser.DEFAULT);
+        this(headerIterator, BasicHeaderValueParser.INSTANCE);
     }
 
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHeaderValueFormatter.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHeaderValueFormatter.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHeaderValueFormatter.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHeaderValueFormatter.java Mon Aug  6 11:22:42 2012
@@ -47,10 +47,14 @@ public class BasicHeaderValueFormatter i
      * Note that {@link BasicHeaderValueFormatter} is not a singleton, there
      * can be many instances of the class itself and of derived classes.
      * The instance here provides non-customized, default behavior.
+     *
+     * @deprecated (4.3) use {@link #INSTANCE}
      */
+    @Deprecated
     public final static
         BasicHeaderValueFormatter DEFAULT = new BasicHeaderValueFormatter();
 
+    public final static HeaderValueFormatter INSTANCE = new BasicHeaderValueFormatter();
 
     /**
      * Special characters that can be used as separators in HTTP parameters.
@@ -59,18 +63,15 @@ public class BasicHeaderValueFormatter i
      */
     public final static String SEPARATORS = " ;,:@()<>\\\"/[]?={}\t";
 
-
     /**
      * Unsafe special characters that must be escaped using the backslash
      * character
      */
     public final static String UNSAFE_CHARS = "\"\\";
 
-
-
-    // public default constructor
-
-
+    public BasicHeaderValueFormatter() {
+        super();
+    }
 
     /**
      * Formats an array of header elements.
@@ -79,7 +80,7 @@ public class BasicHeaderValueFormatter i
      * @param quote     <code>true</code> to always format with quoted values,
      *                  <code>false</code> to use quotes only when necessary
      * @param formatter         the formatter to use, or <code>null</code>
-     *                          for the {@link #DEFAULT default}
+     *                          for the {@link #INSTANCE default}
      *
      * @return  the formatted header elements
      */
@@ -88,7 +89,7 @@ public class BasicHeaderValueFormatter i
                               final boolean quote,
                               HeaderValueFormatter formatter) {
         if (formatter == null)
-            formatter = BasicHeaderValueFormatter.DEFAULT;
+            formatter = BasicHeaderValueFormatter.INSTANCE;
         return formatter.formatElements(null, elems, quote).toString();
     }
 
@@ -148,7 +149,7 @@ public class BasicHeaderValueFormatter i
      * @param quote     <code>true</code> to always format with quoted values,
      *                  <code>false</code> to use quotes only when necessary
      * @param formatter         the formatter to use, or <code>null</code>
-     *                          for the {@link #DEFAULT default}
+     *                          for the {@link #INSTANCE default}
      *
      * @return  the formatted header element
      */
@@ -157,7 +158,7 @@ public class BasicHeaderValueFormatter i
                                    boolean quote,
                                    HeaderValueFormatter formatter) {
         if (formatter == null)
-            formatter = BasicHeaderValueFormatter.DEFAULT;
+            formatter = BasicHeaderValueFormatter.INSTANCE;
         return formatter.formatHeaderElement(null, elem, quote).toString();
     }
 
@@ -236,7 +237,7 @@ public class BasicHeaderValueFormatter i
      * @param quote     <code>true</code> to always format with quoted values,
      *                  <code>false</code> to use quotes only when necessary
      * @param formatter         the formatter to use, or <code>null</code>
-     *                          for the {@link #DEFAULT default}
+     *                          for the {@link #INSTANCE default}
      *
      * @return  the formatted parameters
      */
@@ -245,7 +246,7 @@ public class BasicHeaderValueFormatter i
                                 final boolean quote,
                                 HeaderValueFormatter formatter) {
         if (formatter == null)
-            formatter = BasicHeaderValueFormatter.DEFAULT;
+            formatter = BasicHeaderValueFormatter.INSTANCE;
         return formatter.formatParameters(null, nvps, quote).toString();
     }
 
@@ -304,7 +305,7 @@ public class BasicHeaderValueFormatter i
      * @param quote     <code>true</code> to always format with a quoted value,
      *                  <code>false</code> to use quotes only when necessary
      * @param formatter         the formatter to use, or <code>null</code>
-     *                          for the {@link #DEFAULT default}
+     *                          for the {@link #INSTANCE default}
      *
      * @return  the formatted name-value pair
      */
@@ -313,7 +314,7 @@ public class BasicHeaderValueFormatter i
                                    final boolean quote,
                                    HeaderValueFormatter formatter) {
         if (formatter == null)
-            formatter = BasicHeaderValueFormatter.DEFAULT;
+            formatter = BasicHeaderValueFormatter.INSTANCE;
         return formatter.formatNameValuePair(null, nvp, quote).toString();
     }
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHeaderValueParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHeaderValueParser.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHeaderValueParser.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHeaderValueParser.java Mon Aug  6 11:22:42 2012
@@ -52,10 +52,15 @@ public class BasicHeaderValueParser impl
      * Note that {@link BasicHeaderValueParser} is not a singleton, there
      * can be many instances of the class itself and of derived classes.
      * The instance here provides non-customized, default behavior.
+     *
+     * @deprecated (4.3) use {@link #INSTANCE}
      */
+    @Deprecated
     public final static
         BasicHeaderValueParser DEFAULT = new BasicHeaderValueParser();
 
+    public final static HeaderValueParser INSTANCE = new BasicHeaderValueParser();
+
     private final static char PARAM_DELIMITER                = ';';
     private final static char ELEM_DELIMITER                 = ',';
     private final static char[] ALL_DELIMITERS               = new char[] {
@@ -63,8 +68,9 @@ public class BasicHeaderValueParser impl
                                                                 ELEM_DELIMITER
                                                                 };
 
-    // public default constructor
-
+    public BasicHeaderValueParser() {
+        super();
+    }
 
     /**
      * Parses elements with the given parser.
@@ -85,7 +91,7 @@ public class BasicHeaderValueParser impl
         }
 
         if (parser == null)
-            parser = BasicHeaderValueParser.DEFAULT;
+            parser = BasicHeaderValueParser.INSTANCE;
 
         CharArrayBuffer buffer = new CharArrayBuffer(value.length());
         buffer.append(value);
@@ -135,7 +141,7 @@ public class BasicHeaderValueParser impl
         }
 
         if (parser == null)
-            parser = BasicHeaderValueParser.DEFAULT;
+            parser = BasicHeaderValueParser.INSTANCE;
 
         CharArrayBuffer buffer = new CharArrayBuffer(value.length());
         buffer.append(value);
@@ -200,7 +206,7 @@ public class BasicHeaderValueParser impl
         }
 
         if (parser == null)
-            parser = BasicHeaderValueParser.DEFAULT;
+            parser = BasicHeaderValueParser.INSTANCE;
 
         CharArrayBuffer buffer = new CharArrayBuffer(value.length());
         buffer.append(value);
@@ -269,7 +275,7 @@ public class BasicHeaderValueParser impl
         }
 
         if (parser == null)
-            parser = BasicHeaderValueParser.DEFAULT;
+            parser = BasicHeaderValueParser.INSTANCE;
 
         CharArrayBuffer buffer = new CharArrayBuffer(value.length());
         buffer.append(value);

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicLineFormatter.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicLineFormatter.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicLineFormatter.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicLineFormatter.java Mon Aug  6 11:22:42 2012
@@ -55,13 +55,17 @@ public class BasicLineFormatter implemen
      * Note that {@link BasicLineFormatter} is not a singleton, there can
      * be many instances of the class itself and of derived classes.
      * The instance here provides non-customized, default behavior.
+     *
+     * @deprecated (4.3) use {@link #INSTANCE}
      */
+    @Deprecated
     public final static BasicLineFormatter DEFAULT = new BasicLineFormatter();
 
+    public final static LineFormatter INSTANCE = new BasicLineFormatter();
 
-
-    // public default constructor
-
+    public BasicLineFormatter() {
+        super();
+    }
 
     /**
      * Obtains a buffer for formatting.
@@ -87,7 +91,7 @@ public class BasicLineFormatter implemen
      * @param version           the protocol version to format
      * @param formatter         the formatter to use, or
      *                          <code>null</code> for the
-     *                          {@link #DEFAULT default}
+     *                          {@link #INSTANCE default}
      *
      * @return  the formatted protocol version
      */
@@ -95,7 +99,7 @@ public class BasicLineFormatter implemen
         String formatProtocolVersion(final ProtocolVersion version,
                                      LineFormatter formatter) {
         if (formatter == null)
-            formatter = BasicLineFormatter.DEFAULT;
+            formatter = BasicLineFormatter.INSTANCE;
         return formatter.appendProtocolVersion(null, version).toString();
     }
 
@@ -147,14 +151,14 @@ public class BasicLineFormatter implemen
      * @param reqline           the request line to format
      * @param formatter         the formatter to use, or
      *                          <code>null</code> for the
-     *                          {@link #DEFAULT default}
+     *                          {@link #INSTANCE default}
      *
      * @return  the formatted request line
      */
     public final static String formatRequestLine(final RequestLine reqline,
                                                  LineFormatter formatter) {
         if (formatter == null)
-            formatter = BasicLineFormatter.DEFAULT;
+            formatter = BasicLineFormatter.INSTANCE;
         return formatter.formatRequestLine(null, reqline).toString();
     }
 
@@ -207,14 +211,14 @@ public class BasicLineFormatter implemen
      * @param statline          the status line to format
      * @param formatter         the formatter to use, or
      *                          <code>null</code> for the
-     *                          {@link #DEFAULT default}
+     *                          {@link #INSTANCE default}
      *
      * @return  the formatted status line
      */
     public final static String formatStatusLine(final StatusLine statline,
                                                 LineFormatter formatter) {
         if (formatter == null)
-            formatter = BasicLineFormatter.DEFAULT;
+            formatter = BasicLineFormatter.INSTANCE;
         return formatter.formatStatusLine(null, statline).toString();
     }
 
@@ -269,14 +273,14 @@ public class BasicLineFormatter implemen
      * @param header            the header to format
      * @param formatter         the formatter to use, or
      *                          <code>null</code> for the
-     *                          {@link #DEFAULT default}
+     *                          {@link #INSTANCE default}
      *
      * @return  the formatted header
      */
     public final static String formatHeader(final Header header,
                                             LineFormatter formatter) {
         if (formatter == null)
-            formatter = BasicLineFormatter.DEFAULT;
+            formatter = BasicLineFormatter.INSTANCE;
         return formatter.formatHeader(null, header).toString();
     }
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicLineParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicLineParser.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicLineParser.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicLineParser.java Mon Aug  6 11:22:42 2012
@@ -63,9 +63,13 @@ public class BasicLineParser implements 
      * Note that {@link BasicLineParser} is not a singleton, there can
      * be many instances of the class itself and of derived classes.
      * The instance here provides non-customized, default behavior.
+     *
+     * @deprecated (4.3) use {@link #INSTANCE}
      */
+    @Deprecated
     public final static BasicLineParser DEFAULT = new BasicLineParser();
 
+    public final static LineParser INSTANCE = new BasicLineParser();
 
     /**
      * A version of the protocol to parse.
@@ -108,7 +112,7 @@ public class BasicLineParser implements 
         }
 
         if (parser == null)
-            parser = BasicLineParser.DEFAULT;
+            parser = BasicLineParser.INSTANCE;
 
         CharArrayBuffer buffer = new CharArrayBuffer(value.length());
         buffer.append(value);
@@ -273,7 +277,7 @@ public class BasicLineParser implements 
         }
 
         if (parser == null)
-            parser = BasicLineParser.DEFAULT;
+            parser = BasicLineParser.INSTANCE;
 
         CharArrayBuffer buffer = new CharArrayBuffer(value.length());
         buffer.append(value);
@@ -373,7 +377,7 @@ public class BasicLineParser implements 
         }
 
         if (parser == null)
-            parser = BasicLineParser.DEFAULT;
+            parser = BasicLineParser.INSTANCE;
 
         CharArrayBuffer buffer = new CharArrayBuffer(value.length());
         buffer.append(value);
@@ -471,7 +475,7 @@ public class BasicLineParser implements 
         }
 
         if (parser == null)
-            parser = BasicLineParser.DEFAULT;
+            parser = BasicLineParser.INSTANCE;
 
         CharArrayBuffer buffer = new CharArrayBuffer(value.length());
         buffer.append(value);

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicRequestLine.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicRequestLine.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicRequestLine.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicRequestLine.java Mon Aug  6 11:22:42 2012
@@ -83,8 +83,7 @@ public class BasicRequestLine implements
     @Override
     public String toString() {
         // no need for non-default formatting in toString()
-        return BasicLineFormatter.DEFAULT
-            .formatRequestLine(null, this).toString();
+        return BasicLineFormatter.INSTANCE.formatRequestLine(null, this).toString();
     }
 
     @Override

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicStatusLine.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicStatusLine.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicStatusLine.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicStatusLine.java Mon Aug  6 11:22:42 2012
@@ -96,8 +96,7 @@ public class BasicStatusLine implements 
     @Override
     public String toString() {
         // no need for non-default formatting in toString()
-        return BasicLineFormatter.DEFAULT
-            .formatStatusLine(null, this).toString();
+        return BasicLineFormatter.INSTANCE.formatStatusLine(null, this).toString();
     }
 
     @Override

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BufferedHeader.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BufferedHeader.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BufferedHeader.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BufferedHeader.java Mon Aug  6 11:22:42 2012
@@ -106,8 +106,7 @@ public class BufferedHeader implements F
     public HeaderElement[] getElements() throws ParseException {
         ParserCursor cursor = new ParserCursor(0, this.buffer.length());
         cursor.updatePos(this.valuePos);
-        return BasicHeaderValueParser.DEFAULT
-            .parseElements(this.buffer, cursor);
+        return BasicHeaderValueParser.INSTANCE.parseElements(this.buffer, cursor);
     }
 
     public int getValuePos() {

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/TestDefaultConnectionReuseStrategy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/TestDefaultConnectionReuseStrategy.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/TestDefaultConnectionReuseStrategy.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/TestDefaultConnectionReuseStrategy.java Mon Aug  6 11:22:42 2012
@@ -47,7 +47,7 @@ public class TestDefaultConnectionReuseS
 
     @Before
     public void setUp() {
-        reuseStrategy = new DefaultConnectionReuseStrategy();
+        reuseStrategy = DefaultConnectionReuseStrategy.INSTANCE;
         context = new BasicHttpContext(null);
     }
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestRequestParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestRequestParser.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestRequestParser.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestRequestParser.java Mon Aug  6 11:22:42 2012
@@ -56,8 +56,8 @@ public class TestRequestParser {
         try {
             new DefaultHttpRequestParser(
                     null,
-                    BasicLineParser.DEFAULT,
-                    new DefaultHttpRequestFactory(),
+                    BasicLineParser.INSTANCE,
+                    DefaultHttpRequestFactory.INSTANCE,
                     new BasicHttpParams());
             Assert.fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
@@ -67,7 +67,7 @@ public class TestRequestParser {
             SessionInputBuffer inbuffer = new SessionInputBufferMock(new byte[] {});
             new DefaultHttpRequestParser(
                     inbuffer,
-                    BasicLineParser.DEFAULT,
+                    BasicLineParser.INSTANCE,
                     null,
                     new BasicHttpParams());
             Assert.fail("IllegalArgumentException should have been thrown");
@@ -78,8 +78,8 @@ public class TestRequestParser {
             SessionInputBuffer inbuffer = new SessionInputBufferMock(new byte[] {});
             new DefaultHttpRequestParser(
                     inbuffer,
-                    BasicLineParser.DEFAULT,
-                    new DefaultHttpRequestFactory(),
+                    BasicLineParser.INSTANCE,
+                    DefaultHttpRequestFactory.INSTANCE,
                     null);
             Assert.fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
@@ -99,8 +99,8 @@ public class TestRequestParser {
 
         DefaultHttpRequestParser parser = new DefaultHttpRequestParser(
                 inbuffer,
-                BasicLineParser.DEFAULT,
-                new DefaultHttpRequestFactory(),
+                BasicLineParser.INSTANCE,
+                DefaultHttpRequestFactory.INSTANCE,
                 new BasicHttpParams());
 
         HttpRequest httprequest = parser.parse();
@@ -120,8 +120,8 @@ public class TestRequestParser {
 
         DefaultHttpRequestParser parser = new DefaultHttpRequestParser(
                 inbuffer,
-                BasicLineParser.DEFAULT,
-                new DefaultHttpRequestFactory(),
+                BasicLineParser.INSTANCE,
+                DefaultHttpRequestFactory.INSTANCE,
                 new BasicHttpParams());
 
         try {
@@ -144,8 +144,8 @@ public class TestRequestParser {
 
         DefaultHttpRequestParser parser = new DefaultHttpRequestParser(
                 inbuffer,
-                BasicLineParser.DEFAULT,
-                new DefaultHttpRequestFactory(),
+                BasicLineParser.INSTANCE,
+                DefaultHttpRequestFactory.INSTANCE,
                 new BasicHttpParams());
 
         int timeoutCount = 0;

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestResponseParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestResponseParser.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestResponseParser.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestResponseParser.java Mon Aug  6 11:22:42 2012
@@ -52,8 +52,8 @@ public class TestResponseParser {
         try {
             new DefaultHttpResponseParser(
                     null,
-                    BasicLineParser.DEFAULT,
-                    new DefaultHttpResponseFactory(),
+                    BasicLineParser.INSTANCE,
+                    DefaultHttpResponseFactory.INSTANCE,
                     new BasicHttpParams());
             Assert.fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
@@ -63,7 +63,7 @@ public class TestResponseParser {
             SessionInputBuffer inbuffer = new SessionInputBufferMock(new byte[] {});
             new DefaultHttpResponseParser(
                     inbuffer,
-                    BasicLineParser.DEFAULT,
+                    BasicLineParser.INSTANCE,
                     null,
                     new BasicHttpParams());
             Assert.fail("IllegalArgumentException should have been thrown");
@@ -74,8 +74,8 @@ public class TestResponseParser {
             SessionInputBuffer inbuffer = new SessionInputBufferMock(new byte[] {});
             new DefaultHttpResponseParser(
                     inbuffer,
-                    BasicLineParser.DEFAULT,
-                    new DefaultHttpResponseFactory(),
+                    BasicLineParser.INSTANCE,
+                    DefaultHttpResponseFactory.INSTANCE,
                     null);
             Assert.fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
@@ -95,8 +95,8 @@ public class TestResponseParser {
 
         DefaultHttpResponseParser parser = new DefaultHttpResponseParser(
                 inbuffer,
-                BasicLineParser.DEFAULT,
-                new DefaultHttpResponseFactory(),
+                BasicLineParser.INSTANCE,
+                DefaultHttpResponseFactory.INSTANCE,
                 new BasicHttpParams());
 
         HttpResponse httpresponse = parser.parse();
@@ -116,8 +116,8 @@ public class TestResponseParser {
 
         DefaultHttpResponseParser parser = new DefaultHttpResponseParser(
                 inbuffer,
-                BasicLineParser.DEFAULT,
-                new DefaultHttpResponseFactory(),
+                BasicLineParser.INSTANCE,
+                DefaultHttpResponseFactory.INSTANCE,
                 new BasicHttpParams());
 
         try {
@@ -140,8 +140,8 @@ public class TestResponseParser {
 
         DefaultHttpResponseParser parser = new DefaultHttpResponseParser(
                 inbuffer,
-                BasicLineParser.DEFAULT,
-                new DefaultHttpResponseFactory(),
+                BasicLineParser.INSTANCE,
+                DefaultHttpResponseFactory.INSTANCE,
                 new BasicHttpParams());
 
         int timeoutCount = 0;

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicHeaderValueFormatter.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicHeaderValueFormatter.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicHeaderValueFormatter.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicHeaderValueFormatter.java Mon Aug  6 11:22:42 2012
@@ -151,7 +151,7 @@ public class TestBasicHeaderValueFormatt
         try {
             BasicHeaderValueFormatter.formatHeaderElement
                 ((HeaderElement) null, false,
-                 BasicHeaderValueFormatter.DEFAULT);
+                 BasicHeaderValueFormatter.INSTANCE);
             Assert.fail("IllegalArgumentException should habe been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
@@ -160,7 +160,7 @@ public class TestBasicHeaderValueFormatt
         try {
             BasicHeaderValueFormatter.formatElements
                 ((HeaderElement[]) null, false,
-                 BasicHeaderValueFormatter.DEFAULT);
+                 BasicHeaderValueFormatter.INSTANCE);
             Assert.fail("IllegalArgumentException should habe been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
@@ -182,7 +182,7 @@ public class TestBasicHeaderValueFormatt
         try {
             BasicHeaderValueFormatter.formatParameters
                 ((NameValuePair[]) null, true,
-                 BasicHeaderValueFormatter.DEFAULT);
+                 BasicHeaderValueFormatter.INSTANCE);
             Assert.fail("IllegalArgumentException should habe been thrown");
         } catch (IllegalArgumentException ex) {
             // expected

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicHeaderValueParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicHeaderValueParser.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicHeaderValueParser.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicHeaderValueParser.java Mon Aug  6 11:22:42 2012
@@ -114,7 +114,7 @@ public class TestBasicHeaderValueParser 
     @Test
     public void testNVParseUsingCursor() {
 
-        HeaderValueParser parser = BasicHeaderValueParser.DEFAULT;
+        HeaderValueParser parser = BasicHeaderValueParser.INSTANCE;
 
         String s = "test";
         CharArrayBuffer buffer = new CharArrayBuffer(16);
@@ -274,7 +274,7 @@ public class TestBasicHeaderValueParser 
 
     @Test
     public void testNVParseAllWithCursor() {
-        HeaderValueParser parser = BasicHeaderValueParser.DEFAULT;
+        HeaderValueParser parser = BasicHeaderValueParser.INSTANCE;
 
         String s =
             "test; test1 =  stuff   ; test2 =  \"stuff; stuff\"; test3=\"stuff";

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicLineFormatter.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicLineFormatter.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicLineFormatter.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicLineFormatter.java Mon Aug  6 11:22:42 2012
@@ -52,13 +52,13 @@ public class TestBasicLineFormatter {
     public void testHttpVersionFormattingInvalidInput() throws Exception {
         try {
             BasicLineFormatter.formatProtocolVersion
-                (null, BasicLineFormatter.DEFAULT);
+                (null, BasicLineFormatter.INSTANCE);
             Assert.fail("IllegalArgumentException should habe been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
         }
         try {
-            BasicLineFormatter.DEFAULT.appendProtocolVersion
+            BasicLineFormatter.INSTANCE.appendProtocolVersion
                 (new CharArrayBuffer(10), (HttpVersion) null);
             Assert.fail("IllegalArgumentException should habe been thrown");
         } catch (IllegalArgumentException ex) {
@@ -78,13 +78,13 @@ public class TestBasicLineFormatter {
     public void testRLFormattingInvalidInput() throws Exception {
         try {
             BasicLineFormatter.formatRequestLine
-                (null, BasicLineFormatter.DEFAULT);
+                (null, BasicLineFormatter.INSTANCE);
             Assert.fail("IllegalArgumentException should habe been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
         }
         try {
-            BasicLineFormatter.DEFAULT.formatRequestLine
+            BasicLineFormatter.INSTANCE.formatRequestLine
                 (new CharArrayBuffer(10), (RequestLine) null);
             Assert.fail("IllegalArgumentException should habe been thrown");
         } catch (IllegalArgumentException ex) {
@@ -110,13 +110,13 @@ public class TestBasicLineFormatter {
     public void testSLFormattingInvalidInput() throws Exception {
         try {
             BasicLineFormatter.formatStatusLine
-                (null, BasicLineFormatter.DEFAULT);
+                (null, BasicLineFormatter.INSTANCE);
             Assert.fail("IllegalArgumentException should habe been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
         }
         try {
-            BasicLineFormatter.DEFAULT.formatStatusLine
+            BasicLineFormatter.INSTANCE.formatStatusLine
                 (new CharArrayBuffer(10), (StatusLine) null);
             Assert.fail("IllegalArgumentException should habe been thrown");
         } catch (IllegalArgumentException ex) {
@@ -139,13 +139,13 @@ public class TestBasicLineFormatter {
     public void testHeaderFormattingInvalidInput() throws Exception {
         try {
             BasicLineFormatter.formatHeader
-                (null, BasicLineFormatter.DEFAULT);
+                (null, BasicLineFormatter.INSTANCE);
             Assert.fail("IllegalArgumentException should habe been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
         }
         try {
-            BasicLineFormatter.DEFAULT.formatHeader
+            BasicLineFormatter.INSTANCE.formatHeader
                 (new CharArrayBuffer(10), (Header) null);
             Assert.fail("IllegalArgumentException should habe been thrown");
         } catch (IllegalArgumentException ex) {

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicLineParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicLineParser.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicLineParser.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicLineParser.java Mon Aug  6 11:22:42 2012
@@ -230,7 +230,7 @@ public class TestBasicLineParser {
         buffer.append(s);
         ParserCursor cursor = new ParserCursor(0, s.length());
 
-        LineParser parser = BasicLineParser.DEFAULT;
+        LineParser parser = BasicLineParser.INSTANCE;
 
         HttpVersion version = (HttpVersion) parser.parseProtocolVersion(buffer, cursor);
         Assert.assertEquals("HTTP protocol name", "HTTP", version.getProtocol());

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpClient.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpClient.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpClient.java Mon Aug  6 11:22:42 2012
@@ -66,7 +66,7 @@ public class HttpClient {
     public HttpClient(final HttpProcessor httpproc) {
         super();
         this.httpproc = httpproc;
-        this.connStrategy = new DefaultConnectionReuseStrategy();
+        this.connStrategy = DefaultConnectionReuseStrategy.INSTANCE;
         this.params = new BasicHttpParams();
         this.params
             .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 5000)

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpServer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpServer.java?rev=1369783&r1=1369782&r2=1369783&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpServer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpServer.java Mon Aug  6 11:22:42 2012
@@ -89,8 +89,8 @@ public class HttpServer {
                         new ResponseContent(),
                         new ResponseConnControl()
                 });
-        this.connStrategy = new DefaultConnectionReuseStrategy();
-        this.responseFactory = new DefaultHttpResponseFactory();
+        this.connStrategy = DefaultConnectionReuseStrategy.INSTANCE;
+        this.responseFactory = DefaultHttpResponseFactory.INSTANCE;
         this.reqistry = new HttpRequestHandlerRegistry();
         this.serversocket = new ServerSocket(0);
     }



Mime
View raw message