You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2008/07/29 16:09:14 UTC

svn commit: r680702 - /myfaces/core/trunk_1.2.x/api/src/main/java/javax/faces/convert/DateTimeConverter.java

Author: lu4242
Date: Tue Jul 29 07:09:14 2008
New Revision: 680702

URL: http://svn.apache.org/viewvc?rev=680702&view=rev
Log:
MYFACES-1893 DateTimeConverter date format for converter exception args

Modified:
    myfaces/core/trunk_1.2.x/api/src/main/java/javax/faces/convert/DateTimeConverter.java

Modified: myfaces/core/trunk_1.2.x/api/src/main/java/javax/faces/convert/DateTimeConverter.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk_1.2.x/api/src/main/java/javax/faces/convert/DateTimeConverter.java?rev=680702&r1=680701&r2=680702&view=diff
==============================================================================
--- myfaces/core/trunk_1.2.x/api/src/main/java/javax/faces/convert/DateTimeConverter.java (original)
+++ myfaces/core/trunk_1.2.x/api/src/main/java/javax/faces/convert/DateTimeConverter.java Tue Jul 29 07:09:14 2008
@@ -90,21 +90,17 @@
                 }
                 catch (ParseException e)
                 {
-                    try {
-                        String type = getType();
-                        Object[] args = new Object[]{value,format.parse(new Date().toString()),_MessageUtils.getLabel(facesContext, uiComponent)};
-                        
-                        if(type.equals(TYPE_DATE))
-                            throw new ConverterException(_MessageUtils.getErrorMessage(facesContext,DATE_ID,args));
-                        else if (type.equals(TYPE_TIME))
-                            throw new ConverterException(_MessageUtils.getErrorMessage(facesContext,TIME_ID,args));
-                        else if (type.equals(TYPE_BOTH))
-                            throw new ConverterException(_MessageUtils.getErrorMessage(facesContext,DATETIME_ID,args));
-                        else
-                            throw new ConverterException("invalid type '" + _type + "'");
-                    }catch(ParseException exception) {
-                        throw new ConverterException(exception);
-                    }
+                    String type = getType();
+                    Object[] args = new Object[]{value,format.format(new Date()),_MessageUtils.getLabel(facesContext, uiComponent)};
+                    
+                    if(type.equals(TYPE_DATE))
+                        throw new ConverterException(_MessageUtils.getErrorMessage(facesContext,DATE_ID,args));
+                    else if (type.equals(TYPE_TIME))
+                        throw new ConverterException(_MessageUtils.getErrorMessage(facesContext,TIME_ID,args));
+                    else if (type.equals(TYPE_BOTH))
+                        throw new ConverterException(_MessageUtils.getErrorMessage(facesContext,DATETIME_ID,args));
+                    else
+                        throw new ConverterException("invalid type '" + _type + "'");
                 }
             }
         }