You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by to...@apache.org on 2006/01/07 20:57:53 UTC

svn commit: r366897 - in /jakarta/commons/proper/codec/trunk: RELEASE-NOTES.txt src/java/org/apache/commons/codec/language/Soundex.java src/test/org/apache/commons/codec/language/SoundexTest.java

Author: tobrien
Date: Sat Jan  7 11:57:36 2006
New Revision: 366897

URL: http://svn.apache.org/viewcvs?rev=366897&view=rev
Log:
Addresses issue 37894.  Order of static initialization causes
an NPE when trying to use static US_ENGLISH in Soundex.
Issue was found by Reggie Riser.

Modified:
    jakarta/commons/proper/codec/trunk/RELEASE-NOTES.txt
    jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/Soundex.java
    jakarta/commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/SoundexTest.java

Modified: jakarta/commons/proper/codec/trunk/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/codec/trunk/RELEASE-NOTES.txt?rev=366897&r1=366896&r2=366897&view=diff
==============================================================================
--- jakarta/commons/proper/codec/trunk/RELEASE-NOTES.txt (original)
+++ jakarta/commons/proper/codec/trunk/RELEASE-NOTES.txt Sat Jan  7 11:57:36 2006
@@ -1,4 +1,4 @@
-The commons-codec team is pleased to announce the Codec 1.3 release! 
+The commons-codec team is pleased to announce the Codec 1.3.1 release! 
 
 http://jakarta.apache.org/commons/codec/
 
@@ -11,42 +11,16 @@
 
   New Features:
 
-o BinaryCodec: Encodes and decodes binary to and from Strings of 0s and 1s. 
-  Issue: 27813. Thanks to Alex Karasulu. 
-o QuotedPrintableCodec: Codec for RFC 1521 MIME (Multipurpose Internet Mail 
-  Extensions) Part One. Rules #3, #4, and #5 of the quoted-printable spec are 
-  not implemented yet. See also issue 27789. Issue: 26617. Thanks to Oleg 
-  Kalnichevski. 
-o BCodec: Identical to the Base64 encoding defined by RFC 1521 and allows a 
-  character set to be specified. Issue: 26617. Thanks to Oleg Kalnichevski. 
-o QCodec: Similar to the Quoted-Printable content-transfer-encoding defined 
-  in RFC 1521 and designed to allow text containing mostly ASCII characters 
-  to be decipherable on an ASCII terminal without decoding. Issue: 26617. 
-  Thanks to Oleg Kalnichevski. 
-o Soundex: Implemented the DIFFERENCE algorithm. Issue: 25243. Thanks to 
-  Matthew Inger. 
-o RefinedSoundex: Implemented the DIFFERENCE algorithm. Issue: 25243. Thanks 
-  to Matthew Inger. 
-
+o 
   Fixed bugs:
 
-o The default URL encoding logic was broken. Issue: 25995. Thanks to Oleg 
-  Kalnichevski. 
-o Base64 chunked encoding not compliant with RFC 2045 section 2.1 CRLF. 
-  Issue: 27781. Thanks to Gary D. Gregory. 
-o Hex converts illegal characters to 255. Issue: 28455. 
-o Metaphone now correctly handles a silent B in a word that ends in MB. 
-  "COMB" is encoded as "KM", before this fix "COMB" was encoded as "KMB". 
-  Issue: 28457. 
-o Added missing tags in Javadoc comments. 
-o General Javadoc improvements. 
+o Using US_ENGLISH in Soundex causes an NPE.  Issue addressed and
+  test case added to SoundexTest.
+  Issue: 37894. Thanks to Reggie Riser. 
 
   Changes:
 
-o This version is relesed under the Apache License 2.0 , please see 
-  LICENSE.txt. Previous versions were released under the Apache License 1.1. 
-o The Board recommendation to remove Javadoc author tags has been 
-  implemented. All author tags are now "Apache Software Foundation".  
+o 
 
 Have fun!
 -The commons-codec team

Modified: jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/Soundex.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/Soundex.java?rev=366897&r1=366896&r2=366897&view=diff
==============================================================================
--- jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/Soundex.java (original)
+++ jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/Soundex.java Sat Jan  7 11:57:36 2006
@@ -29,13 +29,6 @@
 public class Soundex implements StringEncoder {
 
     /**
-     * An instance of Soundex using the US_ENGLISH_MAPPING mapping.
-     * 
-     * @see #US_ENGLISH_MAPPING
-     */
-    public static final Soundex US_ENGLISH = new Soundex();
-
-    /**
      * This is a default mapping of the 26 letters used in US English. A value of <code>0</code> for a letter position
      * means do not encode.
      * <p>
@@ -54,6 +47,14 @@
      * @see Soundex#Soundex(char[])
      */
     public static final char[] US_ENGLISH_MAPPING = US_ENGLISH_MAPPING_STRING.toCharArray();
+
+    /**
+     * An instance of Soundex using the US_ENGLISH_MAPPING mapping.
+     * 
+     * @see #US_ENGLISH_MAPPING
+     */
+    public static final Soundex US_ENGLISH = new Soundex();
+
 
     /**
      * Encodes the Strings and returns the number of characters in the two encoded Strings that are the same. This

Modified: jakarta/commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/SoundexTest.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/SoundexTest.java?rev=366897&r1=366896&r2=366897&view=diff
==============================================================================
--- jakarta/commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/SoundexTest.java (original)
+++ jakarta/commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/SoundexTest.java Sat Jan  7 11:57:36 2006
@@ -367,4 +367,16 @@
             // expected
         }
     }
+    
+    // This test fails.
+    public void testUsEnglishStatic()
+    {
+        assertEquals( Soundex.US_ENGLISH.soundex( "Williams" ), "W452" );
+    }
+
+    // This test succeeds.
+    public void testNewInstance()
+    {
+        assertEquals( new Soundex().soundex( "Williams" ), "W452" );
+    }
 }



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