commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1308314 [1/2] - 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...
Date Mon, 02 Apr 2012 12:04:01 GMT
Author: ggregory
Date: Mon Apr  2 12:03:59 2012
New Revision: 1308314

URL: http://svn.apache.org/viewvc?rev=1308314&view=rev
Log:
Undo previous commit (svn merge -r 1308156:1308111 .)

Modified:
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/BinaryDecoder.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/BinaryEncoder.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/CharEncoding.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/Charsets.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/Decoder.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/DecoderException.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/Encoder.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/EncoderException.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/StringDecoder.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/StringEncoder.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/StringEncoderComparator.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base32.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base64.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base64InputStream.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base64OutputStream.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/BaseNCodec.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/BaseNCodecInputStream.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/BaseNCodecOutputStream.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/BinaryCodec.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Hex.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/StringUtils.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/DigestUtils.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/AbstractCaverphone.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Caverphone.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Caverphone1.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Caverphone2.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/ColognePhonetic.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/DoubleMetaphone.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Metaphone.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/RefinedSoundex.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Soundex.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/SoundexUtils.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/BeiderMorseEncoder.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Lang.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Languages.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/NameType.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/PhoneticEngine.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/ResourceConstants.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Rule.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/RuleType.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/BCodec.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/QCodec.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/QuotedPrintableCodec.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/RFC1522Codec.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/URLCodec.java
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/Utils.java
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base32Test.java
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/BaseNCodecTest.java

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/BinaryDecoder.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/BinaryDecoder.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/BinaryDecoder.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/BinaryDecoder.java Mon Apr  2 12:03:59 2012
@@ -20,6 +20,7 @@ package org.apache.commons.codec;
 /**
  * Defines common decoding methods for byte array decoders.
  *
+ * @author Apache Software Foundation
  * @version $Id$
  */
 public interface BinaryDecoder extends Decoder {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/BinaryEncoder.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/BinaryEncoder.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/BinaryEncoder.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/BinaryEncoder.java Mon Apr  2 12:03:59 2012
@@ -20,6 +20,7 @@ package org.apache.commons.codec;
 /**
  * Defines common encoding methods for byte array encoders.
  * 
+ * @author Apache Software Foundation
  * @version $Id$
  */
 public interface BinaryEncoder extends Encoder {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/CharEncoding.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/CharEncoding.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/CharEncoding.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/CharEncoding.java Mon Apr  2 12:03:59 2012
@@ -48,6 +48,7 @@ package org.apache.commons.codec;
  * foreseen that [codec] would be made to depend on [lang].
  * 
  * @see <a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
+ * @author Apache Software Foundation
  * @since 1.4
  * @version $Id$
  */

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/Charsets.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/Charsets.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/Charsets.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/Charsets.java Mon Apr  2 12:03:59 2012
@@ -50,6 +50,7 @@ import java.nio.charset.UnsupportedChars
  * not foreseen that Commons Codec would be made to depend on Commons Lang.
  * 
  * @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
+ * @author Apache Software Foundation
  * @since 1.7
  * @version $Id: CharEncoding.java 1173287 2011-09-20 18:16:19Z ggregory $
  */

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/Decoder.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/Decoder.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/Decoder.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/Decoder.java Mon Apr  2 12:03:59 2012
@@ -27,6 +27,7 @@ package org.apache.commons.codec;
  * 
  * <p>One of the two interfaces at the center of the codec package.</p>
  * 
+ * @author Apache Software Foundation
  * @version $Id$
  */
 public interface Decoder {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/DecoderException.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/DecoderException.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/DecoderException.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/DecoderException.java Mon Apr  2 12:03:59 2012
@@ -21,6 +21,7 @@ package org.apache.commons.codec;
  * Thrown when there is a failure condition during the decoding process. This exception is thrown when a {@link Decoder}
  * encounters a decoding specific exception such as invalid data, or characters outside of the expected range.
  * 
+ * @author Apache Software Foundation
  * @version $Id$
  */
 public class DecoderException extends Exception {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/Encoder.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/Encoder.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/Encoder.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/Encoder.java Mon Apr  2 12:03:59 2012
@@ -23,6 +23,7 @@ package org.apache.commons.codec;
  * Encoder provides this common generic interface which allows a user to pass a 
  * generic Object to any Encoder implementation in the codec package.</p>
  *
+ * @author Apache Software Foundation
  * @version $Id$
  */
 public interface Encoder {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/EncoderException.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/EncoderException.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/EncoderException.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/EncoderException.java Mon Apr  2 12:03:59 2012
@@ -22,6 +22,7 @@ package org.apache.commons.codec;
  * {@link Encoder} encounters a encoding specific exception such as invalid data, inability to calculate a checksum,
  * characters outside of the expected range.
  * 
+ * @author Apache Software Foundation
  * @version $Id$
  */
 public class EncoderException extends Exception {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/StringDecoder.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/StringDecoder.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/StringDecoder.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/StringDecoder.java Mon Apr  2 12:03:59 2012
@@ -20,6 +20,7 @@ package org.apache.commons.codec;
 /**
  * Defines common decoding methods for String decoders.
  *
+ * @author Apache Software Foundation
  * @version $Id$
  */
 public interface StringDecoder extends Decoder {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/StringEncoder.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/StringEncoder.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/StringEncoder.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/StringEncoder.java Mon Apr  2 12:03:59 2012
@@ -20,6 +20,7 @@ package org.apache.commons.codec;
 /**
  * Defines common encoding methods for String encoders.
  *
+ * @author Apache Software Foundation
  * @version $Id$
  */
 public interface StringEncoder extends Encoder {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/StringEncoderComparator.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/StringEncoderComparator.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/StringEncoderComparator.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/StringEncoderComparator.java Mon Apr  2 12:03:59 2012
@@ -24,6 +24,7 @@ import java.util.Comparator;
  * Soundex, Metaphone, etc. This class can come in handy if one need to sort Strings by an encoded form of a name such
  * as Soundex.
  * 
+ * @author Apache Software Foundation
  * @version $Id$
  */
 public class StringEncoderComparator implements Comparator {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base32.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base32.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base32.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base32.java Mon Apr  2 12:03:59 2012
@@ -33,7 +33,7 @@ package org.apache.commons.codec.binary;
  * This class operates directly on byte streams, and not character streams.
  * </p>
  * <p>
- * This class is thread-safe.
+ * This class is not thread-safe. Each thread should use its own instance.
  * </p>
  * 
  * @see <a href="http://www.ietf.org/rfc/rfc4648.txt">RFC 4648</a>
@@ -122,6 +122,8 @@ public class Base32 extends BaseNCodec {
      * Place holder for the bytes we're dealing with for our based logic. 
      * Bitwise operations store and extract the encoding or decoding from this variable.
      */
+    private long bitWorkArea;
+
     /**
      * Convenience variable to help us determine when our buffer is going to run out of room and needs resizing.
      * <code>decodeSize = {@link #BYTES_PER_ENCODED_BLOCK} - 1 + lineSeparator.length;</code>
@@ -273,37 +275,36 @@ public class Base32 extends BaseNCodec {
      *            Position to start reading data from.
      * @param inAvail
      *            Amount of bytes available from input for encoding.
-     * @param context the context to be used
      *
      * Output is written to {@link #buffer} as 8-bit octets, using {@link #pos} as the buffer position
      */
     @Override
-    void decode(byte[] in, int inPos, int inAvail, Context context) { // package protected for access from I/O streams
-        if (context.eof) {
+    void decode(byte[] in, int inPos, int inAvail) { // package protected for access from I/O streams
+        if (eof) {
             return;
         }
         if (inAvail < 0) {
-            context.eof = true;
+            eof = true;
         }
         for (int i = 0; i < inAvail; i++) {
             byte b = in[inPos++];
             if (b == PAD) {
                 // We're done.
-                context.eof = true;
+                eof = true;
                 break;
             } else {
-                ensureBufferSize(decodeSize, context);
+                ensureBufferSize(decodeSize);
                 if (b >= 0 && b < this.decodeTable.length) {
                     int result = this.decodeTable[b];
                     if (result >= 0) {
-                        context.modulus = (context.modulus+1) % BYTES_PER_ENCODED_BLOCK;
-                        context.lbitWorkArea = (context.lbitWorkArea << BITS_PER_ENCODED_BYTE) + result; // collect decoded bytes
-                        if (context.modulus == 0) { // we can output the 5 bytes
-                            context.buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 32) & MASK_8BITS);
-                            context.buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 24) & MASK_8BITS);
-                            context.buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 16) & MASK_8BITS);
-                            context.buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 8) & MASK_8BITS);
-                            context.buffer[context.pos++] = (byte) (context.lbitWorkArea & MASK_8BITS);
+                        modulus = (modulus+1) % BYTES_PER_ENCODED_BLOCK;
+                        bitWorkArea = (bitWorkArea << BITS_PER_ENCODED_BYTE) + result; // collect decoded bytes
+                        if (modulus == 0) { // we can output the 5 bytes
+                            buffer[pos++] = (byte) ((bitWorkArea >> 32) & MASK_8BITS);
+                            buffer[pos++] = (byte) ((bitWorkArea >> 24) & MASK_8BITS);
+                            buffer[pos++] = (byte) ((bitWorkArea >> 16) & MASK_8BITS);
+                            buffer[pos++] = (byte) ((bitWorkArea >> 8) & MASK_8BITS);
+                            buffer[pos++] = (byte) (bitWorkArea & MASK_8BITS);
                         }
                     }
                 }
@@ -313,40 +314,40 @@ public class Base32 extends BaseNCodec {
         // Two forms of EOF as far as Base32 decoder is concerned: actual
         // EOF (-1) and first time '=' character is encountered in stream.
         // This approach makes the '=' padding characters completely optional.
-        if (context.eof && context.modulus >= 2) { // if modulus < 2, nothing to do
-            ensureBufferSize(decodeSize, context);
+        if (eof && modulus >= 2) { // if modulus < 2, nothing to do
+            ensureBufferSize(decodeSize);
     
             //  we ignore partial bytes, i.e. only multiples of 8 count
-            switch (context.modulus) {
+            switch (modulus) {
                 case 2 : // 10 bits, drop 2 and output one byte
-                    context.buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 2) & MASK_8BITS);
+                    buffer[pos++] = (byte) ((bitWorkArea >> 2) & MASK_8BITS);
                     break;
                 case 3 : // 15 bits, drop 7 and output 1 byte
-                    context.buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 7) & MASK_8BITS);
+                    buffer[pos++] = (byte) ((bitWorkArea >> 7) & MASK_8BITS);
                     break;
                 case 4 : // 20 bits = 2*8 + 4
-                    context.lbitWorkArea = context.lbitWorkArea >> 4; // drop 4 bits
-                    context.buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 8) & MASK_8BITS);
-                    context.buffer[context.pos++] = (byte) ((context.lbitWorkArea) & MASK_8BITS);
+                    bitWorkArea = bitWorkArea >> 4; // drop 4 bits
+                    buffer[pos++] = (byte) ((bitWorkArea >> 8) & MASK_8BITS);
+                    buffer[pos++] = (byte) ((bitWorkArea) & MASK_8BITS);
                     break;
                 case 5 : // 25bits = 3*8 + 1
-                    context.lbitWorkArea = context.lbitWorkArea >> 1;
-                    context.buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 16) & MASK_8BITS);
-                    context.buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 8) & MASK_8BITS);
-                    context.buffer[context.pos++] = (byte) ((context.lbitWorkArea) & MASK_8BITS);
+                    bitWorkArea = bitWorkArea >> 1;
+                    buffer[pos++] = (byte) ((bitWorkArea >> 16) & MASK_8BITS);
+                    buffer[pos++] = (byte) ((bitWorkArea >> 8) & MASK_8BITS);
+                    buffer[pos++] = (byte) ((bitWorkArea) & MASK_8BITS);
                     break;
                 case 6 : // 30bits = 3*8 + 6
-                    context.lbitWorkArea = context.lbitWorkArea >> 6;
-                    context.buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 16) & MASK_8BITS);
-                    context.buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 8) & MASK_8BITS);
-                    context.buffer[context.pos++] = (byte) ((context.lbitWorkArea) & MASK_8BITS);
+                    bitWorkArea = bitWorkArea >> 6;
+                    buffer[pos++] = (byte) ((bitWorkArea >> 16) & MASK_8BITS);
+                    buffer[pos++] = (byte) ((bitWorkArea >> 8) & MASK_8BITS);
+                    buffer[pos++] = (byte) ((bitWorkArea) & MASK_8BITS);
                     break;
                 case 7 : // 35 = 4*8 +3
-                    context.lbitWorkArea = context.lbitWorkArea >> 3;
-                    context.buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 24) & MASK_8BITS);
-                    context.buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 16) & MASK_8BITS);
-                    context.buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 8) & MASK_8BITS);
-                    context.buffer[context.pos++] = (byte) ((context.lbitWorkArea) & MASK_8BITS);
+                    bitWorkArea = bitWorkArea >> 3;
+                    buffer[pos++] = (byte) ((bitWorkArea >> 24) & MASK_8BITS);
+                    buffer[pos++] = (byte) ((bitWorkArea >> 16) & MASK_8BITS);
+                    buffer[pos++] = (byte) ((bitWorkArea >> 8) & MASK_8BITS);
+                    buffer[pos++] = (byte) ((bitWorkArea) & MASK_8BITS);
                     break;
             }
         }
@@ -365,94 +366,93 @@ public class Base32 extends BaseNCodec {
      *            Position to start reading data from.
      * @param inAvail
      *            Amount of bytes available from input for encoding.
-     * @param context the context to be used
      */
     @Override
-    void encode(byte[] in, int inPos, int inAvail, Context context) { // package protected for access from I/O streams
-        if (context.eof) {
+    void encode(byte[] in, int inPos, int inAvail) { // package protected for access from I/O streams
+        if (eof) {
             return;
         }
         // inAvail < 0 is how we're informed of EOF in the underlying data we're
         // encoding.
         if (inAvail < 0) {
-            context.eof = true;
-            if (0 == context.modulus && lineLength == 0) {
+            eof = true;
+            if (0 == modulus && lineLength == 0) {
                 return; // no leftovers to process and not using chunking
             }
-            ensureBufferSize(encodeSize, context);
-            int savedPos = context.pos;
-            switch (context.modulus) { // % 5
+            ensureBufferSize(encodeSize);
+            int savedPos = pos;
+            switch (modulus) { // % 5
                 case 1 : // Only 1 octet; take top 5 bits then remainder
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea >> 3) & MASK_5BITS]; // 8-1*5 = 3
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea << 2) & MASK_5BITS]; // 5-3=2
-                    context.buffer[context.pos++] = PAD;
-                    context.buffer[context.pos++] = PAD;
-                    context.buffer[context.pos++] = PAD;
-                    context.buffer[context.pos++] = PAD;
-                    context.buffer[context.pos++] = PAD;
-                    context.buffer[context.pos++] = PAD;
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea >> 3) & MASK_5BITS]; // 8-1*5 = 3
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea << 2) & MASK_5BITS]; // 5-3=2
+                    buffer[pos++] = PAD;
+                    buffer[pos++] = PAD;
+                    buffer[pos++] = PAD;
+                    buffer[pos++] = PAD;
+                    buffer[pos++] = PAD;
+                    buffer[pos++] = PAD;
                     break;
     
                 case 2 : // 2 octets = 16 bits to use
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea >> 11) & MASK_5BITS]; // 16-1*5 = 11
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea >>  6) & MASK_5BITS]; // 16-2*5 = 6
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea >>  1) & MASK_5BITS]; // 16-3*5 = 1
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea <<  4) & MASK_5BITS]; // 5-1 = 4
-                    context.buffer[context.pos++] = PAD;
-                    context.buffer[context.pos++] = PAD;
-                    context.buffer[context.pos++] = PAD;
-                    context.buffer[context.pos++] = PAD;
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea >> 11) & MASK_5BITS]; // 16-1*5 = 11
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea >>  6) & MASK_5BITS]; // 16-2*5 = 6
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea >>  1) & MASK_5BITS]; // 16-3*5 = 1
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea <<  4) & MASK_5BITS]; // 5-1 = 4
+                    buffer[pos++] = PAD;
+                    buffer[pos++] = PAD;
+                    buffer[pos++] = PAD;
+                    buffer[pos++] = PAD;
                     break;
                 case 3 : // 3 octets = 24 bits to use
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea >> 19) & MASK_5BITS]; // 24-1*5 = 19
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea >> 14) & MASK_5BITS]; // 24-2*5 = 14
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea >>  9) & MASK_5BITS]; // 24-3*5 = 9
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea >>  4) & MASK_5BITS]; // 24-4*5 = 4
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea <<  1) & MASK_5BITS]; // 5-4 = 1
-                    context.buffer[context.pos++] = PAD;
-                    context.buffer[context.pos++] = PAD;
-                    context.buffer[context.pos++] = PAD;
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea >> 19) & MASK_5BITS]; // 24-1*5 = 19
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea >> 14) & MASK_5BITS]; // 24-2*5 = 14
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea >>  9) & MASK_5BITS]; // 24-3*5 = 9
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea >>  4) & MASK_5BITS]; // 24-4*5 = 4
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea <<  1) & MASK_5BITS]; // 5-4 = 1
+                    buffer[pos++] = PAD;
+                    buffer[pos++] = PAD;
+                    buffer[pos++] = PAD;
                     break;
                 case 4 : // 4 octets = 32 bits to use
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea >> 27) & MASK_5BITS]; // 32-1*5 = 27
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea >> 22) & MASK_5BITS]; // 32-2*5 = 22
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea >> 17) & MASK_5BITS]; // 32-3*5 = 17
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea >> 12) & MASK_5BITS]; // 32-4*5 = 12
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea >>  7) & MASK_5BITS]; // 32-5*5 =  7
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea >>  2) & MASK_5BITS]; // 32-6*5 =  2
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea <<  3) & MASK_5BITS]; // 5-2 = 3
-                    context.buffer[context.pos++] = PAD;
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea >> 27) & MASK_5BITS]; // 32-1*5 = 27
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea >> 22) & MASK_5BITS]; // 32-2*5 = 22
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea >> 17) & MASK_5BITS]; // 32-3*5 = 17
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea >> 12) & MASK_5BITS]; // 32-4*5 = 12
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea >>  7) & MASK_5BITS]; // 32-5*5 =  7
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea >>  2) & MASK_5BITS]; // 32-6*5 =  2
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea <<  3) & MASK_5BITS]; // 5-2 = 3
+                    buffer[pos++] = PAD;
                     break;
             }
-            context.currentLinePos += context.pos - savedPos; // keep track of current line position
+            currentLinePos += pos - savedPos; // keep track of current line position
             // if currentPos == 0 we are at the start of a line, so don't add CRLF
-            if (lineLength > 0 && context.currentLinePos > 0){ // add chunk separator if required
-                System.arraycopy(lineSeparator, 0, context.buffer, context.pos, lineSeparator.length);
-                context.pos += lineSeparator.length;
+            if (lineLength > 0 && currentLinePos > 0){ // add chunk separator if required
+                System.arraycopy(lineSeparator, 0, buffer, pos, lineSeparator.length);
+                pos += lineSeparator.length;
             }            
         } else {
             for (int i = 0; i < inAvail; i++) {
-                ensureBufferSize(encodeSize, context);
-                context.modulus = (context.modulus+1) % BYTES_PER_UNENCODED_BLOCK;
+                ensureBufferSize(encodeSize);
+                modulus = (modulus+1) % BYTES_PER_UNENCODED_BLOCK;
                 int b = in[inPos++];
                 if (b < 0) {
                     b += 256;
                 }
-                context.lbitWorkArea = (context.lbitWorkArea << 8) + b; // BITS_PER_BYTE
-                if (0 == context.modulus) { // we have enough bytes to create our output 
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea >> 35) & MASK_5BITS];
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea >> 30) & MASK_5BITS];
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea >> 25) & MASK_5BITS];
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea >> 20) & MASK_5BITS];
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea >> 15) & MASK_5BITS];
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea >> 10) & MASK_5BITS];
-                    context.buffer[context.pos++] = encodeTable[(int)(context.lbitWorkArea >> 5) & MASK_5BITS];
-                    context.buffer[context.pos++] = encodeTable[(int)context.lbitWorkArea & MASK_5BITS];
-                    context.currentLinePos += BYTES_PER_ENCODED_BLOCK;
-                    if (lineLength > 0 && lineLength <= context.currentLinePos) {
-                        System.arraycopy(lineSeparator, 0, context.buffer, context.pos, lineSeparator.length);
-                        context.pos += lineSeparator.length;
-                        context.currentLinePos = 0;
+                bitWorkArea = (bitWorkArea << 8) + b; // BITS_PER_BYTE
+                if (0 == modulus) { // we have enough bytes to create our output 
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea >> 35) & MASK_5BITS];
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea >> 30) & MASK_5BITS];
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea >> 25) & MASK_5BITS];
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea >> 20) & MASK_5BITS];
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea >> 15) & MASK_5BITS];
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea >> 10) & MASK_5BITS];
+                    buffer[pos++] = encodeTable[(int)(bitWorkArea >> 5) & MASK_5BITS];
+                    buffer[pos++] = encodeTable[(int)bitWorkArea & MASK_5BITS];
+                    currentLinePos += BYTES_PER_ENCODED_BLOCK;
+                    if (lineLength > 0 && lineLength <= currentLinePos) {
+                        System.arraycopy(lineSeparator, 0, buffer, pos, lineSeparator.length);
+                        pos += lineSeparator.length;
+                        currentLinePos = 0;
                     }
                 }
             }

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base64.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base64.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base64.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base64.java Mon Apr  2 12:03:59 2012
@@ -40,10 +40,11 @@ import java.math.BigInteger;
  * character encodings which are compatible with the lower 127 ASCII chart (ISO-8859-1, Windows-1252, UTF-8, etc).
  * </p>
  * <p>
- * This class is thread-safe.
+ * This class is not thread-safe. Each thread should use its own instance.
  * </p>
  * 
  * @see <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>
+ * @author Apache Software Foundation
  * @since 1.0
  * @version $Revision$
  */
@@ -156,6 +157,12 @@ public class Base64 extends BaseNCodec {
     private final int encodeSize;
 
     /**
+     * Place holder for the bytes we're dealing with for our based logic. 
+     * Bitwise operations store and extract the encoding or decoding from this variable.
+     */
+    private int bitWorkArea;
+
+    /**
      * Creates a Base64 codec used for decoding (all modes) and encoding in URL-unsafe mode.
      * <p>
      * When encoding the line length is 0 (no chunking), and the encoding table is STANDARD_ENCODE_TABLE.
@@ -315,68 +322,67 @@ public class Base64 extends BaseNCodec {
      *            Position to start reading data from.
      * @param inAvail
      *            Amount of bytes available from input for encoding.
-     * @param context the context to be used
      */
     @Override
-    void encode(byte[] in, int inPos, int inAvail, Context context) {
-        if (context.eof) {
+    void encode(byte[] in, int inPos, int inAvail) {
+        if (eof) {
             return;
         }
         // inAvail < 0 is how we're informed of EOF in the underlying data we're
         // encoding.
         if (inAvail < 0) {
-            context.eof = true;
-            if (0 == context.modulus && lineLength == 0) {
+            eof = true;
+            if (0 == modulus && lineLength == 0) {
                 return; // no leftovers to process and not using chunking
             }
-            ensureBufferSize(encodeSize, context);
-            int savedPos = context.pos;
-            switch (context.modulus) { // 0-2
+            ensureBufferSize(encodeSize);
+            int savedPos = pos;
+            switch (modulus) { // 0-2
                 case 1 : // 8 bits = 6 + 2
-                    context.buffer[context.pos++] = encodeTable[(context.ibitWorkArea >> 2) & MASK_6BITS]; // top 6 bits
-                    context.buffer[context.pos++] = encodeTable[(context.ibitWorkArea << 4) & MASK_6BITS]; // remaining 2 
+                    buffer[pos++] = encodeTable[(bitWorkArea >> 2) & MASK_6BITS]; // top 6 bits
+                    buffer[pos++] = encodeTable[(bitWorkArea << 4) & MASK_6BITS]; // remaining 2 
                     // URL-SAFE skips the padding to further reduce size.
                     if (encodeTable == STANDARD_ENCODE_TABLE) {
-                        context.buffer[context.pos++] = PAD;
-                        context.buffer[context.pos++] = PAD;
+                        buffer[pos++] = PAD;
+                        buffer[pos++] = PAD;
                     }
                     break;
 
                 case 2 : // 16 bits = 6 + 6 + 4
-                    context.buffer[context.pos++] = encodeTable[(context.ibitWorkArea >> 10) & MASK_6BITS];
-                    context.buffer[context.pos++] = encodeTable[(context.ibitWorkArea >> 4) & MASK_6BITS];
-                    context.buffer[context.pos++] = encodeTable[(context.ibitWorkArea << 2) & MASK_6BITS];
+                    buffer[pos++] = encodeTable[(bitWorkArea >> 10) & MASK_6BITS];
+                    buffer[pos++] = encodeTable[(bitWorkArea >> 4) & MASK_6BITS];
+                    buffer[pos++] = encodeTable[(bitWorkArea << 2) & MASK_6BITS];
                     // URL-SAFE skips the padding to further reduce size.
                     if (encodeTable == STANDARD_ENCODE_TABLE) {
-                        context.buffer[context.pos++] = PAD;
+                        buffer[pos++] = PAD;
                     }
                     break;
             }
-            context.currentLinePos += context.pos - savedPos; // keep track of current line position
+            currentLinePos += pos - savedPos; // keep track of current line position
             // if currentPos == 0 we are at the start of a line, so don't add CRLF
-            if (lineLength > 0 && context.currentLinePos > 0) { 
-                System.arraycopy(lineSeparator, 0, context.buffer, context.pos, lineSeparator.length);
-                context.pos += lineSeparator.length;
+            if (lineLength > 0 && currentLinePos > 0) { 
+                System.arraycopy(lineSeparator, 0, buffer, pos, lineSeparator.length);
+                pos += lineSeparator.length;
             }
         } else {
             for (int i = 0; i < inAvail; i++) {
-                ensureBufferSize(encodeSize, context);
-                context.modulus = (context.modulus+1) % BYTES_PER_UNENCODED_BLOCK;
+                ensureBufferSize(encodeSize);
+                modulus = (modulus+1) % BYTES_PER_UNENCODED_BLOCK;
                 int b = in[inPos++];
                 if (b < 0) {
                     b += 256;
                 }
-                context.ibitWorkArea = (context.ibitWorkArea << 8) + b; //  BITS_PER_BYTE
-                if (0 == context.modulus) { // 3 bytes = 24 bits = 4 * 6 bits to extract
-                    context.buffer[context.pos++] = encodeTable[(context.ibitWorkArea >> 18) & MASK_6BITS];
-                    context.buffer[context.pos++] = encodeTable[(context.ibitWorkArea >> 12) & MASK_6BITS];
-                    context.buffer[context.pos++] = encodeTable[(context.ibitWorkArea >> 6) & MASK_6BITS];
-                    context.buffer[context.pos++] = encodeTable[context.ibitWorkArea & MASK_6BITS];
-                    context.currentLinePos += BYTES_PER_ENCODED_BLOCK;
-                    if (lineLength > 0 && lineLength <= context.currentLinePos) {
-                        System.arraycopy(lineSeparator, 0, context.buffer, context.pos, lineSeparator.length);
-                        context.pos += lineSeparator.length;
-                        context.currentLinePos = 0;
+                bitWorkArea = (bitWorkArea << 8) + b; //  BITS_PER_BYTE
+                if (0 == modulus) { // 3 bytes = 24 bits = 4 * 6 bits to extract
+                    buffer[pos++] = encodeTable[(bitWorkArea >> 18) & MASK_6BITS];
+                    buffer[pos++] = encodeTable[(bitWorkArea >> 12) & MASK_6BITS];
+                    buffer[pos++] = encodeTable[(bitWorkArea >> 6) & MASK_6BITS];
+                    buffer[pos++] = encodeTable[bitWorkArea & MASK_6BITS];
+                    currentLinePos += BYTES_PER_ENCODED_BLOCK;
+                    if (lineLength > 0 && lineLength <= currentLinePos) {
+                        System.arraycopy(lineSeparator, 0, buffer, pos, lineSeparator.length);
+                        pos += lineSeparator.length;
+                        currentLinePos = 0;
                     }
                 }
             }
@@ -405,33 +411,32 @@ public class Base64 extends BaseNCodec {
      *            Position to start reading data from.
      * @param inAvail
      *            Amount of bytes available from input for encoding.
-     * @param context the context to be used
      */
     @Override
-    void decode(byte[] in, int inPos, int inAvail, Context context) {
-        if (context.eof) {
+    void decode(byte[] in, int inPos, int inAvail) {
+        if (eof) {
             return;
         }
         if (inAvail < 0) {
-            context.eof = true;
+            eof = true;
         }
         for (int i = 0; i < inAvail; i++) {
-            ensureBufferSize(decodeSize, context);
+            ensureBufferSize(decodeSize);
             byte b = in[inPos++];
             if (b == PAD) {
                 // We're done.
-                context.eof = true;
+                eof = true;
                 break;
             } else {
                 if (b >= 0 && b < DECODE_TABLE.length) {
                     int result = DECODE_TABLE[b];
                     if (result >= 0) {
-                        context.modulus = (context.modulus+1) % BYTES_PER_ENCODED_BLOCK;
-                        context.ibitWorkArea = (context.ibitWorkArea << BITS_PER_ENCODED_BYTE) + result;
-                        if (context.modulus == 0) {
-                            context.buffer[context.pos++] = (byte) ((context.ibitWorkArea >> 16) & MASK_8BITS);
-                            context.buffer[context.pos++] = (byte) ((context.ibitWorkArea >> 8) & MASK_8BITS);
-                            context.buffer[context.pos++] = (byte) (context.ibitWorkArea & MASK_8BITS);
+                        modulus = (modulus+1) % BYTES_PER_ENCODED_BLOCK;
+                        bitWorkArea = (bitWorkArea << BITS_PER_ENCODED_BYTE) + result;
+                        if (modulus == 0) {
+                            buffer[pos++] = (byte) ((bitWorkArea >> 16) & MASK_8BITS);
+                            buffer[pos++] = (byte) ((bitWorkArea >> 8) & MASK_8BITS);
+                            buffer[pos++] = (byte) (bitWorkArea & MASK_8BITS);
                         }
                     }
                 }
@@ -441,22 +446,22 @@ public class Base64 extends BaseNCodec {
         // Two forms of EOF as far as base64 decoder is concerned: actual
         // EOF (-1) and first time '=' character is encountered in stream.
         // This approach makes the '=' padding characters completely optional.
-        if (context.eof && context.modulus != 0) {
-            ensureBufferSize(decodeSize, context);
+        if (eof && modulus != 0) {
+            ensureBufferSize(decodeSize);
             
             // We have some spare bits remaining
             // Output all whole multiples of 8 bits and ignore the rest
-            switch (context.modulus) {
+            switch (modulus) {
            //   case 1: // 6 bits - ignore entirely
            //       break;
                 case 2 : // 12 bits = 8 + 4
-                    context.ibitWorkArea = context.ibitWorkArea >> 4; // dump the extra 4 bits
-                    context.buffer[context.pos++] = (byte) ((context.ibitWorkArea) & MASK_8BITS);
+                    bitWorkArea = bitWorkArea >> 4; // dump the extra 4 bits
+                    buffer[pos++] = (byte) ((bitWorkArea) & MASK_8BITS);
                     break;
                 case 3 : // 18 bits = 8 + 8 + 2
-                    context.ibitWorkArea = context.ibitWorkArea >> 2; // dump 2 bits
-                    context.buffer[context.pos++] = (byte) ((context.ibitWorkArea >> 8) & MASK_8BITS);
-                    context.buffer[context.pos++] = (byte) ((context.ibitWorkArea) & MASK_8BITS);
+                    bitWorkArea = bitWorkArea >> 2; // dump 2 bits
+                    buffer[pos++] = (byte) ((bitWorkArea >> 8) & MASK_8BITS);
+                    buffer[pos++] = (byte) ((bitWorkArea) & MASK_8BITS);
                     break;
             }
         }

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base64InputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base64InputStream.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base64InputStream.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base64InputStream.java Mon Apr  2 12:03:59 2012
@@ -36,6 +36,7 @@ import java.io.InputStream;
  * character encodings which are compatible with the lower 127 ASCII chart (ISO-8859-1, Windows-1252, UTF-8, etc).
  * </p>
  * 
+ * @author Apache Software Foundation 
  * @version $Id$
  * @see <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>
  * @since 1.4

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base64OutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base64OutputStream.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base64OutputStream.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base64OutputStream.java Mon Apr  2 12:03:59 2012
@@ -36,6 +36,7 @@ import java.io.OutputStream;
  * character encodings which are compatible with the lower 127 ASCII chart (ISO-8859-1, Windows-1252, UTF-8, etc).
  * </p>
  * 
+ * @author Apache Software Foundation
  * @version $Id$
  * @see <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>
  * @since 1.4

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/BaseNCodec.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/BaseNCodec.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/BaseNCodec.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/BaseNCodec.java Mon Apr  2 12:03:59 2012
@@ -26,70 +26,13 @@ import org.apache.commons.codec.EncoderE
  * Abstract superclass for Base-N encoders and decoders.
  *
  * <p>
- * This class is thread-safe.
+ * This class is not thread-safe.
+ * Each thread should use its own instance.
  * </p>
  */
 public abstract class BaseNCodec implements BinaryEncoder, BinaryDecoder {
 
     /**
-     * Holds thread context so classes can be thread-safe.
-     * 
-     * This class is not itself thread-safe; each thread must allocate its own copy.
-     * 
-     * @since 1.7
-     */
-    static class Context {
-
-        /**
-         * Place holder for the bytes we're dealing with for our based logic. 
-         * Bitwise operations store and extract the encoding or decoding from this variable.
-         */
-        int ibitWorkArea;
-
-        /**
-         * Place holder for the bytes we're dealing with for our based logic. 
-         * Bitwise operations store and extract the encoding or decoding from this variable.
-         */
-        long lbitWorkArea;
-
-        /**
-         * Buffer for streaming.
-         */
-        byte[] buffer;
-
-        /**
-         * Position where next character should be written in the buffer.
-         */
-        int pos;
-
-        /**
-         * Position where next character should be read from the buffer.
-         */
-        int readPos;
-
-        /**
-         * Boolean flag to indicate the EOF has been reached. Once EOF has been reached, this object becomes useless,
-         * and must be thrown away.
-         */
-        boolean eof;
-
-        /**
-         * Variable tracks how many characters have been written to the current line. Only used when encoding. We use it to
-         * make sure each encoded line never goes beyond lineLength (if lineLength > 0).
-         */
-        int currentLinePos;
-
-        /**
-         * Writes to the buffer only occur after every 3/5 reads when encoding, and every 4/8 reads when decoding.
-         * This variable helps track that.
-         */
-        int modulus;
-
-        Context() {
-        }
-    }
-
-    /**
      * EOF
      * 
      * @since 1.7
@@ -157,6 +100,39 @@ public abstract class BaseNCodec impleme
     private final int chunkSeparatorLength;
 
     /**
+     * Buffer for streaming.
+     */
+    protected byte[] buffer;
+
+    /**
+     * Position where next character should be written in the buffer.
+     */
+    protected int pos;
+
+    /**
+     * Position where next character should be read from the buffer.
+     */
+    private int readPos;
+
+    /**
+     * Boolean flag to indicate the EOF has been reached. Once EOF has been reached, this object becomes useless,
+     * and must be thrown away.
+     */
+    protected boolean eof;
+
+    /**
+     * Variable tracks how many characters have been written to the current line. Only used when encoding. We use it to
+     * make sure each encoded line never goes beyond lineLength (if lineLength > 0).
+     */
+    protected int currentLinePos;
+
+    /**
+     * Writes to the buffer only occur after every 3/5 reads when encoding, and every 4/8 reads when decoding.
+     * This variable helps track that.
+     */
+    protected int modulus;
+
+    /**
      * Note <code>lineLength</code> is rounded down to the nearest multiple of {@link #encodedBlockSize}
      * If <code>chunkSeparatorLength</code> is zero, then chunking is disabled.
      * @param unencodedBlockSize the size of an unencoded block (e.g. Base64 = 3)
@@ -174,21 +150,19 @@ public abstract class BaseNCodec impleme
     /**
      * Returns true if this object has buffered data for reading.
      *
-     * @param context the context to be used
      * @return true if there is data still available for reading.
      */
-    boolean hasData(Context context) {  // package protected for access from I/O streams
-        return context.buffer != null;
+    boolean hasData() {  // package protected for access from I/O streams
+        return this.buffer != null;
     }
 
     /**
      * Returns the amount of buffered data available for reading.
      *
-     * @param context the context to be used
      * @return The amount of buffered data available for reading.
      */
-    int available(Context context) {  // package protected for access from I/O streams
-        return context.buffer != null ? context.pos - context.readPos : 0;
+    int available() {  // package protected for access from I/O streams
+        return buffer != null ? pos - readPos : 0;
     }
 
     /**
@@ -200,19 +174,16 @@ public abstract class BaseNCodec impleme
         return DEFAULT_BUFFER_SIZE;
     }
 
-    /** 
-     * Increases our buffer by the {@link #DEFAULT_BUFFER_RESIZE_FACTOR}.
-     * @param context the context to be used
-     */
-    private void resizeBuffer(Context context) {
-        if (context.buffer == null) {
-            context.buffer = new byte[getDefaultBufferSize()];
-            context.pos = 0;
-            context.readPos = 0;
+    /** Increases our buffer by the {@link #DEFAULT_BUFFER_RESIZE_FACTOR}. */
+    private void resizeBuffer() {
+        if (buffer == null) {
+            buffer = new byte[getDefaultBufferSize()];
+            pos = 0;
+            readPos = 0;
         } else {
-            byte[] b = new byte[context.buffer.length * DEFAULT_BUFFER_RESIZE_FACTOR];
-            System.arraycopy(context.buffer, 0, b, 0, context.buffer.length);
-            context.buffer = b;
+            byte[] b = new byte[buffer.length * DEFAULT_BUFFER_RESIZE_FACTOR];
+            System.arraycopy(buffer, 0, b, 0, buffer.length);
+            buffer = b;
         }
     }
 
@@ -220,11 +191,10 @@ public abstract class BaseNCodec impleme
      * Ensure that the buffer has room for <code>size</code> bytes
      *
      * @param size minimum spare space required
-     * @param context the context to be used
      */
-    protected void ensureBufferSize(int size, Context context){
-        if ((context.buffer == null) || (context.buffer.length < context.pos + size)){
-            resizeBuffer(context);
+    protected void ensureBufferSize(int size){
+        if ((buffer == null) || (buffer.length < pos + size)){
+            resizeBuffer();
         }
     }
 
@@ -238,20 +208,19 @@ public abstract class BaseNCodec impleme
      *            position in byte[] array to start extraction at.
      * @param bAvail
      *            amount of bytes we're allowed to extract. We may extract fewer (if fewer are available).
-     * @param context the context to be used
      * @return The number of bytes successfully extracted into the provided byte[] array.
      */
-    int readResults(byte[] b, int bPos, int bAvail, Context context) {  // package protected for access from I/O streams
-        if (context.buffer != null) {
-            int len = Math.min(available(context), bAvail);
-            System.arraycopy(context.buffer, context.readPos, b, bPos, len);
-            context.readPos += len;
-            if (context.readPos >= context.pos) {
-                context.buffer = null; // so hasData() will return false, and this method can return -1
+    int readResults(byte[] b, int bPos, int bAvail) {  // package protected for access from I/O streams
+        if (buffer != null) {
+            int len = Math.min(available(), bAvail);
+            System.arraycopy(buffer, readPos, b, bPos, len);
+            readPos += len;
+            if (readPos >= pos) {
+                buffer = null; // so hasData() will return false, and this method can return -1
             }
             return len;
         }
-        return context.eof ? EOF : 0;
+        return eof ? EOF : 0;
     }
 
     /**
@@ -274,6 +243,18 @@ public abstract class BaseNCodec impleme
     }
 
     /**
+     * Resets this object to its initial newly constructed state.
+     */
+    private void reset() {
+        buffer = null;
+        pos = 0;
+        readPos = 0;
+        currentLinePos = 0;
+        modulus = 0;
+        eof = false;
+    }
+
+    /**
      * Encodes an Object using the Base-N algorithm. This method is provided in order to satisfy the requirements of the
      * Encoder interface, and will throw an EncoderException if the supplied object is not of type byte[].
      *
@@ -340,14 +321,14 @@ public abstract class BaseNCodec impleme
      * @return a byte array containing binary data
      */
     public byte[] decode(byte[] pArray) {
-        Context context = new Context();
+        reset();
         if (pArray == null || pArray.length == 0) {
             return pArray;
         }
-        decode(pArray, 0, pArray.length, context);
-        decode(pArray, 0, EOF, context); // Notify decoder of EOF.
-        byte[] result = new byte[context.pos];
-        readResults(result, 0, result.length, context);
+        decode(pArray, 0, pArray.length);
+        decode(pArray, 0, EOF); // Notify decoder of EOF.
+        byte[] result = new byte[pos];
+        readResults(result, 0, result.length);
         return result;
     }
 
@@ -359,14 +340,14 @@ public abstract class BaseNCodec impleme
      * @return A byte array containing only the basen alphabetic character data
      */
     public byte[] encode(byte[] pArray) {
-        Context context = new Context();
+        reset();        
         if (pArray == null || pArray.length == 0) {
             return pArray;
         }
-        encode(pArray, 0, pArray.length, context);
-        encode(pArray, 0, EOF, context); // Notify encoder of EOF.
-        byte[] buf = new byte[context.pos - context.readPos];
-        readResults(buf, 0, buf.length, context);
+        encode(pArray, 0, pArray.length);
+        encode(pArray, 0, EOF); // Notify encoder of EOF.
+        byte[] buf = new byte[pos - readPos];
+        readResults(buf, 0, buf.length);
         return buf;
     }
     
@@ -381,9 +362,9 @@ public abstract class BaseNCodec impleme
         return StringUtils.newStringUtf8(encode(pArray));
     }
 
-    abstract void encode(byte[] pArray, int i, int length, Context context);  // package protected for access from I/O streams
+    abstract void encode(byte[] pArray, int i, int length);  // package protected for access from I/O streams
 
-    abstract void decode(byte[] pArray, int i, int length, Context context); // package protected for access from I/O streams
+    abstract void decode(byte[] pArray, int i, int length); // package protected for access from I/O streams
     
     /**
      * Returns whether or not the <code>octet</code> is in the current alphabet.

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/BaseNCodecInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/BaseNCodecInputStream.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/BaseNCodecInputStream.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/BaseNCodecInputStream.java Mon Apr  2 12:03:59 2012
@@ -23,8 +23,6 @@ import java.io.FilterInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 
-import org.apache.commons.codec.binary.BaseNCodec.Context;
-
 /**
  * Abstract superclass for Base-N input streams.
  * 
@@ -38,8 +36,6 @@ public class BaseNCodecInputStream exten
 
     private final byte[] singleByte = new byte[1];
 
-    private Context context = new Context();
-
     protected BaseNCodecInputStream(InputStream in, BaseNCodec baseNCodec, boolean doEncode) {
         super(in);
         this.doEncode = doEncode;
@@ -59,7 +55,8 @@ public class BaseNCodecInputStream exten
         //       data available. As we do not know for sure how much data is left,
         //       just return 1 as a safe guess.
 
-        return context.eof ? 0 : 1;
+        // use the EOF flag of the underlying codec instance
+        return baseNCodec.eof ? 0 : 1;
     }
 
     /**
@@ -139,16 +136,16 @@ public class BaseNCodecInputStream exten
              This is a fix for CODEC-101
             */
             while (readLen == 0) {
-                if (!baseNCodec.hasData(context)) {
+                if (!baseNCodec.hasData()) {
                     byte[] buf = new byte[doEncode ? 4096 : 8192];
                     int c = in.read(buf);
                     if (doEncode) {
-                        baseNCodec.encode(buf, 0, c, context);
+                        baseNCodec.encode(buf, 0, c);
                     } else {
-                        baseNCodec.decode(buf, 0, c, context);
+                        baseNCodec.decode(buf, 0, c);
                     }
                 }
-                readLen = baseNCodec.readResults(b, offset, len, context);
+                readLen = baseNCodec.readResults(b, offset, len);
             }
             return readLen;
         }

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/BaseNCodecOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/BaseNCodecOutputStream.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/BaseNCodecOutputStream.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/BaseNCodecOutputStream.java Mon Apr  2 12:03:59 2012
@@ -23,8 +23,6 @@ import java.io.FilterOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
 
-import org.apache.commons.codec.binary.BaseNCodec.Context;
-
 /**
  * Abstract superclass for Base-N output streams.
  * 
@@ -38,9 +36,6 @@ public class BaseNCodecOutputStream exte
 
     private final byte[] singleByte = new byte[1];
 
-    private Context context = new Context();
-
-    // TODO should this be protected?
     public BaseNCodecOutputStream(OutputStream out, BaseNCodec basedCodec, boolean doEncode) {
         super(out);
         this.baseNCodec = basedCodec;
@@ -89,9 +84,9 @@ public class BaseNCodecOutputStream exte
             throw new IndexOutOfBoundsException();
         } else if (len > 0) {
             if (doEncode) {
-                baseNCodec.encode(b, offset, len, context);
+                baseNCodec.encode(b, offset, len);
             } else {
-                baseNCodec.decode(b, offset, len, context);
+                baseNCodec.decode(b, offset, len);
             }
             flush(false);
         }
@@ -107,10 +102,10 @@ public class BaseNCodecOutputStream exte
      *             if an I/O error occurs.
      */
     private void flush(boolean propogate) throws IOException {
-        int avail = baseNCodec.available(context);
+        int avail = baseNCodec.available();
         if (avail > 0) {
             byte[] buf = new byte[avail];
-            int c = baseNCodec.readResults(buf, 0, avail, context);
+            int c = baseNCodec.readResults(buf, 0, avail);
             if (c > 0) {
                 out.write(buf, 0, c);
             }
@@ -141,9 +136,9 @@ public class BaseNCodecOutputStream exte
     public void close() throws IOException {
         // Notify encoder of EOF (-1).
         if (doEncode) {
-            baseNCodec.encode(singleByte, 0, EOF, context);
+            baseNCodec.encode(singleByte, 0, EOF);
         } else {
-            baseNCodec.decode(singleByte, 0, EOF, context);
+            baseNCodec.decode(singleByte, 0, EOF);
         }
         flush();
         out.close();

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/BinaryCodec.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/BinaryCodec.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/BinaryCodec.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/BinaryCodec.java Mon Apr  2 12:03:59 2012
@@ -28,6 +28,7 @@ import org.apache.commons.codec.EncoderE
  * TODO: may want to add more bit vector functions like and/or/xor/nand 
  * TODO: also might be good to generate boolean[] from byte[] et cetera.
  * 
+ * @author Apache Software Foundation
  * @since 1.3
  * @version $Id$
  */

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Hex.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Hex.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Hex.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Hex.java Mon Apr  2 12:03:59 2012
@@ -32,6 +32,7 @@ import org.apache.commons.codec.EncoderE
  * {@link #DEFAULT_CHARSET_NAME}
  * 
  * @since 1.1
+ * @author Apache Software Foundation
  * @version $Id$
  */
 public class Hex implements BinaryEncoder, BinaryDecoder {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/StringUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/StringUtils.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/StringUtils.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/StringUtils.java Mon Apr  2 12:03:59 2012
@@ -29,6 +29,7 @@ import org.apache.commons.codec.Charsets
  * 
  * @see CharEncoding
  * @see <a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
+ * @author <a href="mailto:ggregory@seagullsw.com">Gary Gregory</a>
  * @version $Id$
  * @since 1.4
  */

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/DigestUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/DigestUtils.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/DigestUtils.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/DigestUtils.java Mon Apr  2 12:03:59 2012
@@ -28,6 +28,7 @@ import org.apache.commons.codec.binary.S
 /**
  * Operations to simplify common {@link java.security.MessageDigest} tasks. This class is thread safe.
  * 
+ * @author Apache Software Foundation
  * @version $Id$
  */
 public class DigestUtils {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/AbstractCaverphone.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/AbstractCaverphone.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/AbstractCaverphone.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/AbstractCaverphone.java Mon Apr  2 12:03:59 2012
@@ -26,6 +26,7 @@ import org.apache.commons.codec.StringEn
  * This is an algorithm created by the Caversham Project at the University of Otago. It implements the Caverphone 2.0
  * algorithm:
  * 
+ * @author Apache Software Foundation
  * @version $Id: Caverphone.java 1075947 2011-03-01 17:56:14Z ggregory $
  * @see <a href="http://en.wikipedia.org/wiki/Caverphone">Wikipedia - Caverphone</a>
  * @since 1.5

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Caverphone.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Caverphone.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Caverphone.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Caverphone.java Mon Apr  2 12:03:59 2012
@@ -26,6 +26,7 @@ import org.apache.commons.codec.StringEn
  * This is an algorithm created by the Caversham Project at the University of Otago. It implements the Caverphone 2.0
  * algorithm:
  * 
+ * @author Apache Software Foundation
  * @version $Id: Caverphone.java 1079535 2011-03-08 20:54:37Z ggregory $
  * @see <a href="http://en.wikipedia.org/wiki/Caverphone">Wikipedia - Caverphone</a>
  * @see <a href="http://caversham.otago.ac.nz/files/working/ctp150804.pdf">Caverphone 2.0 specification</a>

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Caverphone1.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Caverphone1.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Caverphone1.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Caverphone1.java Mon Apr  2 12:03:59 2012
@@ -23,6 +23,7 @@ package org.apache.commons.codec.languag
  * This is an algorithm created by the Caversham Project at the University of Otago. It implements the Caverphone 1.0
  * algorithm:
  * 
+ * @author Apache Software Foundation
  * @version $Id: Caverphone.java 1075947 2011-03-01 17:56:14Z ggregory $
  * @see <a href="http://en.wikipedia.org/wiki/Caverphone">Wikipedia - Caverphone</a>
  * @see <a href="http://caversham.otago.ac.nz/files/working/ctp060902.pdf">Caverphone 1.0 specification</a>

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Caverphone2.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Caverphone2.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Caverphone2.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Caverphone2.java Mon Apr  2 12:03:59 2012
@@ -23,6 +23,7 @@ package org.apache.commons.codec.languag
  * This is an algorithm created by the Caversham Project at the University of Otago. It implements the Caverphone 2.0
  * algorithm:
  * 
+ * @author Apache Software Foundation
  * @version $Id: Caverphone.java 1075947 2011-03-01 17:56:14Z ggregory $
  * @see <a href="http://en.wikipedia.org/wiki/Caverphone">Wikipedia - Caverphone</a>
  * @see <a href="http://caversham.otago.ac.nz/files/working/ctp150804.pdf">Caverphone 2.0 specification</a>

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/ColognePhonetic.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/ColognePhonetic.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/ColognePhonetic.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/ColognePhonetic.java Mon Apr  2 12:03:59 2012
@@ -177,6 +177,7 @@ import org.apache.commons.codec.StringEn
  * </ul>
  * 
  * @see <a href="http://de.wikipedia.org/wiki/K%C3%B6lner_Phonetik">Wikipedia (de): K&ouml;lner Phonetik (in German)</a>
+ * @author Apache Software Foundation
  * @since 1.5
  */
 public class ColognePhonetic implements StringEncoder {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/DoubleMetaphone.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/DoubleMetaphone.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/DoubleMetaphone.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/DoubleMetaphone.java Mon Apr  2 12:03:59 2012
@@ -27,6 +27,7 @@ import org.apache.commons.codec.StringEn
  * @see <a href="http://drdobbs.com/184401251?pgno=2">Original Article</a>
  * @see <a href="http://en.wikipedia.org/wiki/Metaphone">http://en.wikipedia.org/wiki/Metaphone</a>
  *
+ * @author Apache Software Foundation
  * @version $Id$
  */
 public class DoubleMetaphone implements StringEncoder {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Metaphone.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Metaphone.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Metaphone.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Metaphone.java Mon Apr  2 12:03:59 2012
@@ -37,6 +37,7 @@ import org.apache.commons.codec.StringEn
  * For more information, see <a href="https://issues.apache.org/jira/browse/CODEC-57">CODEC-57</a>.
  * </p>
  * 
+ * @author Apache Software Foundation
  * @version $Id$
  */
 public class Metaphone implements StringEncoder {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/RefinedSoundex.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/RefinedSoundex.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/RefinedSoundex.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/RefinedSoundex.java Mon Apr  2 12:03:59 2012
@@ -25,6 +25,7 @@ import org.apache.commons.codec.StringEn
  * optimized for spell checking words. Soundex method originally developed by
  * <CITE>Margaret Odell</CITE> and <CITE>Robert Russell</CITE>.
  * 
+ * @author Apache Software Foundation
  * @version $Id$
  */
 public class RefinedSoundex implements StringEncoder {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Soundex.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Soundex.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Soundex.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/Soundex.java Mon Apr  2 12:03:59 2012
@@ -24,6 +24,7 @@ import org.apache.commons.codec.StringEn
  * Encodes a string into a Soundex value. Soundex is an encoding used to relate similar names, but can also be used as a
  * general purpose scheme to find word with similar phonemes.
  * 
+ * @author Apache Software Foundation
  * @version $Id$
  */
 public class Soundex implements StringEncoder {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/SoundexUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/SoundexUtils.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/SoundexUtils.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/SoundexUtils.java Mon Apr  2 12:03:59 2012
@@ -23,6 +23,7 @@ import org.apache.commons.codec.StringEn
 /**
  * Utility methods for {@link Soundex} and {@link RefinedSoundex} classes.
  * 
+ * @author Apache Software Foundation
  * @version $Id$
  * @since 1.3
  */

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/BeiderMorseEncoder.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/BeiderMorseEncoder.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/BeiderMorseEncoder.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/BeiderMorseEncoder.java Mon Apr  2 12:03:59 2012
@@ -74,6 +74,7 @@ import org.apache.commons.codec.StringEn
  * splitting on pipe (<code>|</code>) and indexing under each of these alternatives.
  * </p>
  * 
+ * @author Apache Software Foundation
  * @since 1.6
  */
 public class BeiderMorseEncoder implements StringEncoder {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Lang.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Lang.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Lang.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Lang.java Mon Apr  2 12:03:59 2012
@@ -67,6 +67,7 @@ import java.util.regex.Pattern;
  * <p/>
  * Port of lang.php
  * 
+ * @author Apache Software Foundation
  * @since 1.6
  */
 public class Lang {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Languages.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Languages.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Languages.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Languages.java Mon Apr  2 12:03:59 2012
@@ -49,6 +49,7 @@ import java.util.Set;
  * Ported from language.php
  * </p>
  * 
+ * @author Apache Software Foundation
  * @since 1.6
  */
 public class Languages {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/NameType.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/NameType.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/NameType.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/NameType.java Mon Apr  2 12:03:59 2012
@@ -22,6 +22,7 @@ package org.apache.commons.codec.languag
  * <code>GENERIC</code> NameType should work reasonably well for non-name words. The other encodings are specifically
  * tuned to family names, and may not work well at all for general text.
  * 
+ * @author Apache Software Foundation
  * @since 1.6
  */
 public enum NameType {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/PhoneticEngine.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/PhoneticEngine.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/PhoneticEngine.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/PhoneticEngine.java Mon Apr  2 12:03:59 2012
@@ -47,6 +47,7 @@ import java.util.TreeSet;
  * Ported from phoneticengine.php
  * </p>
  * 
+ * @author Apache Software Foundation
  * @since 1.6
  */
 public class PhoneticEngine {
@@ -55,6 +56,7 @@ public class PhoneticEngine {
      * Utility for manipulating a set of phonemes as they are being built up. Not intended for use outside this package,
      * and probably not outside the {@link PhoneticEngine} class.
      *
+     * @author Apache Software Foundation
      * @since 1.6
      */
     static final class PhonemeBuilder {
@@ -163,6 +165,7 @@ public class PhoneticEngine {
      * matching rule was found, <code>phonemeBuilder</code> is replaced with a new buidler containing the phonemes
      * updated by the matching rule.
      *
+     * @author Apache Software Foundation
      * @since 1.6
      */
     private static final class RulesApplication {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/ResourceConstants.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/ResourceConstants.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/ResourceConstants.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/ResourceConstants.java Mon Apr  2 12:03:59 2012
@@ -22,6 +22,7 @@ import org.apache.commons.codec.CharEnco
 /**
  * Constants used to process resource files.
  * 
+ * @author Apache Software Foundation
  * @since 1.6
  */
 class ResourceConstants {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Rule.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Rule.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Rule.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/Rule.java Mon Apr  2 12:03:59 2012
@@ -76,6 +76,7 @@ import java.util.regex.Pattern;
  * </ul>
  * </p>
  * 
+ * @author Apache Software Foundation
  * @since 1.6
  */
 public class Rule {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/RuleType.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/RuleType.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/RuleType.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/language/bm/RuleType.java Mon Apr  2 12:03:59 2012
@@ -20,6 +20,7 @@ package org.apache.commons.codec.languag
 /**
  * Types of rule.
  * 
+ * @author Apache Software Foundation
  * @since 1.6
  */
 public enum RuleType {

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/BCodec.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/BCodec.java?rev=1308314&r1=1308313&r2=1308314&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/BCodec.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/BCodec.java Mon Apr  2 12:03:59 2012
@@ -43,6 +43,7 @@ import org.apache.commons.codec.binary.B
  * @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>
  * 
+ * @author Apache Software Foundation
  * @since 1.3
  * @version $Id$
  */

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=1308314&r1=1308313&r2=1308314&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 Mon Apr  2 12:03:59 2012
@@ -44,6 +44,7 @@ import org.apache.commons.codec.StringEn
  * @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>
  * 
+ * @author Apache Software Foundation
  * @since 1.3
  * @version $Id$
  */

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=1308314&r1=1308313&r2=1308314&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 Mon Apr  2 12:03:59 2012
@@ -58,6 +58,7 @@ import org.apache.commons.codec.binary.S
  * @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>
  * 
+ * @author Apache Software Foundation
  * @since 1.3
  * @version $Id$
  */

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=1308314&r1=1308313&r2=1308314&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 Mon Apr  2 12:03:59 2012
@@ -41,6 +41,7 @@ import org.apache.commons.codec.binary.S
  * Message Header Extensions for Non-ASCII Text</a>
  * </p>
  * 
+ * @author Apache Software Foundation
  * @since 1.3
  * @version $Id$
  */

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=1308314&r1=1308313&r2=1308314&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 Mon Apr  2 12:03:59 2012
@@ -46,6 +46,7 @@ import org.apache.commons.codec.binary.S
  * 1.4 rely on the platform's default charset encoding.
  * </p>
  * 
+ * @author Apache Software Foundation
  * @since 1.2
  * @version $Id$
  */

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=1308314&r1=1308313&r2=1308314&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 Mon Apr  2 12:03:59 2012
@@ -22,6 +22,7 @@ import org.apache.commons.codec.DecoderE
 /**
  * Utility methods for this package.
  * 
+ * @author <a href="mailto:ggregory@seagullsw.com">Gary Gregory</a>
  * @version $Id$
  * @since 1.4
  */

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=1308314&r1=1308313&r2=1308314&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 Mon Apr  2 12:03:59 2012
@@ -87,16 +87,15 @@ public class Base32Test {
     public void testSingleCharEncoding() {
         for (int i = 0; i < 20; i++) {
             Base32 codec = new Base32();
-            BaseNCodec.Context context = new BaseNCodec.Context();
             byte unencoded[] = new byte[i];
             byte allInOne[] = codec.encode(unencoded);
             codec = new Base32();
             for (int j=0; j< unencoded.length; j++) {
-                codec.encode(unencoded, j, 1, context);
+                codec.encode(unencoded, j, 1);
             }
-            codec.encode(unencoded, 0, -1, context);
+            codec.encode(unencoded, 0, -1);
             byte singly[] = new byte[allInOne.length];
-            codec.readResults(singly, 0, 100, context);
+            codec.readResults(singly, 0, 100);
             if (!Arrays.equals(allInOne, singly)){
                 fail();
             }



Mime
View raw message