velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nbu...@apache.org
Subject svn commit: r594625 - in /velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools: ConversionUtils.java generic/DateTool.java
Date Tue, 13 Nov 2007 20:05:56 GMT
Author: nbubna
Date: Tue Nov 13 12:05:55 2007
New Revision: 594625

URL: http://svn.apache.org/viewvc?rev=594625&view=rev
Log:
s/getStyleAsInt/getDateStyleAsInt to make clear distinction between date and number styles

Modified:
    velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/ConversionUtils.java
    velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/generic/DateTool.java

Modified: velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/ConversionUtils.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/ConversionUtils.java?rev=594625&r1=594624&r2=594625&view=diff
==============================================================================
--- velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/ConversionUtils.java
(original)
+++ velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/ConversionUtils.java
Tue Nov 13 12:05:55 2007
@@ -289,20 +289,20 @@
         if (format.endsWith("_date"))
         {
             String fmt = format.substring(0, format.length() - 5);
-            int style = getStyleAsInt(fmt);
+            int style = getDateStyleAsInt(fmt);
             df = getDateFormat(style, -1, locale, timezone);
         }
         // do they want a time instance?
         else if (format.endsWith("_time"))
         {
             String fmt = format.substring(0, format.length() - 5);
-            int style = getStyleAsInt(fmt);
+            int style = getDateStyleAsInt(fmt);
             df = getDateFormat(-1, style, locale, timezone);
         }
         // ok, they either want a custom or date-time instance
         else
         {
-            int style = getStyleAsInt(format);
+            int style = getDateStyleAsInt(format);
             if (style < 0)
             {
                 // we have a custom format
@@ -332,8 +332,8 @@
     public static DateFormat getDateFormat(String dateStyle, String timeStyle,
                                            Locale locale, TimeZone timezone)
     {
-        int ds = getStyleAsInt(dateStyle);
-        int ts = getStyleAsInt(timeStyle);
+        int ds = getDateStyleAsInt(dateStyle);
+        int ts = getDateStyleAsInt(timeStyle);
         return getDateFormat(ds, ts, locale, timezone);
     }
 
@@ -397,7 +397,7 @@
      * @param style the string to be checked
      * @return the int identifying the style pattern
      */
-    public static int getStyleAsInt(String style)
+    public static int getDateStyleAsInt(String style)
     {
         // avoid needlessly running through all the string comparisons
         if (style == null || style.length() < 4 || style.length() > 7) {

Modified: velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/generic/DateTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/generic/DateTool.java?rev=594625&r1=594624&r2=594625&view=diff
==============================================================================
--- velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/generic/DateTool.java
(original)
+++ velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/generic/DateTool.java
Tue Nov 13 12:05:55 2007
@@ -585,7 +585,7 @@
     @Deprecated
     protected int getStyleAsInt(String style)
     {
-        return ConversionUtils.getStyleAsInt(style);
+        return ConversionUtils.getDateStyleAsInt(style);
     }
 
 



Mime
View raw message