Author: skitching
Date: Wed Jun  8 03:52:15 2005
New Revision: 189571

URL: http://svn.apache.org/viewcvs?rev=189571&view=rev
Log:
Fix PUBLIC NON-FINAL member of this class!!!!  The member really should be 
final, and there is no reason for it to be anything other than private.

Note that this member was added since the 1.7.0 release so it is safe
to change its accessability.

Modified:
    
jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/DateLocaleConverter.java

Modified: 
jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/DateLocaleConverter.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/DateLocaleConverter.java?rev=189571&r1=189570&r2=189571&view=diff
==============================================================================
--- 
jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/DateLocaleConverter.java
 (original)
+++ 
jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/DateLocaleConverter.java
 Wed Jun  8 03:52:15 2005
@@ -50,8 +50,11 @@
     /** Should the date conversion be lenient? */
     boolean isLenient = false;
 
-    /** Default Pattern Characters */
-    public static String defaultChars;
+    /** 
+     * Default Pattern Characters 
+     * 
+     */
+    private static final String defaultChars = initDefaultChars();
 
     // ----------------------------------------------------------- Constructors
 
@@ -284,12 +287,6 @@
          // However, it is the best way that anyone can come up with 
          // that works with some 1.4 series JVM.
          
-         // Initialize the default symbols
-         if (defaultChars == null) {
-             DateFormatSymbols defaultSymbols = new 
DateFormatSymbols(Locale.US);
-             defaultChars = defaultSymbols.getLocalPatternChars();
-         }
- 
          // Get the symbols for the localized pattern
          DateFormatSymbols localizedSymbols = new DateFormatSymbols(locale);
          String localChars = localizedSymbols.getLocalPatternChars();
@@ -345,4 +342,15 @@
 
         return converted.toString();
     }
+
+    /**
+     * This method is called at class initialization time to define the
+     * value for constant member defaultChars. All other methods needing
+     * this data should just read that constant.
+     */
+    private static String initDefaultChars() {
+        DateFormatSymbols defaultSymbols = new DateFormatSymbols(Locale.US);
+        return defaultSymbols.getLocalPatternChars();
+    }
+
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to