commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1683550 - in /commons/proper/codec/trunk/src: changes/changes.xml main/java/org/apache/commons/codec/binary/Base32.java test/java/org/apache/commons/codec/binary/Base32Test.java
Date Thu, 04 Jun 2015 14:01:16 GMT
Author: sebb
Date: Thu Jun  4 14:01:15 2015
New Revision: 1683550

URL: http://svn.apache.org/r1683550
Log:
CODEC-200 - Base32.HEX_DECODE_TABLE contains the wrong value 32

Modified:
    commons/proper/codec/trunk/src/changes/changes.xml
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base32.java
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base32Test.java

Modified: commons/proper/codec/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/changes/changes.xml?rev=1683550&r1=1683549&r2=1683550&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/changes/changes.xml (original)
+++ commons/proper/codec/trunk/src/changes/changes.xml Thu Jun  4 14:01:15 2015
@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
 <!--
    Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
@@ -39,10 +39,11 @@ The <action> type attribute can be add,u
 <document>
   <properties>
     <title>Changes</title>
-    <author>Gary Gregory</author>
+    <author>Apache Commons Developers</author>
   </properties>
   <body>
     <release version="1.11" date="DD MM 2015" description="Feature and fix release.">
       
+      <action issue="CODEC-200" dev="sebb" type="fix" due-to="Luciano Vernaschi">Base32.HEX_DECODE_TABLE
contains the wrong value 32</action>   
       <action dev="ggregory" type="add" issue="CODEC-199" due-to="Yossi Tamari">Bug
in HW rule in Soundex</action>         
       <action dev="ggregory" type="add" issue="CODEC-183" due-to="Steven Wurster">BaseNCodecOutputStream
only supports writing EOF on close()</action>         
       <action dev="ggregory" type="add" issue="CODEC-195" due-to="Gary Gregory">Support
SHA-224 in DigestUtils on Java 8</action>         

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=1683550&r1=1683549&r2=1683550&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 Thu
Jun  4 14:01:15 2015
@@ -70,8 +70,8 @@ public class Base32 extends BaseNCodec {
             -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10-1f
             -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20-2f
             -1, -1, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, -1, -1, -1, -1, // 30-3f 2-7
-            -1,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, // 40-4f A-N
-            15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,                     // 50-5a O-Z
+            -1,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, // 40-4f A-O
+            15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,                     // 50-5a P-Z
     };
 
     /**
@@ -95,8 +95,8 @@ public class Base32 extends BaseNCodec {
             -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10-1f
             -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20-2f
              0,  1,  2,  3,  4,  5,  6,  7,  8,  9, -1, -1, -1, -1, -1, -1, // 30-3f 2-7
-            -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, // 40-4f A-N
-            25, 26, 27, 28, 29, 30, 31, 32,                                 // 50-57 O-V
+            -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, // 40-4f A-O
+            25, 26, 27, 28, 29, 30, 31,                                     // 50-57 P-V
     };
 
     /**

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=1683550&r1=1683549&r2=1683550&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
Thu Jun  4 14:01:15 2015
@@ -19,6 +19,7 @@
 package org.apache.commons.codec.binary;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
 
 import java.util.Arrays;
@@ -151,4 +152,11 @@ public class Base32Test {
                 assertEquals(element[1], codec.encodeAsString(element[0].getBytes(Charsets.UTF_8)));
         }
     }
+
+    @Test
+    public void testCodec200() {
+        final Base32 codec = new Base32(true, (byte)'W'); // should be allowed
+        assertNotNull(codec);
+    }
+
 }



Mime
View raw message