Rename private methods to make their function clearer

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1353698 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2012-06-25 18:57:26 +00:00
parent 35d3f7ec77
commit 8a45b8bc44
1 changed files with 13 additions and 13 deletions

View File

@ -162,10 +162,10 @@ public class URLEncodedUtils {
String token = scanner.next(); String token = scanner.next();
int i = token.indexOf(NAME_VALUE_SEPARATOR); int i = token.indexOf(NAME_VALUE_SEPARATOR);
if (i != -1) { if (i != -1) {
name = decode(token.substring(0, i).trim(), charset); name = decodeFormFields(token.substring(0, i).trim(), charset);
value = decode(token.substring(i + 1).trim(), charset); value = decodeFormFields(token.substring(i + 1).trim(), charset);
} else { } else {
name = decode(token.trim(), charset); name = decodeFormFields(token.trim(), charset);
} }
parameters.add(new BasicNameValuePair(name, value)); parameters.add(new BasicNameValuePair(name, value));
} }
@ -197,8 +197,8 @@ public class URLEncodedUtils {
NameValuePair nvp = parser.parseNameValuePair(buffer, cursor, DELIM); NameValuePair nvp = parser.parseNameValuePair(buffer, cursor, DELIM);
if (nvp.getName().length() > 0) { if (nvp.getName().length() > 0) {
list.add(new BasicNameValuePair( list.add(new BasicNameValuePair(
decode(nvp.getName(), charset), decodeFormFields(nvp.getName(), charset),
decode(nvp.getValue(), charset))); decodeFormFields(nvp.getValue(), charset)));
} }
} }
return list; return list;
@ -216,8 +216,8 @@ public class URLEncodedUtils {
final String encoding) { final String encoding) {
final StringBuilder result = new StringBuilder(); final StringBuilder result = new StringBuilder();
for (final NameValuePair parameter : parameters) { for (final NameValuePair parameter : parameters) {
final String encodedName = encode(parameter.getName(), encoding); final String encodedName = encodeFormFields(parameter.getName(), encoding);
final String encodedValue = encode(parameter.getValue(), encoding); final String encodedValue = encodeFormFields(parameter.getValue(), encoding);
if (result.length() > 0) { if (result.length() > 0) {
result.append(PARAMETER_SEPARATOR); result.append(PARAMETER_SEPARATOR);
} }
@ -244,8 +244,8 @@ public class URLEncodedUtils {
final Charset charset) { final Charset charset) {
final StringBuilder result = new StringBuilder(); final StringBuilder result = new StringBuilder();
for (final NameValuePair parameter : parameters) { for (final NameValuePair parameter : parameters) {
final String encodedName = encode(parameter.getName(), charset); final String encodedName = encodeFormFields(parameter.getName(), charset);
final String encodedValue = encode(parameter.getValue(), charset); final String encodedValue = encodeFormFields(parameter.getValue(), charset);
if (result.length() > 0) { if (result.length() > 0) {
result.append(PARAMETER_SEPARATOR); result.append(PARAMETER_SEPARATOR);
} }
@ -392,7 +392,7 @@ public class URLEncodedUtils {
* @param charset the charset to use * @param charset the charset to use
* @return * @return
*/ */
private static String decode (final String content, final String charset) { private static String decodeFormFields (final String content, final String charset) {
if (content == null) { if (content == null) {
return null; return null;
} }
@ -406,7 +406,7 @@ public class URLEncodedUtils {
* @param charset the charset to use * @param charset the charset to use
* @return * @return
*/ */
private static String decode (final String content, final Charset charset) { private static String decodeFormFields (final String content, final Charset charset) {
if (content == null) { if (content == null) {
return null; return null;
} }
@ -420,7 +420,7 @@ public class URLEncodedUtils {
* @param charset the charset to use * @param charset the charset to use
* @return * @return
*/ */
private static String encode(final String content, final String charset) { private static String encodeFormFields (final String content, final String charset) {
if (content == null) { if (content == null) {
return null; return null;
} }
@ -435,7 +435,7 @@ public class URLEncodedUtils {
* @param charset the charset to use * @param charset the charset to use
* @return * @return
*/ */
private static String encode(final String content, final Charset charset) { private static String encodeFormFields (final String content, final Charset charset) {
if (content == null) { if (content == null) {
return null; return null;
} }