You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2012/06/20 21:04:12 UTC
svn commit: r1352268 [4/5] - in /commons/proper/codec/trunk/src:
main/java/org/apache/commons/codec/
main/java/org/apache/commons/codec/binary/
main/java/org/apache/commons/codec/digest/
main/java/org/apache/commons/codec/language/ main/java/org/apache...
Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/QCodec.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/QCodec.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/QCodec.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/QCodec.java Wed Jun 20 19:04:08 2012
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -34,23 +34,23 @@ import org.apache.commons.codec.StringEn
* href="http://www.ietf.org/rfc/rfc1521.txt">RFC 1521</a> and designed to allow text containing mostly ASCII
* characters to be decipherable on an ASCII terminal without decoding.
* </p>
- *
+ *
* <p>
* <a href="http://www.ietf.org/rfc/rfc1522.txt">RFC 1522</a> describes techniques to allow the encoding of non-ASCII
* text in various portions of a RFC 822 [2] message header, in a manner which is unlikely to confuse existing message
* handling software.
* </p>
- *
+ *
* This class is conditionally thread-safe.
* The instance field {@link #encodeBlanks} is mutable {@link #setEncodeBlanks(boolean)}
* but is not volatile, and accesses are not synchronised.
* If an instance of the class is shared between threads, the caller needs to ensure that suitable synchronisation
* is used to ensure safe publication of the value between threads, and must not invoke {@link #setEncodeBlanks(boolean)}
- * after initial setup.
- *
+ * after initial setup.
+ *
* @see <a href="http://www.ietf.org/rfc/rfc1522.txt">MIME (Multipurpose Internet Mail Extensions) Part Two: Message
* Header Extensions for Non-ASCII Text</a>
- *
+ *
* @since 1.3
* @version $Id$
*/
@@ -123,10 +123,10 @@ public class QCodec extends RFC1522Codec
/**
* Constructor which allows for the selection of a default charset
- *
+ *
* @param charset
* the default string charset to use.
- *
+ *
* @see <a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
* @since 1.7
*/
@@ -137,7 +137,7 @@ public class QCodec extends RFC1522Codec
/**
* Constructor which allows for the selection of a default charset
- *
+ *
* @param charsetName
* the charset to use.
* @throws UnsupportedCharsetException
@@ -193,19 +193,19 @@ public class QCodec extends RFC1522Codec
}
}
return QuotedPrintableCodec.decodeQuotedPrintable(tmp);
- }
- return QuotedPrintableCodec.decodeQuotedPrintable(bytes);
+ }
+ return QuotedPrintableCodec.decodeQuotedPrintable(bytes);
}
/**
* Encodes a string into its quoted-printable form using the specified charset. Unsafe characters are escaped.
- *
+ *
* @param str
* string to convert to quoted-printable form
* @param charset
* the charset for str
* @return quoted-printable string
- *
+ *
* @throws EncoderException
* thrown if a failure condition is encountered during the encoding process.
* @since 1.7
@@ -219,13 +219,13 @@ public class QCodec extends RFC1522Codec
/**
* Encodes a string into its quoted-printable form using the specified charset. Unsafe characters are escaped.
- *
+ *
* @param str
* string to convert to quoted-printable form
* @param charset
* the charset for str
* @return quoted-printable string
- *
+ *
* @throws EncoderException
* thrown if a failure condition is encountered during the encoding process.
*/
@@ -242,11 +242,11 @@ public class QCodec extends RFC1522Codec
/**
* Encodes a string into its quoted-printable form using the default charset. Unsafe characters are escaped.
- *
+ *
* @param str
* string to convert to quoted-printable form
* @return quoted-printable string
- *
+ *
* @throws EncoderException
* thrown if a failure condition is encountered during the encoding process.
*/
@@ -261,12 +261,12 @@ public class QCodec extends RFC1522Codec
/**
* Decodes a quoted-printable string into its original form. Escaped characters are converted back to their original
* representation.
- *
+ *
* @param str
* quoted-printable string to convert into its original form
- *
+ *
* @return original string
- *
+ *
* @throws DecoderException
* A decoder exception is thrown if a failure condition is encountered during the decode process.
*/
@@ -284,11 +284,11 @@ public class QCodec extends RFC1522Codec
/**
* Encodes an object into its quoted-printable form using the default charset. Unsafe characters are escaped.
- *
+ *
* @param obj
* object to convert to quoted-printable form
* @return quoted-printable object
- *
+ *
* @throws EncoderException
* thrown if a failure condition is encountered during the encoding process.
*/
@@ -299,8 +299,8 @@ public class QCodec extends RFC1522Codec
} else if (obj instanceof String) {
return encode((String) obj);
} else {
- throw new EncoderException("Objects of type " +
- obj.getClass().getName() +
+ throw new EncoderException("Objects of type " +
+ obj.getClass().getName() +
" cannot be encoded using Q codec");
}
}
@@ -308,12 +308,12 @@ public class QCodec extends RFC1522Codec
/**
* Decodes a quoted-printable object into its original form. Escaped characters are converted back to their original
* representation.
- *
+ *
* @param obj
* quoted-printable object to convert into its original form
- *
+ *
* @return original object
- *
+ *
* @throws DecoderException
* Thrown if the argument is not a <code>String</code>. Thrown if a failure condition is
* encountered during the decode process.
@@ -325,15 +325,15 @@ public class QCodec extends RFC1522Codec
} else if (obj instanceof String) {
return decode((String) obj);
} else {
- throw new DecoderException("Objects of type " +
- obj.getClass().getName() +
+ throw new DecoderException("Objects of type " +
+ obj.getClass().getName() +
" cannot be decoded using Q codec");
}
}
/**
* Gets the default charset name used for string decoding and encoding.
- *
+ *
* @return the default charset name
* @since 1.7
*/
@@ -343,7 +343,7 @@ public class QCodec extends RFC1522Codec
/**
* Gets the default charset name used for string decoding and encoding.
- *
+ *
* @return the default charset name
*/
public String getDefaultCharset() {
@@ -352,7 +352,7 @@ public class QCodec extends RFC1522Codec
/**
* Tests if optional transformation of SPACE characters is to be used
- *
+ *
* @return {@code true} if SPACE characters are to be transformed, {@code false} otherwise
*/
public boolean isEncodeBlanks() {
@@ -361,7 +361,7 @@ public class QCodec extends RFC1522Codec
/**
* Defines whether optional transformation of SPACE characters is to be used
- *
+ *
* @param b
* {@code true} if SPACE characters are to be transformed, {@code false} otherwise
*/
Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/QuotedPrintableCodec.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/QuotedPrintableCodec.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/QuotedPrintableCodec.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/QuotedPrintableCodec.java Wed Jun 20 19:04:08 2012
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -44,7 +44,7 @@ import org.apache.commons.codec.binary.S
* to ensure the integrity of the data should the message pass through a character- translating, and/or line-wrapping
* gateway.
* </p>
- *
+ *
* <p>
* Note:
* </p>
@@ -54,12 +54,12 @@ import org.apache.commons.codec.binary.S
* framework is ready. The motivation behind providing the codec in a partial form is that it can already come in handy
* for those applications that do not require quoted-printable line formatting (rules #3, #4, #5), for instance Q codec.
* </p>
- *
+ *
* <p>This class is immutable and thread-safe.</p>
- *
+ *
* @see <a href="http://www.ietf.org/rfc/rfc1521.txt"> RFC 1521 MIME (Multipurpose Internet Mail Extensions) Part One:
* Mechanisms for Specifying and Describing the Format of Internet Message Bodies </a>
- *
+ *
* @since 1.3
* @version $Id$
*/
@@ -101,7 +101,7 @@ public class QuotedPrintableCodec implem
/**
* Constructor which allows for the selection of a default charset
- *
+ *
* @param charset
* the default string charset to use.
* @throws UnsupportedCharsetException
@@ -114,7 +114,7 @@ public class QuotedPrintableCodec implem
/**
* Constructor which allows for the selection of a default charset
- *
+ *
* @param charsetName
* the default string charset to use.
* @throws UnsupportedCharsetException
@@ -127,7 +127,7 @@ public class QuotedPrintableCodec implem
/**
* Encodes byte into its quoted-printable representation.
- *
+ *
* @param b
* byte to encode
* @param buffer
@@ -143,12 +143,12 @@ public class QuotedPrintableCodec implem
/**
* Encodes an array of bytes into an array of quoted-printable 7-bit characters. Unsafe characters are escaped.
- *
+ *
* <p>
* This function implements a subset of quoted-printable encoding specification (rule #1 and rule #2) as defined in
* RFC 1521 and is suitable for encoding binary data and unformatted text.
* </p>
- *
+ *
* @param printable
* bitset of characters deemed quoted-printable
* @param bytes
@@ -180,12 +180,12 @@ public class QuotedPrintableCodec implem
/**
* Decodes an array quoted-printable characters into an array of original bytes. Escaped characters are converted
* back to their original representation.
- *
+ *
* <p>
* This function implements a subset of quoted-printable encoding specification (rule #1 and rule #2) as defined in
* RFC 1521.
* </p>
- *
+ *
* @param bytes
* array of quoted-printable characters
* @return array of original bytes
@@ -216,12 +216,12 @@ public class QuotedPrintableCodec implem
/**
* Encodes an array of bytes into an array of quoted-printable 7-bit characters. Unsafe characters are escaped.
- *
+ *
* <p>
* This function implements a subset of quoted-printable encoding specification (rule #1 and rule #2) as defined in
* RFC 1521 and is suitable for encoding binary data and unformatted text.
* </p>
- *
+ *
* @param bytes
* array of bytes to be encoded
* @return array of bytes containing quoted-printable data
@@ -234,12 +234,12 @@ public class QuotedPrintableCodec implem
/**
* Decodes an array of quoted-printable characters into an array of original bytes. Escaped characters are converted
* back to their original representation.
- *
+ *
* <p>
* This function implements a subset of quoted-printable encoding specification (rule #1 and rule #2) as defined in
* RFC 1521.
* </p>
- *
+ *
* @param bytes
* array of quoted-printable characters
* @return array of original bytes
@@ -253,19 +253,19 @@ public class QuotedPrintableCodec implem
/**
* Encodes a string into its quoted-printable form using the default string charset. Unsafe characters are escaped.
- *
+ *
* <p>
* This function implements a subset of quoted-printable encoding specification (rule #1 and rule #2) as defined in
* RFC 1521 and is suitable for encoding binary data.
* </p>
- *
+ *
* @param str
* string to convert to quoted-printable form
* @return quoted-printable string
- *
+ *
* @throws EncoderException
* Thrown if quoted-printable encoding is unsuccessful
- *
+ *
* @see #getCharset()
*/
@Override
@@ -276,7 +276,7 @@ public class QuotedPrintableCodec implem
/**
* Decodes a quoted-printable string into its original form using the specified string charset. Escaped characters
* are converted back to their original representation.
- *
+ *
* @param str
* quoted-printable string to convert into its original form
* @param charset
@@ -296,7 +296,7 @@ public class QuotedPrintableCodec implem
/**
* Decodes a quoted-printable string into its original form using the specified string charset. Escaped characters
* are converted back to their original representation.
- *
+ *
* @param str
* quoted-printable string to convert into its original form
* @param charset
@@ -317,7 +317,7 @@ public class QuotedPrintableCodec implem
/**
* Decodes a quoted-printable string into its original form using the default string charset. Escaped characters are
* converted back to their original representation.
- *
+ *
* @param str
* quoted-printable string to convert into its original form
* @return original string
@@ -333,7 +333,7 @@ public class QuotedPrintableCodec implem
/**
* Encodes an object into its quoted-printable safe form. Unsafe characters are escaped.
- *
+ *
* @param obj
* string to convert to a quoted-printable form
* @return quoted-printable object
@@ -350,8 +350,8 @@ public class QuotedPrintableCodec implem
} else if (obj instanceof String) {
return encode((String) obj);
} else {
- throw new EncoderException("Objects of type " +
- obj.getClass().getName() +
+ throw new EncoderException("Objects of type " +
+ obj.getClass().getName() +
" cannot be quoted-printable encoded");
}
}
@@ -359,7 +359,7 @@ public class QuotedPrintableCodec implem
/**
* Decodes a quoted-printable object into its original form. Escaped characters are converted back to their original
* representation.
- *
+ *
* @param obj
* quoted-printable object to convert into its original form
* @return original object
@@ -376,15 +376,15 @@ public class QuotedPrintableCodec implem
} else if (obj instanceof String) {
return decode((String) obj);
} else {
- throw new DecoderException("Objects of type " +
- obj.getClass().getName() +
+ throw new DecoderException("Objects of type " +
+ obj.getClass().getName() +
" cannot be quoted-printable decoded");
}
}
/**
* Gets the default charset name used for string decoding and encoding.
- *
+ *
* @return the default charset name
* @since 1.7
*/
@@ -394,7 +394,7 @@ public class QuotedPrintableCodec implem
/**
* Gets the default charset name used for string decoding and encoding.
- *
+ *
* @return the default charset name
*/
public String getDefaultCharset() {
@@ -403,12 +403,12 @@ public class QuotedPrintableCodec implem
/**
* Encodes a string into its quoted-printable form using the specified charset. Unsafe characters are escaped.
- *
+ *
* <p>
* This function implements a subset of quoted-printable encoding specification (rule #1 and rule #2) as defined in
* RFC 1521 and is suitable for encoding binary data and unformatted text.
* </p>
- *
+ *
* @param str
* string to convert to quoted-printable form
* @param charset
@@ -425,18 +425,18 @@ public class QuotedPrintableCodec implem
/**
* Encodes a string into its quoted-printable form using the specified charset. Unsafe characters are escaped.
- *
+ *
* <p>
* This function implements a subset of quoted-printable encoding specification (rule #1 and rule #2) as defined in
* RFC 1521 and is suitable for encoding binary data and unformatted text.
* </p>
- *
+ *
* @param str
* string to convert to quoted-printable form
* @param charset
* the charset for str
* @return quoted-printable string
- *
+ *
* @throws UnsupportedEncodingException
* Thrown if the charset is not supported
*/
Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/RFC1522Codec.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/RFC1522Codec.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/RFC1522Codec.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/RFC1522Codec.java Wed Jun 20 19:04:08 2012
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,10 +28,10 @@ import org.apache.commons.codec.binary.S
* <p>
* Implements methods common to all codecs defined in RFC 1522.
* </p>
- *
+ *
* <p>
- * <a href="http://www.ietf.org/rfc/rfc1522.txt">RFC 1522</a>
- * describes techniques to allow the encoding of non-ASCII text in
+ * <a href="http://www.ietf.org/rfc/rfc1522.txt">RFC 1522</a>
+ * describes techniques to allow the encoding of non-ASCII text in
* various portions of a RFC 822 [2] message header, in a manner which
* is unlikely to confuse existing message handling software.
* </p>
@@ -40,14 +40,14 @@ import org.apache.commons.codec.binary.S
* MIME (Multipurpose Internet Mail Extensions) Part Two:
* Message Header Extensions for Non-ASCII Text</a>
* </p>
- *
+ *
* <p>This class is immutable and thread-safe.</p>
- *
+ *
* @since 1.3
* @version $Id$
*/
abstract class RFC1522Codec {
-
+
/**
* Separator.
*/
@@ -64,79 +64,79 @@ abstract class RFC1522Codec {
protected static final String PREFIX = "=?";
/**
- * Applies an RFC 1522 compliant encoding scheme to the given string of text with the
- * given charset. This method constructs the "encoded-word" header common to all the
- * RFC 1522 codecs and then invokes {@link #doEncoding(byte [])} method of a concrete
+ * Applies an RFC 1522 compliant encoding scheme to the given string of text with the
+ * given charset. This method constructs the "encoded-word" header common to all the
+ * RFC 1522 codecs and then invokes {@link #doEncoding(byte [])} method of a concrete
* class to perform the specific encoding.
- *
+ *
* @param text a string to encode
* @param charset a charset to be used
- *
+ *
* @return RFC 1522 compliant "encoded-word"
- *
- * @throws EncoderException thrown if there is an error condition during the Encoding
+ *
+ * @throws EncoderException thrown if there is an error condition during the Encoding
* process.
* @see <a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
*/
protected String encodeText(final String text, final Charset charset)
- throws EncoderException
+ throws EncoderException
{
if (text == null) {
return null;
}
StringBuilder buffer = new StringBuilder();
- buffer.append(PREFIX);
+ buffer.append(PREFIX);
buffer.append(charset);
buffer.append(SEP);
buffer.append(this.getEncoding());
buffer.append(SEP);
- byte [] rawData = this.doEncoding(text.getBytes(charset));
+ byte [] rawData = this.doEncoding(text.getBytes(charset));
buffer.append(StringUtils.newStringUsAscii(rawData));
- buffer.append(POSTFIX);
+ buffer.append(POSTFIX);
return buffer.toString();
}
-
+
/**
- * Applies an RFC 1522 compliant encoding scheme to the given string of text with the
- * given charset. This method constructs the "encoded-word" header common to all the
- * RFC 1522 codecs and then invokes {@link #doEncoding(byte [])} method of a concrete
+ * Applies an RFC 1522 compliant encoding scheme to the given string of text with the
+ * given charset. This method constructs the "encoded-word" header common to all the
+ * RFC 1522 codecs and then invokes {@link #doEncoding(byte [])} method of a concrete
* class to perform the specific encoding.
- *
+ *
* @param text a string to encode
* @param charsetName the charset to use
- *
+ *
* @return RFC 1522 compliant "encoded-word"
- *
- * @throws EncoderException thrown if there is an error condition during the Encoding
+ *
+ * @throws EncoderException thrown if there is an error condition during the Encoding
* process.
- * @throws UnsupportedEncodingException if charset is not available
- *
+ * @throws UnsupportedEncodingException if charset is not available
+ *
* @see <a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
*/
protected String encodeText(final String text, final String charsetName)
- throws EncoderException, UnsupportedEncodingException
+ throws EncoderException, UnsupportedEncodingException
{
if (text == null) {
return null;
}
return this.encodeText(text, Charset.forName(charsetName));
}
-
+
/**
- * Applies an RFC 1522 compliant decoding scheme to the given string of text. This method
- * processes the "encoded-word" header common to all the RFC 1522 codecs and then invokes
+ * Applies an RFC 1522 compliant decoding scheme to the given string of text. This method
+ * processes the "encoded-word" header common to all the RFC 1522 codecs and then invokes
* {@link #doEncoding(byte [])} method of a concrete class to perform the specific decoding.
- *
+ *
* @param text a string to decode
* @return A new decoded String or {@code null} if the input is {@code null}.
- *
- * @throws DecoderException thrown if there is an error condition during the decoding
+ *
+ * @throws DecoderException thrown if there is an error condition during the decoding
* process.
- * @throws UnsupportedEncodingException thrown if charset specified in the "encoded-word"
- * header is not supported
+ * @throws UnsupportedEncodingException thrown if charset specified in the "encoded-word"
+ * header is not supported
*/
protected String decodeText(final String text)
- throws DecoderException, UnsupportedEncodingException
+ throws DecoderException, UnsupportedEncodingException
{
if (text == null) {
return null;
@@ -161,44 +161,44 @@ abstract class RFC1522Codec {
}
String encoding = text.substring(from, to);
if (!getEncoding().equalsIgnoreCase(encoding)) {
- throw new DecoderException("This codec cannot decode " +
+ throw new DecoderException("This codec cannot decode " +
encoding + " encoded content");
}
from = to + 1;
to = text.indexOf(SEP, from);
byte[] data = StringUtils.getBytesUsAscii(text.substring(from, to));
- data = doDecoding(data);
+ data = doDecoding(data);
return new String(data, charset);
}
/**
* Returns the codec name (referred to as encoding in the RFC 1522)
- *
+ *
* @return name of the codec
- */
+ */
protected abstract String getEncoding();
/**
* Encodes an array of bytes using the defined encoding scheme
- *
+ *
* @param bytes Data to be encoded
*
* @return A byte array containing the encoded data
- *
- * @throws EncoderException thrown if the Encoder encounters a failure condition
+ *
+ * @throws EncoderException thrown if the Encoder encounters a failure condition
* during the encoding process.
- */
+ */
protected abstract byte[] doEncoding(byte[] bytes) throws EncoderException;
/**
* Decodes an array of bytes using the defined encoding scheme
- *
+ *
* @param bytes Data to be decoded
*
* @return a byte array that contains decoded data
- *
- * @throws DecoderException A decoder exception is thrown if a Decoder encounters a
+ *
+ * @throws DecoderException A decoder exception is thrown if a Decoder encounters a
* failure condition during the decode process.
- */
+ */
protected abstract byte[] doDecoding(byte[] bytes) throws DecoderException;
}
Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/URLCodec.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/URLCodec.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/URLCodec.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/URLCodec.java Wed Jun 20 19:04:08 2012
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,36 +31,36 @@ import org.apache.commons.codec.StringEn
import org.apache.commons.codec.binary.StringUtils;
/**
- * <p>Implements the 'www-form-urlencoded' encoding scheme,
+ * <p>Implements the 'www-form-urlencoded' encoding scheme,
* also misleadingly known as URL encoding.</p>
- *
- * <p>For more detailed information please refer to
+ *
+ * <p>For more detailed information please refer to
* <a href="http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1">
- * Chapter 17.13.4 'Form content types'</a> of the
+ * Chapter 17.13.4 'Form content types'</a> of the
* <a href="http://www.w3.org/TR/html4/">HTML 4.01 Specification<a></p>
- *
- * <p>
+ *
+ * <p>
* This codec is meant to be a replacement for standard Java classes
- * {@link java.net.URLEncoder} and {@link java.net.URLDecoder}
- * on older Java platforms, as these classes in Java versions below
+ * {@link java.net.URLEncoder} and {@link java.net.URLDecoder}
+ * on older Java platforms, as these classes in Java versions below
* 1.4 rely on the platform's default charset encoding.
* </p>
- *
+ *
* <p>This class is immutable and thread-safe.</p>
- *
+ *
* @since 1.2
* @version $Id$
*/
public class URLCodec implements BinaryEncoder, BinaryDecoder, StringEncoder, StringDecoder {
-
+
/**
* Radix used in encoding and decoding.
*/
static final int RADIX = 16;
-
+
/**
* The default charset used for string decoding and encoding.
- *
+ *
* @deprecated TODO: This field will be changed to a private final Charset in 2.0.
*/
@Deprecated
@@ -74,7 +74,7 @@ public class URLCodec implements BinaryE
* BitSet of www-form-url safe characters.
*/
protected static final BitSet WWW_FORM_URL = new BitSet(256);
-
+
// Static initializer for www_form_url
static {
// alpha characters
@@ -107,7 +107,7 @@ public class URLCodec implements BinaryE
/**
* Constructor which allows for the selection of a default charset
- *
+ *
* @param charset the default string charset to use.
*/
public URLCodec(String charset) {
@@ -117,7 +117,7 @@ public class URLCodec implements BinaryE
/**
* Encodes an array of bytes into an array of URL safe 7-bit characters. Unsafe characters are escaped.
- *
+ *
* @param urlsafe
* bitset of characters deemed URL safe
* @param bytes
@@ -155,12 +155,12 @@ public class URLCodec implements BinaryE
}
/**
- * Decodes an array of URL safe 7-bit characters into an array of
- * original bytes. Escaped characters are converted back to their
+ * Decodes an array of URL safe 7-bit characters into an array of
+ * original bytes. Escaped characters are converted back to their
* original representation.
*
* @param bytes array of URL safe characters
- * @return array of original bytes
+ * @return array of original bytes
* @throws DecoderException Thrown if URL decoding is unsuccessful
*/
public static final byte[] decodeUrl(byte[] bytes) throws DecoderException {
@@ -188,7 +188,7 @@ public class URLCodec implements BinaryE
}
/**
- * Encodes an array of bytes into an array of URL safe 7-bit
+ * Encodes an array of bytes into an array of URL safe 7-bit
* characters. Unsafe characters are escaped.
*
* @param bytes array of bytes to convert to URL safe characters
@@ -201,12 +201,12 @@ public class URLCodec implements BinaryE
/**
- * Decodes an array of URL safe 7-bit characters into an array of
- * original bytes. Escaped characters are converted back to their
+ * Decodes an array of URL safe 7-bit characters into an array of
+ * original bytes. Escaped characters are converted back to their
* original representation.
*
* @param bytes array of URL safe characters
- * @return array of original bytes
+ * @return array of original bytes
* @throws DecoderException Thrown if URL decoding is unsuccessful
*/
@Override
@@ -216,7 +216,7 @@ public class URLCodec implements BinaryE
/**
* Encodes a string into its URL safe form using the specified string charset. Unsafe characters are escaped.
- *
+ *
* @param str
* string to convert to a URL safe form
* @param charset
@@ -233,13 +233,13 @@ public class URLCodec implements BinaryE
}
/**
- * Encodes a string into its URL safe form using the default string
+ * Encodes a string into its URL safe form using the default string
* charset. Unsafe characters are escaped.
*
* @param str string to convert to a URL safe form
* @return URL safe string
* @throws EncoderException Thrown if URL encoding is unsuccessful
- *
+ *
* @see #getDefaultCharset()
*/
@Override
@@ -256,16 +256,16 @@ public class URLCodec implements BinaryE
/**
- * Decodes a URL safe string into its original form using the
- * specified encoding. Escaped characters are converted back
+ * Decodes a URL safe string into its original form using the
+ * specified encoding. Escaped characters are converted back
* to their original representation.
*
* @param str URL safe string to convert into its original form
* @param charset the original string charset
- * @return original string
+ * @return original string
* @throws DecoderException Thrown if URL decoding is unsuccessful
* @throws UnsupportedEncodingException Thrown if charset is not
- * supported
+ * supported
*/
public String decode(String str, String charset) throws DecoderException, UnsupportedEncodingException {
if (str == null) {
@@ -276,13 +276,13 @@ public class URLCodec implements BinaryE
/**
* Decodes a URL safe string into its original form using the default
- * string charset. Escaped characters are converted back to their
+ * string charset. Escaped characters are converted back to their
* original representation.
*
* @param str URL safe string to convert into its original form
- * @return original string
+ * @return original string
* @throws DecoderException Thrown if URL decoding is unsuccessful
- *
+ *
* @see #getDefaultCharset()
*/
@Override
@@ -298,12 +298,12 @@ public class URLCodec implements BinaryE
}
/**
- * Encodes an object into its URL safe form. Unsafe characters are
+ * Encodes an object into its URL safe form. Unsafe characters are
* escaped.
*
* @param obj string to convert to a URL safe form
* @return URL safe object
- * @throws EncoderException Thrown if URL encoding is not
+ * @throws EncoderException Thrown if URL encoding is not
* applicable to objects of this type or
* if encoding is unsuccessful
*/
@@ -317,15 +317,15 @@ public class URLCodec implements BinaryE
return encode((String)obj);
} else {
throw new EncoderException("Objects of type " +
- obj.getClass().getName() + " cannot be URL encoded");
-
+ obj.getClass().getName() + " cannot be URL encoded");
+
}
}
/**
* Decodes a URL safe object into its original form. Escaped characters are converted back to their original
* representation.
- *
+ *
* @param obj
* URL safe object to convert into its original form
* @return original object
@@ -358,9 +358,9 @@ public class URLCodec implements BinaryE
/**
* The <code>String</code> encoding used for decoding and encoding.
- *
+ *
* @return Returns the encoding.
- *
+ *
* @deprecated Use {@link #getDefaultCharset()}, will be removed in 2.0.
*/
@Deprecated
Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/Utils.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/Utils.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/Utils.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/Utils.java Wed Jun 20 19:04:08 2012
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -21,9 +21,9 @@ import org.apache.commons.codec.DecoderE
/**
* Utility methods for this package.
- *
+ *
* <p>This class is immutable and thread-safe.</p>
- *
+ *
* @version $Id$
* @since 1.4
*/
@@ -31,11 +31,11 @@ class Utils {
/**
* Returns the numeric value of the character <code>b</code> in radix 16.
- *
+ *
* @param b
* The byte to be converted.
* @return The numeric value represented by the character in radix 16.
- *
+ *
* @throws DecoderException
* Thrown when the byte is not valid per {@link Character#digit(char,int)}
*/
Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/BinaryEncoderAbstractTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/BinaryEncoderAbstractTest.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/BinaryEncoderAbstractTest.java (original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/BinaryEncoderAbstractTest.java Wed Jun 20 19:04:08 2012
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/CharEncodingTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/CharEncodingTest.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/CharEncodingTest.java (original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/CharEncodingTest.java Wed Jun 20 19:04:08 2012
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,7 +23,7 @@ import org.junit.Test;
/**
* Sanity checks for {@link CharEncoding}.
- *
+ *
* @version $Id$
*/
public class CharEncodingTest {
Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/CharsetsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/CharsetsTest.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/CharsetsTest.java (original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/CharsetsTest.java Wed Jun 20 19:04:08 2012
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -25,7 +25,7 @@ import org.junit.Test;
/**
* Sanity checks for {@link Charsets}.
- *
+ *
* @version $Id: CharEncodingTest.java 1298985 2012-03-09 19:12:49Z ggregory $
*/
public class CharsetsTest {
Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/DecoderExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/DecoderExceptionTest.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/DecoderExceptionTest.java (original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/DecoderExceptionTest.java Wed Jun 20 19:04:08 2012
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -24,7 +24,7 @@ import org.junit.Test;
/**
* Tests {@link DecoderException}.
- *
+ *
* @version $Id$
*/
public class DecoderExceptionTest {
Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/EncoderExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/EncoderExceptionTest.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/EncoderExceptionTest.java (original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/EncoderExceptionTest.java Wed Jun 20 19:04:08 2012
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -24,7 +24,7 @@ import org.junit.Test;
/**
* Tests {@link EncoderException}.
- *
+ *
* @version $Id$
*/
public class EncoderExceptionTest {
Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/StringEncoderAbstractTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/StringEncoderAbstractTest.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/StringEncoderAbstractTest.java (original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/StringEncoderAbstractTest.java Wed Jun 20 19:04:08 2012
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/StringEncoderComparatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/StringEncoderComparatorTest.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/StringEncoderComparatorTest.java (original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/StringEncoderComparatorTest.java Wed Jun 20 19:04:08 2012
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -30,21 +30,21 @@ import org.junit.Test;
/**
* Test cases for the StingEncoderComparator.
- *
+ *
* @version $Id$
*/
public class StringEncoderComparatorTest {
@Test
public void testComparatorWithSoundex() throws Exception {
- StringEncoderComparator sCompare =
+ StringEncoderComparator sCompare =
new StringEncoderComparator( new Soundex() );
assertTrue( "O'Brien and O'Brian didn't come out with " +
"the same Soundex, something must be wrong here",
0 == sCompare.compare( "O'Brien", "O'Brian" ) );
}
-
+
@Test
public void testComparatorWithDoubleMetaphone() throws Exception {
StringEncoderComparator sCompare = new StringEncoderComparator(new DoubleMetaphone());
@@ -67,9 +67,9 @@ public class StringEncoderComparatorTest
public void testComparatorWithDoubleMetaphoneAndInvalidInput() throws Exception {
StringEncoderComparator sCompare =
new StringEncoderComparator( new DoubleMetaphone() );
-
+
int compare = sCompare.compare(new Double(3.0), Long.valueOf(3));
assertEquals( "Trying to compare objects that make no sense to the underlying encoder should return a zero compare code",
- 0, compare);
+ 0, compare);
}
}
Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base32InputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base32InputStreamTest.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base32InputStreamTest.java (original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base32InputStreamTest.java Wed Jun 20 19:04:08 2012
@@ -100,15 +100,15 @@ public class Base32InputStreamTest {
/**
* Another test for the CODEC-101 bug: In commons-codec-1.4 this test shows InputStreamReader explicitly hating an
* InputStream.read(byte[]) return of 0:
- *
+ *
* java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:268) at
* sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158) at
* java.io.InputStreamReader.read(InputStreamReader.java:167) at java.io.BufferedReader.fill(BufferedReader.java:136) at
* java.io.BufferedReader.readLine(BufferedReader.java:299) at java.io.BufferedReader.readLine(BufferedReader.java:362) at
* org.apache.commons.codec.binary.Base32InputStreamTest.testInputStreamReader(Base32InputStreamTest.java:75)
- *
+ *
* But in commons-codec-1.5 it's fixed. :-)
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -125,7 +125,7 @@ public class Base32InputStreamTest {
/**
* Test the Base32InputStream implementation against the special NPE inducing input identified in the CODEC-98 bug.
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -146,7 +146,7 @@ public class Base32InputStreamTest {
/**
* Tests skipping past the end of a stream.
- *
+ *
* @throws Throwable
*/
@Test
@@ -164,7 +164,7 @@ public class Base32InputStreamTest {
/**
* Tests the Base32InputStream implementation against empty input.
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -175,7 +175,7 @@ public class Base32InputStreamTest {
/**
* Tests the Base32InputStream implementation against empty input.
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -193,7 +193,7 @@ public class Base32InputStreamTest {
/**
* Tests the Base32InputStream implementation.
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -232,7 +232,7 @@ public class Base32InputStreamTest {
/**
* Tests the Base32InputStream implementation.
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -270,7 +270,7 @@ public class Base32InputStreamTest {
* <p/>
* By "[WRAP-WRAP-WRAP-etc...]" we mean situation where the Base32InputStream wraps itself in encode and decode mode over and over
* again.
- *
+ *
* @param encoded
* base32 encoded data
* @param decoded
@@ -321,7 +321,7 @@ public class Base32InputStreamTest {
* <p/>
* By "[WRAP-WRAP-WRAP-etc...]" we mean situation where the Base32InputStream wraps itself in encode and decode mode over and over
* again.
- *
+ *
* @param encoded
* base32 encoded data
* @param decoded
@@ -377,7 +377,7 @@ public class Base32InputStreamTest {
/**
* Tests markSupported.
- *
+ *
* @throws Exception
*/
@Test
@@ -391,7 +391,7 @@ public class Base32InputStreamTest {
/**
* Tests read returning 0
- *
+ *
* @throws Exception
*/
@Test
@@ -407,7 +407,7 @@ public class Base32InputStreamTest {
/**
* Tests read with null.
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -426,7 +426,7 @@ public class Base32InputStreamTest {
/**
* Tests read throwing IndexOutOfBoundsException
- *
+ *
* @throws Exception
*/
@Test
@@ -467,7 +467,7 @@ public class Base32InputStreamTest {
/**
* Tests skipping as a noop
- *
+ *
* @throws Throwable
*/
@Test
@@ -484,7 +484,7 @@ public class Base32InputStreamTest {
/**
* Tests skipping number of characters larger than the internal buffer.
- *
+ *
* @throws Throwable
*/
@Test
@@ -499,7 +499,7 @@ public class Base32InputStreamTest {
/**
* Tests skipping past the end of a stream.
- *
+ *
* @throws Throwable
*/
@Test
@@ -515,7 +515,7 @@ public class Base32InputStreamTest {
/**
* Tests skipping to the end of a stream.
- *
+ *
* @throws Throwable
*/
@Test
Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base32OutputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base32OutputStreamTest.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base32OutputStreamTest.java (original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base32OutputStreamTest.java Wed Jun 20 19:04:08 2012
@@ -32,7 +32,7 @@ public class Base32OutputStreamTest {
private final static byte[] LF = {(byte) '\n'};
-
+
// /**
// * Test the Base32OutputStream implementation against the special NPE inducing input
@@ -56,11 +56,11 @@ public class Base32OutputStreamTest {
// "codec-98 NPE Base32OutputStream", Base32TestData.CODEC_98_NPE_DECODED, decoded
// );
// }
-
+
/**
* Test the Base32OutputStream implementation against empty input.
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -71,7 +71,7 @@ public class Base32OutputStreamTest {
/**
* Test the Base32OutputStream implementation against empty input.
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -89,7 +89,7 @@ public class Base32OutputStreamTest {
/**
* Test the Base32OutputStream implementation
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -124,7 +124,7 @@ public class Base32OutputStreamTest {
/**
* Test the Base32OutputStream implementation
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -163,7 +163,7 @@ public class Base32OutputStreamTest {
* <p/>
* By "[WRAP-WRAP-WRAP-etc...]" we mean situation where the Base32OutputStream wraps itself in encode and decode
* mode over and over again.
- *
+ *
* @param encoded
* Base32 encoded data
* @param decoded
@@ -213,7 +213,7 @@ public class Base32OutputStreamTest {
* <p/>
* By "[WRAP-WRAP-WRAP-etc...]" we mean situation where the Base32OutputStream wraps itself in encode and decode
* mode over and over again.
- *
+ *
* @param encoded
* Base32 encoded data
* @param decoded
@@ -276,7 +276,7 @@ public class Base32OutputStreamTest {
/**
* Tests Base32OutputStream.write for expected IndexOutOfBoundsException conditions.
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -317,7 +317,7 @@ public class Base32OutputStreamTest {
/**
* Tests Base32OutputStream.write(null).
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base32Test.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base32Test.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base32Test.java (original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base32Test.java Wed Jun 20 19:04:08 2012
@@ -13,7 +13,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
+ *
*/
package org.apache.commons.codec.binary;
@@ -27,7 +27,7 @@ import org.apache.commons.codec.Charsets
import org.junit.Test;
public class Base32Test {
-
+
private static final String [][] BASE32_TEST_CASES = { // RFC 4648
{"" ,""},
{"f" ,"MY======"},
@@ -80,7 +80,7 @@ public class Base32Test {
Base32 codec = new Base32(20);
for (String[] element : BASE32_TEST_CASES_CHUNKED) {
assertEquals(element[1], codec.encodeAsString(element[0].getBytes(Charsets.UTF_8)));
- }
+ }
}
@Test
@@ -122,7 +122,7 @@ public class Base32Test {
//assertEquals(b[0],codec.decode(b[1]));
}
}
-
+
@Test
public void testRandomBytesHex() {
for (int i = 0; i < 20; i++) {
Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base32TestData.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base32TestData.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base32TestData.java (original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base32TestData.java Wed Jun 20 19:04:08 2012
@@ -24,7 +24,7 @@ import java.util.Random;
/**
* This random data was encoded by OpenSSL. Java had nothing to do with it. This data helps us test interop between
* Commons-Codec and OpenSSL. Notice that OpenSSL creates 64 character lines instead of the 76 of Commons-Codec.
- *
+ *
* @see <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>
* @version $Id $
* @since 1.4
@@ -94,10 +94,10 @@ public class Base32TestData {
/**
* Returns an encoded and decoded copy of the same random data.
- *
+ *
* @param codec the codec to use
* @param size amount of random data to generate and encode
- * @return two byte[] arrays: [0] = decoded, [1] = encoded
+ * @return two byte[] arrays: [0] = decoded, [1] = encoded
*/
static byte[][] randomData(BaseNCodec codec, int size) {
Random r = new Random();
Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64Codec13Test.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64Codec13Test.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64Codec13Test.java (original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64Codec13Test.java Wed Jun 20 19:04:08 2012
@@ -150,7 +150,7 @@ public class Base64Codec13Test {
s[180] = "hN4+x/sK9FRZn5llaw7/XDGwht3BcIxAFP4JoGqVQCw8c5IOlSqKEOViYss1mnvko6kVrc2iMEA8h8RssJ4dJBpFDZ/bkehCyhQmWpspZtAvRN59mj6nx0SBglYGccPyrn3e0uvvGJ5nYmjTA7gqB0Y+FFGAYwgAO345ipxTrMFsnJ8a913GzpobJdcHiw5hfqYK2iqo8STzVljaGMc5WSzP69vFDTHSS39YSfbE890TPBgm";
}
- /* These are chunked versions of the strings above (chunked by commons-codec-1.3.jar) */
+ /* These are chunked versions of the strings above (chunked by commons-codec-1.3.jar) */
private static void initCHUNKED_STRINGS() {
String[] c = CHUNKED_STRINGS;
c[0] = "";
@@ -358,7 +358,7 @@ public class Base64Codec13Test {
/**
* Tests to make sure Base64's implementation of the org.apache.commons.codec.Encoder
* interface is behaving identical to commons-codec-1.3.jar.
- *
+ *
* @throws EncoderException problem
*/
@Test
@@ -379,7 +379,7 @@ public class Base64Codec13Test {
* interface is behaving identical to commons-codec-1.3.jar.
*
* @throws DecoderException problem
- */
+ */
@Test
public void testDecoder() throws DecoderException {
Decoder dec = new Base64();
@@ -398,7 +398,7 @@ public class Base64Codec13Test {
* interface is behaving identical to commons-codec-1.3.jar.
*
* @throws EncoderException problem
- */
+ */
@Test
public void testBinaryEncoder() throws EncoderException {
BinaryEncoder enc = new Base64();
@@ -417,7 +417,7 @@ public class Base64Codec13Test {
* interface is behaving identical to commons-codec-1.3.jar.
*
* @throws DecoderException problem
- */
+ */
@Test
public void testBinaryDecoder() throws DecoderException {
BinaryDecoder dec = new Base64();
@@ -436,7 +436,7 @@ public class Base64Codec13Test {
* static method is behaving identical to commons-codec-1.3.jar.
*
* @throws EncoderException problem
- */
+ */
@Test
public void testStaticEncode() throws EncoderException {
for (int i = 0; i < STRINGS.length; i++) {
@@ -454,7 +454,7 @@ public class Base64Codec13Test {
* static method is behaving identical to commons-codec-1.3.jar.
*
* @throws DecoderException problem
- */
+ */
@Test
public void testStaticDecode() throws DecoderException {
for (int i = 0; i < STRINGS.length; i++) {
@@ -472,7 +472,7 @@ public class Base64Codec13Test {
* static method is behaving identical to commons-codec-1.3.jar.
*
* @throws EncoderException problem
- */
+ */
@Test
public void testStaticEncodeChunked() throws EncoderException {
for (int i = 0; i < STRINGS.length; i++) {
@@ -491,7 +491,7 @@ public class Base64Codec13Test {
* supplied with chunked input.
*
* @throws DecoderException problem
- */
+ */
@Test
public void testStaticDecodeChunked() throws DecoderException {
for (int i = 0; i < STRINGS.length; i++) {
@@ -509,7 +509,7 @@ public class Base64Codec13Test {
// We would use commons-codec-1.4.jar own utility method for this, but we
// need this class to be able to run against commons-codec-1.3.jar, hence the
// duplication here.
-
+
return s != null ? s.getBytes(Charsets.UTF_8) : null;
}
}
Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64InputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64InputStreamTest.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64InputStreamTest.java (original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64InputStreamTest.java Wed Jun 20 19:04:08 2012
@@ -90,7 +90,7 @@ public class Base64InputStreamTest {
/**
* Test for the CODEC-101 bug: InputStream.read(byte[]) should never return 0 because Java's builtin InputStreamReader hates that.
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -110,15 +110,15 @@ public class Base64InputStreamTest {
/**
* Another test for the CODEC-101 bug: In commons-codec-1.4 this test shows InputStreamReader explicitly hating an
* InputStream.read(byte[]) return of 0:
- *
+ *
* java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:268) at
* sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158) at
* java.io.InputStreamReader.read(InputStreamReader.java:167) at java.io.BufferedReader.fill(BufferedReader.java:136) at
* java.io.BufferedReader.readLine(BufferedReader.java:299) at java.io.BufferedReader.readLine(BufferedReader.java:362) at
* org.apache.commons.codec.binary.Base64InputStreamTest.testInputStreamReader(Base64InputStreamTest.java:75)
- *
+ *
* But in commons-codec-1.5 it's fixed. :-)
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -135,7 +135,7 @@ public class Base64InputStreamTest {
/**
* Test the Base64InputStream implementation against the special NPE inducing input identified in the CODEC-98 bug.
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -172,7 +172,7 @@ public class Base64InputStreamTest {
/**
* Tests the Base64InputStream implementation against empty input.
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -183,7 +183,7 @@ public class Base64InputStreamTest {
/**
* Tests the Base64InputStream implementation against empty input.
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -201,7 +201,7 @@ public class Base64InputStreamTest {
/**
* Tests the Base64InputStream implementation.
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -239,7 +239,7 @@ public class Base64InputStreamTest {
/**
* Tests the Base64InputStream implementation.
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -281,7 +281,7 @@ public class Base64InputStreamTest {
* <p/>
* By "[WRAP-WRAP-WRAP-etc...]" we mean situation where the Base64InputStream wraps itself in encode and decode mode over and over
* again.
- *
+ *
* @param encoded
* base64 encoded data
* @param decoded
@@ -332,7 +332,7 @@ public class Base64InputStreamTest {
* <p/>
* By "[WRAP-WRAP-WRAP-etc...]" we mean situation where the Base64InputStream wraps itself in encode and decode mode over and over
* again.
- *
+ *
* @param encoded
* base64 encoded data
* @param decoded
@@ -388,7 +388,7 @@ public class Base64InputStreamTest {
/**
* Tests markSupported.
- *
+ *
* @throws Exception
*/
@Test
@@ -402,7 +402,7 @@ public class Base64InputStreamTest {
/**
* Tests read returning 0
- *
+ *
* @throws Exception
*/
@Test
@@ -418,7 +418,7 @@ public class Base64InputStreamTest {
/**
* Tests read with null.
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -437,7 +437,7 @@ public class Base64InputStreamTest {
/**
* Tests read throwing IndexOutOfBoundsException
- *
+ *
* @throws Exception
*/
@Test
@@ -493,7 +493,7 @@ public class Base64InputStreamTest {
/**
* Tests skipping as a noop
- *
+ *
* @throws Throwable
*/
@Test
@@ -510,7 +510,7 @@ public class Base64InputStreamTest {
/**
* Tests skipping past the end of a stream.
- *
+ *
* @throws Throwable
*/
@Test
@@ -526,7 +526,7 @@ public class Base64InputStreamTest {
/**
* Tests skipping to the end of a stream.
- *
+ *
* @throws Throwable
*/
@Test
Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64OutputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64OutputStreamTest.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64OutputStreamTest.java (original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64OutputStreamTest.java Wed Jun 20 19:04:08 2012
@@ -61,11 +61,11 @@ public class Base64OutputStreamTest {
"codec-98 NPE Base64OutputStream", Base64TestData.CODEC_98_NPE_DECODED, decoded
);
}
-
+
/**
* Test the Base64OutputStream implementation against empty input.
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -76,7 +76,7 @@ public class Base64OutputStreamTest {
/**
* Test the Base64OutputStream implementation against empty input.
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -94,7 +94,7 @@ public class Base64OutputStreamTest {
/**
* Test the Base64OutputStream implementation
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -132,7 +132,7 @@ public class Base64OutputStreamTest {
/**
* Test the Base64OutputStream implementation
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -174,7 +174,7 @@ public class Base64OutputStreamTest {
* <p/>
* By "[WRAP-WRAP-WRAP-etc...]" we mean situation where the Base64OutputStream wraps itself in encode and decode
* mode over and over again.
- *
+ *
* @param encoded
* base64 encoded data
* @param decoded
@@ -224,7 +224,7 @@ public class Base64OutputStreamTest {
* <p/>
* By "[WRAP-WRAP-WRAP-etc...]" we mean situation where the Base64OutputStream wraps itself in encode and decode
* mode over and over again.
- *
+ *
* @param encoded
* base64 encoded data
* @param decoded
@@ -287,7 +287,7 @@ public class Base64OutputStreamTest {
/**
* Tests Base64OutputStream.write for expected IndexOutOfBoundsException conditions.
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
@@ -328,7 +328,7 @@ public class Base64OutputStreamTest {
/**
* Tests Base64OutputStream.write(null).
- *
+ *
* @throws Exception
* for some failure scenarios.
*/
Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64Test.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64Test.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64Test.java (original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64Test.java Wed Jun 20 19:04:08 2012
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -35,7 +35,7 @@ import org.junit.Test;
/**
* Test cases for Base64 class.
- *
+ *
* @see <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>
* @version $Id$
*/
@@ -59,19 +59,19 @@ public class Base64Test {
String emptyString = "";
String validString = "abc===defg\n\r123456\r789\r\rABC\n\nDEF==GHI\r\nJKL==============";
String invalidString = validString + (char)0; // append null character
-
+
try {
Base64.isBase64(nullString);
fail("Base64.isStringBase64() should not be null-safe.");
} catch (NullPointerException npe) {
assertNotNull("Base64.isStringBase64() should not be null-safe.", npe);
}
-
+
assertTrue("Base64.isStringBase64(empty-string) is true", Base64.isBase64(emptyString));
- assertTrue("Base64.isStringBase64(valid-string) is true", Base64.isBase64(validString));
- assertFalse("Base64.isStringBase64(invalid-string) is false", Base64.isBase64(invalidString));
+ assertTrue("Base64.isStringBase64(valid-string) is true", Base64.isBase64(validString));
+ assertFalse("Base64.isStringBase64(invalid-string) is false", Base64.isBase64(invalidString));
}
-
+
/**
* Test the Base64 implementation
*/
@@ -96,7 +96,7 @@ public class Base64Test {
// bogus characters to decode (to skip actually) {e-acute*6}
byte[] decode = b64.decode("SGVsbG{\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9}8gV29ybGQ=");
String decodeString = StringUtils.newStringUtf8(decode);
- assertEquals("decode hello world", "Hello World", decodeString);
+ assertEquals("decode hello world", "Hello World", decodeString);
}
/**
@@ -353,7 +353,7 @@ public class Base64Test {
testEncodeOverMaxSize(1);
testEncodeOverMaxSize(2);
}
-
+
@Test
public void testCodec112() { // size calculation assumes always chunked
byte[] in = new byte[] {0};
@@ -566,7 +566,7 @@ public class Base64Test {
* <li>BASE64("fooba") = "Zm9vYmE="</li>
* <li>BASE64("foobar") = "Zm9vYmFy"</li>
* </ul>
- *
+ *
* @see <a href="http://tools.ietf.org/html/rfc4648">http://tools.ietf.org/html/rfc4648</a>
*/
@Test
@@ -579,7 +579,7 @@ public class Base64Test {
assertEquals("fooba", StringUtils.newStringUsAscii(Base64.decodeBase64("Zm9vYmE=")));
assertEquals("foobar", StringUtils.newStringUsAscii(Base64.decodeBase64("Zm9vYmFy")));
}
-
+
/**
* Tests RFC 4648 section 10 test vectors.
* <ul>
@@ -591,7 +591,7 @@ public class Base64Test {
* <li>BASE64("fooba") = "Zm9vYmE="</li>
* <li>BASE64("foobar") = "Zm9vYmFy"</li>
* </ul>
- *
+ *
* @see <a href="http://tools.ietf.org/html/rfc4648">http://tools.ietf.org/html/rfc4648</a>
*/
@Test
@@ -605,7 +605,7 @@ public class Base64Test {
assertEquals("fooba", StringUtils.newStringUsAscii(Base64.decodeBase64("Zm9vYmE=" + CRLF)));
assertEquals("foobar", StringUtils.newStringUsAscii(Base64.decodeBase64("Zm9vYmFy" + CRLF)));
}
-
+
/**
* Tests RFC 4648 section 10 test vectors.
* <ul>
@@ -617,7 +617,7 @@ public class Base64Test {
* <li>BASE64("fooba") = "Zm9vYmE="</li>
* <li>BASE64("foobar") = "Zm9vYmFy"</li>
* </ul>
- *
+ *
* @see <a href="http://tools.ietf.org/html/rfc4648">http://tools.ietf.org/html/rfc4648</a>
*/
@Test
@@ -630,7 +630,7 @@ public class Base64Test {
assertEquals("Zm9vYmE=", Base64.encodeBase64String(StringUtils.getBytesUtf8("fooba")));
assertEquals("Zm9vYmFy", Base64.encodeBase64String(StringUtils.getBytesUtf8("foobar")));
}
-
+
/**
* Tests RFC 4648 section 10 test vectors.
* <ul>
@@ -642,7 +642,7 @@ public class Base64Test {
* <li>BASE64("fooba") = "Zm9vYmE="</li>
* <li>BASE64("foobar") = "Zm9vYmFy"</li>
* </ul>
- *
+ *
* @see <a href="http://tools.ietf.org/html/rfc4648">http://tools.ietf.org/html/rfc4648</a>
*/
@Test
@@ -655,7 +655,7 @@ public class Base64Test {
//testDecodeEncode("Zm9vYmE=");
//testDecodeEncode("Zm9vYmFy");
}
-
+
private void testDecodeEncode(String encodedText) {
String decodedText = StringUtils.newStringUsAscii(Base64.decodeBase64(encodedText));
String encodedText2 = Base64.encodeBase64String(StringUtils.getBytesUtf8(decodedText));
@@ -673,7 +673,7 @@ public class Base64Test {
* <li>BASE64("fooba") = "Zm9vYmE="</li>
* <li>BASE64("foobar") = "Zm9vYmFy"</li>
* </ul>
- *
+ *
* @see <a href="http://tools.ietf.org/html/rfc4648">http://tools.ietf.org/html/rfc4648</a>
*/
@Test
@@ -686,13 +686,13 @@ public class Base64Test {
testEncodeDecode("fooba");
testEncodeDecode("foobar");
}
-
+
private void testEncodeDecode(String plainText) {
String encodedText = Base64.encodeBase64String(StringUtils.getBytesUtf8(plainText));
String decodedText = StringUtils.newStringUsAscii(Base64.decodeBase64(encodedText));
assertEquals(plainText, decodedText);
}
-
+
@Test
public void testSingletons() {
assertEquals("AA==", new String(Base64.encodeBase64(new byte[]{(byte) 0})));
@@ -1073,7 +1073,7 @@ public class Base64Test {
/**
* Base64 encoding of UUID's is a common use-case, especially in URL-SAFE mode. This test case ends up being the
* "URL-SAFE" JUnit's.
- *
+ *
* @throws DecoderException
* if Hex.decode() fails - a serious problem since Hex comes from our own commons-codec!
*/
@@ -1217,10 +1217,10 @@ public class Base64Test {
}
return buf.toString();
}
-
+
/**
* Tests a lineSeparator much bigger than DEFAULT_BUFFER_SIZE.
- *
+ *
* @see <a href="http://mail-archives.apache.org/mod_mbox/commons-dev/201202.mbox/%3C4F3C85D7.5060706@snafu.de%3E">dev@commons.apache.org</a>
*/
@Test
Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64TestData.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64TestData.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64TestData.java (original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64TestData.java Wed Jun 20 19:04:08 2012
@@ -24,7 +24,7 @@ import java.util.Random;
/**
* This random data was encoded by OpenSSL. Java had nothing to do with it. This data helps us test interop between
* Commons-Codec and OpenSSL. Notice that OpenSSL creates 64 character lines instead of the 76 of Commons-Codec.
- *
+ *
* @see <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>
* @version $Id $
* @since 1.4
@@ -192,10 +192,10 @@ public class Base64TestData {
/**
* Returns an encoded and decoded copy of the same random data.
- *
+ *
* @param size amount of random data to generate and encode
* @param urlSafe true if encoding be urlSafe
- * @return two byte[] arrays: [0] = decoded, [1] = encoded
+ * @return two byte[] arrays: [0] = decoded, [1] = encoded
*/
static byte[][] randomData(int size, boolean urlSafe) {
Random r = new Random();
Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/BaseNCodecTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/BaseNCodecTest.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/BaseNCodecTest.java (original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/BaseNCodecTest.java Wed Jun 20 19:04:08 2012
@@ -13,7 +13,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
+ *
*/
package org.apache.commons.codec.binary;
@@ -28,7 +28,7 @@ import org.junit.Test;
public class BaseNCodecTest {
BaseNCodec codec;
-
+
@Before
public void setUp() {
codec = new BaseNCodec(0, 0, 0, 0) {
@@ -36,15 +36,15 @@ public class BaseNCodecTest {
protected boolean isInAlphabet(byte b) {
return b=='O' || b == 'K'; // allow OK
}
-
+
@Override
void encode(byte[] pArray, int i, int length, Context context) {
}
-
+
@Override
void decode(byte[] pArray, int i, int length, Context context) {
}
- };
+ };
}
@Test
Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/BinaryCodecTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/BinaryCodecTest.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/BinaryCodecTest.java (original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/BinaryCodecTest.java Wed Jun 20 19:04:08 2012
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -29,7 +29,7 @@ import org.junit.Test;
/**
* TestCase for BinaryCodec class.
- *
+ *
* @version $Id$
*/
public class BinaryCodecTest {
@@ -168,7 +168,7 @@ public class BinaryCodecTest {
// ------------------------------------------------------------------------
/**
* Utility used to assert the encoded and decoded values.
- *
+ *
* @param bits
* the pre-encoded data
* @param encodeMe
Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Codec105ErrorInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Codec105ErrorInputStream.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Codec105ErrorInputStream.java (original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Codec105ErrorInputStream.java Wed Jun 20 19:04:08 2012
@@ -22,9 +22,9 @@ import java.io.InputStream;
/**
* Emits three line-feeds '\n' in a row, one at a time, and then EOF.
- *
+ *
* Recreates the bug described in CODEC-105.
- *
+ *
* @version $Id $
* @since 1.5
*/
Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/HexTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/HexTest.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/HexTest.java (original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/HexTest.java Wed Jun 20 19:04:08 2012
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -36,13 +36,13 @@ import org.junit.Test;
/**
* Tests {@link org.apache.commons.codec.binary.Hex}.
- *
+ *
* @version $Id$
*/
public class HexTest {
private static final String BAD_ENCODING_NAME = "UNKNOWN";
-
+
private final static boolean LOG = false;
private boolean charsetSanityCheck(String name) {
@@ -71,7 +71,7 @@ public class HexTest {
// x-JIS0208
// x-MacDingbat
// x-MacSymbol
- //
+ //
log("FAILED charsetSanityCheck=Interesting Java charset oddity: Roundtrip failed for " + name);
}
return equals;
@@ -124,7 +124,7 @@ public class HexTest {
@Test
public void testCustomCharset() throws UnsupportedEncodingException, DecoderException {
for (String name : Charset.availableCharsets().keySet()) {
- testCustomCharset(name, "testCustomCharset");
+ testCustomCharset(name, "testCustomCharset");
}
}
Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/StringUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/StringUtilsTest.java?rev=1352268&r1=1352267&r2=1352268&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/StringUtilsTest.java (original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/StringUtilsTest.java Wed Jun 20 19:04:08 2012
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,7 +26,7 @@ import org.junit.Test;
/**
* Tests {@link StringUtils}
- *
+ *
* @version $Id$
*/
public class StringUtilsTest {