You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2007/09/10 11:19:47 UTC
svn commit: r574185 - in
/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message:
BasicHeaderValueFormatter.java BasicHeaderValueParser.java
BasicLineFormatter.java BasicLineParser.java
Author: olegk
Date: Mon Sep 10 02:19:47 2007
New Revision: 574185
URL: http://svn.apache.org/viewvc?rev=574185&view=rev
Log:
Minor non-functional changes to make coding style somewhat more consistent within the same java package
Modified:
jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHeaderValueFormatter.java
jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHeaderValueParser.java
jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicLineFormatter.java
jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicLineParser.java
Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHeaderValueFormatter.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHeaderValueFormatter.java?rev=574185&r1=574184&r2=574185&view=diff
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHeaderValueFormatter.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHeaderValueFormatter.java Mon Sep 10 02:19:47 2007
@@ -137,7 +137,7 @@
*
* @return a length estimate, in number of characters
*/
- protected int estimateElementsLen(HeaderElement[] elems) {
+ protected int estimateElementsLen(final HeaderElement[] elems) {
if ((elems == null) || (elems.length < 1))
return 0;
@@ -164,7 +164,7 @@
*/
public final static
String formatHeaderElement(final HeaderElement elem,
- final boolean quote,
+ boolean quote,
HeaderValueFormatter formatter) {
if (formatter == null)
formatter = BasicHeaderValueFormatter.DEFAULT;
@@ -214,7 +214,7 @@
*
* @return a length estimate, in number of characters
*/
- protected int estimateHeaderElementLen(HeaderElement elem) {
+ protected int estimateHeaderElementLen(final HeaderElement elem) {
if (elem == null)
return 0;
@@ -294,7 +294,7 @@
*
* @return a length estimate, in number of characters
*/
- protected int estimateParametersLen(NameValuePair[] nvps) {
+ protected int estimateParametersLen(final NameValuePair[] nvps) {
if ((nvps == null) || (nvps.length < 1))
return 0;
@@ -330,8 +330,8 @@
// non-javadoc, see interface HeaderValueFormatter
public CharArrayBuffer formatNameValuePair(CharArrayBuffer buffer,
- NameValuePair nvp,
- boolean quote) {
+ final NameValuePair nvp,
+ final boolean quote) {
if (nvp == null) {
throw new IllegalArgumentException
("NameValuePair must not be null.");
@@ -362,7 +362,7 @@
*
* @return a length estimate, in number of characters
*/
- protected int estimateNameValuePairLen(NameValuePair nvp) {
+ protected int estimateNameValuePairLen(final NameValuePair nvp) {
if (nvp == null)
return 0;
Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHeaderValueParser.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHeaderValueParser.java?rev=574185&r1=574184&r2=574185&view=diff
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHeaderValueParser.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHeaderValueParser.java Mon Sep 10 02:19:47 2007
@@ -84,13 +84,13 @@
* @return array holding the header elements, never <code>null</code>
*/
public final static
- HeaderElement[] parseElements(String value,
+ HeaderElement[] parseElements(final String value,
HeaderValueParser parser)
throws ParseException {
if (value == null) {
throw new IllegalArgumentException
- ("Value to parse may not be null.");
+ ("Value to parse may not be null");
}
if (parser == null)
@@ -163,13 +163,13 @@
* @return the parsed header element
*/
public final static
- HeaderElement parseHeaderElement(String value,
+ HeaderElement parseHeaderElement(final String value,
HeaderValueParser parser)
throws ParseException {
if (value == null) {
throw new IllegalArgumentException
- ("Value to parse may not be null.");
+ ("Value to parse may not be null");
}
if (parser == null)
@@ -228,13 +228,13 @@
* @return array holding the parameters, never <code>null</code>
*/
public final static
- NameValuePair[] parseParameters(String value,
+ NameValuePair[] parseParameters(final String value,
HeaderValueParser parser)
throws ParseException {
if (value == null) {
throw new IllegalArgumentException
- ("Value to parse may not be null.");
+ ("Value to parse may not be null");
}
if (parser == null)
@@ -308,13 +308,13 @@
* @return the parsed name-value pair
*/
public final static
- NameValuePair parseNameValuePair(String value,
+ NameValuePair parseNameValuePair(final String value,
HeaderValueParser parser)
throws ParseException {
if (value == null) {
throw new IllegalArgumentException
- ("Value to parse may not be null.");
+ ("Value to parse may not be null");
}
if (parser == null)
@@ -388,7 +388,7 @@
*
* @return a name-value pair representing the arguments
*/
- protected NameValuePair createNameValuePair(String name, String value) {
+ protected NameValuePair createNameValuePair(final String name, final String value) {
return new BasicNameValuePair(name, value);
}
Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicLineFormatter.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicLineFormatter.java?rev=574185&r1=574184&r2=574185&view=diff
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicLineFormatter.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicLineFormatter.java Mon Sep 10 02:19:47 2007
@@ -115,11 +115,11 @@
// non-javadoc, see interface LineFormatter
- public CharArrayBuffer appendProtocolVersion(CharArrayBuffer buffer,
- ProtocolVersion version) {
+ public CharArrayBuffer appendProtocolVersion(final CharArrayBuffer buffer,
+ final ProtocolVersion version) {
if (version == null) {
throw new IllegalArgumentException
- ("Protocol version must not be null.");
+ ("Protocol version may not be null");
}
// can't use initBuffer, that would clear the argument!
@@ -150,7 +150,7 @@
* @return the estimated length of the formatted protocol version,
* in characters
*/
- protected int estimateProtocolVersionLen(ProtocolVersion version) {
+ protected int estimateProtocolVersionLen(final ProtocolVersion version) {
return version.getProtocol().length() + 4; // room for "HTTP/1.1"
}
@@ -178,7 +178,7 @@
RequestLine reqline) {
if (reqline == null) {
throw new IllegalArgumentException
- ("Request line must not be null.");
+ ("Request line may not be null");
}
CharArrayBuffer result = initBuffer(buffer);
@@ -196,8 +196,8 @@
* never <code>null</code>
* @param reqline the request line to format, never <code>null</code>
*/
- protected void doFormatRequestLine(CharArrayBuffer buffer,
- RequestLine reqline) {
+ protected void doFormatRequestLine(final CharArrayBuffer buffer,
+ final RequestLine reqline) {
final String method = reqline.getMethod();
final String uri = reqline.getUri();
@@ -234,11 +234,11 @@
// non-javadoc, see interface LineFormatter
- public CharArrayBuffer formatStatusLine(CharArrayBuffer buffer,
- StatusLine statline) {
+ public CharArrayBuffer formatStatusLine(final CharArrayBuffer buffer,
+ final StatusLine statline) {
if (statline == null) {
throw new IllegalArgumentException
- ("Status line must not be null.");
+ ("Status line may not be null");
}
CharArrayBuffer result = initBuffer(buffer);
@@ -256,8 +256,8 @@
* never <code>null</code>
* @param statline the status line to format, never <code>null</code>
*/
- protected void doFormatStatusLine(CharArrayBuffer buffer,
- StatusLine statline) {
+ protected void doFormatStatusLine(final CharArrayBuffer buffer,
+ final StatusLine statline) {
int len = estimateProtocolVersionLen(statline.getProtocolVersion())
+ 1 + 3 + 1; // room for "HTTP/1.1 200 "
@@ -300,7 +300,7 @@
Header header) {
if (header == null) {
throw new IllegalArgumentException
- ("Header must not be null.");
+ ("Header may not be null");
}
CharArrayBuffer result = null;
@@ -324,8 +324,8 @@
* never <code>null</code>
* @param header the header to format, never <code>null</code>
*/
- protected void doFormatHeader(CharArrayBuffer buffer,
- Header header) {
+ protected void doFormatHeader(final CharArrayBuffer buffer,
+ final Header header) {
final String name = header.getName();
final String value = header.getValue();
Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicLineParser.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicLineParser.java?rev=574185&r1=574184&r2=574185&view=diff
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicLineParser.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicLineParser.java Mon Sep 10 02:19:47 2007
@@ -266,7 +266,7 @@
public final static
- RequestLine parseRequestLine(String value,
+ RequestLine parseRequestLine(final String value,
LineParser parser)
throws ParseException {
@@ -347,16 +347,16 @@
*
* @return a new status line with the given data
*/
- protected RequestLine createRequestLine(String method,
- String uri,
- ProtocolVersion ver) {
+ protected RequestLine createRequestLine(final String method,
+ final String uri,
+ final ProtocolVersion ver) {
return new BasicRequestLine(method, uri, ver);
}
public final static
- StatusLine parseStatusLine(String value,
+ StatusLine parseStatusLine(final String value,
LineParser parser)
throws ParseException {
@@ -447,21 +447,22 @@
*
* @return a new status line with the given data
*/
- protected StatusLine createStatusLine(ProtocolVersion ver,
- int status, String reason) {
+ protected StatusLine createStatusLine(final ProtocolVersion ver,
+ final int status,
+ final String reason) {
return new BasicStatusLine(ver, status, reason);
}
public final static
- Header parseHeader(String value,
+ Header parseHeader(final String value,
LineParser parser)
throws ParseException {
if (value == null) {
throw new IllegalArgumentException
- ("Value to parse may not be null.");
+ ("Value to parse may not be null");
}
if (parser == null)
@@ -504,7 +505,7 @@
* if there was no whitespace. It is the end of the buffer if
* the rest of the line is whitespace.
*/
- protected int skipWhitespace(CharArrayBuffer buffer, int index) {
+ protected int skipWhitespace(final CharArrayBuffer buffer, int index) {
while ((index < buffer.length()) &&
HTTP.isWhitespace(buffer.charAt(index))) {
index++;