commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r669755 - in /commons/proper/codec/trunk/src/java/org/apache/commons/codec: language/Soundex.java net/BCodec.java net/QCodec.java
Date Fri, 20 Jun 2008 01:21:52 GMT
Author: sebb
Date: Thu Jun 19 18:21:52 2008
New Revision: 669755

URL: http://svn.apache.org/viewvc?rev=669755&view=rev
Log:
Make private fields final (thread safety)

Modified:
    commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/Soundex.java
    commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/BCodec.java
    commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/QCodec.java

Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/Soundex.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/Soundex.java?rev=669755&r1=669754&r2=669755&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/Soundex.java (original)
+++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/Soundex.java Thu
Jun 19 18:21:52 2008
@@ -91,7 +91,7 @@
      * Every letter of the alphabet is "mapped" to a numerical value. This char array holds
the values to which each
      * letter is mapped. This implementation contains a default map for US_ENGLISH
      */
-    private char[] soundexMapping;
+    private final char[] soundexMapping;
 
     /**
      * Creates an instance using US_ENGLISH_MAPPING
@@ -114,7 +114,7 @@
      *                  Mapping array to use when finding the corresponding code for a given
character
      */
     public Soundex(char[] mapping) {
-        this.setSoundexMapping(mapping);
+        this.soundexMapping= mapping;
     }
 
     /**
@@ -228,17 +228,7 @@
     }
 
     /**
-     * Sets the soundexMapping.
-     * 
-     * @param soundexMapping
-     *                  The soundexMapping to set.
-     */
-    private void setSoundexMapping(char[] soundexMapping) {
-        this.soundexMapping = soundexMapping;
-    }
-
-    /**
-     * Retreives the Soundex code for a given String object.
+     * Retrieves the Soundex code for a given String object.
      * 
      * @param str
      *                  String to encode using the Soundex algorithm

Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/BCodec.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/BCodec.java?rev=669755&r1=669754&r2=669755&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/BCodec.java (original)
+++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/BCodec.java Thu Jun 19
18:21:52 2008
@@ -48,13 +48,13 @@
     /**
      * The default charset used for string decoding and encoding.
      */
-    private String charset = CharacterEncodingNames.UTF8;
+    private final String charset;
 
     /**
      * Default constructor.
      */
     public BCodec() {
-        super();
+        this(CharacterEncodingNames.UTF8);
     }
 
     /**

Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/QCodec.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/QCodec.java?rev=669755&r1=669754&r2=669755&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/QCodec.java (original)
+++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/QCodec.java Thu Jun 19
18:21:52 2008
@@ -49,7 +49,7 @@
     /**
      * The default charset used for string decoding and encoding.
      */
-    private String charset = CharacterEncodingNames.UTF8;
+    private final String charset;
 
     /**
      * BitSet of printable characters as defined in RFC 1522.
@@ -109,7 +109,7 @@
      * Default constructor.
      */
     public QCodec() {
-        super();
+        this(CharacterEncodingNames.UTF8);
     }
 
     /**



Mime
View raw message