commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: svn commit: r1456857 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java
Date Sun, 17 Mar 2013 11:00:04 GMT
On 15 March 2013 10:11,  <simonetripodi@apache.org> wrote:
> Author: simonetripodi
> Date: Fri Mar 15 10:11:09 2013
> New Revision: 1456857
>
> URL: http://svn.apache.org/r1456857
> Log:
> checkstyle: '4' is a magic number.
>
> Modified:
>     commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java
>
> Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java
> URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java?rev=1456857&r1=1456856&r2=1456857&view=diff
> ==============================================================================
> --- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java
(original)
> +++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java
Fri Mar 15 10:11:09 2013
> @@ -34,6 +34,11 @@ final class QuotedPrintableDecoder {
>      };
>
>      /**
> +     * The default number of byte shift for decode.
> +     */
> +    private static final int OUT_SHIFT = 4;
> +

The Javadoc needs to say why the value 4 is used, otherwise it's still
a magic number.

> +    /**
>       * the decoding table size.
>       */
>      private static final int DECODING_TABLE_SIZE = 128;
> @@ -99,7 +104,7 @@ final class QuotedPrintableDecoder {
>                      // this is a hex pair we need to convert back to a single byte.
>                      byte c1 = DECODING_TABLE[b1];
>                      byte c2 = DECODING_TABLE[b2];
> -                    out.write((c1 << 4) | c2);
> +                    out.write((c1 << OUT_SHIFT) | c2);
>                      // 3 bytes in, one byte out
>                      bytesWritten++;
>                  }
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message