You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by jw...@apache.org on 2009/02/24 22:57:53 UTC

svn commit: r747564 - /myfaces/trinidad/branches/1.2.10.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java

Author: jwaldman
Date: Tue Feb 24 21:57:52 2009
New Revision: 747564

URL: http://svn.apache.org/viewvc?rev=747564&view=rev
Log:
back out revisions 747483 and 746319

Modified:
    myfaces/trinidad/branches/1.2.10.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java

Modified: myfaces/trinidad/branches/1.2.10.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.10.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java?rev=747564&r1=747563&r2=747564&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.10.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java (original)
+++ myfaces/trinidad/branches/1.2.10.1-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java Tue Feb 24 21:57:52 2009
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *
+ * 
  *  http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -56,7 +56,7 @@
  * pushes all relevant information to the client side so that conversion can be
  * enabled at the client side.
  * </p>
- *
+ * 
  * @version $Name: $ ($Revision:
  *          adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/convert/DateTimeConverter.java#0 $)
  *          $Date: 10-nov-2005.19:06:22 $
@@ -120,15 +120,7 @@
     ValueExpression expression = component.getValueExpression("value");
     if (expression != null)
     {
-      Class<?> expectedType = expression.getExpectedType();
-
-      // If the expectedType is Object ask for the type which may be more specific
-      if(expectedType == Object.class)
-      {
-        expectedType = expression.getType(context.getELContext());
-      }
-
-
+      Class<?> expectedType = expression.getType(context.getELContext());
       // Sometimes the type might be null, if it cannot be determined:
       if ((expectedType != null)
           && (!expectedType.isAssignableFrom(value.getClass())))
@@ -158,8 +150,8 @@
             Throwable cause = e.getCause();
             if (cause == null)
               cause = e;
-
-            FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR,
+           
+            FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, 
                                                 MessageFactory.getString(context, UIXEditableValue.CONVERSION_MESSAGE_ID),
                                                 cause.getLocalizedMessage());
             throw new ConverterException(msg, e);
@@ -179,8 +171,8 @@
       _LOG
           .severe("The component is null, but it is needed for the client id, so no script written");
       return null;
-    }
-
+    }    
+        
     // Add a JavaScript Object to store the datefield formats
     // on the client-side. We currently store the format string
     // for each and every field. It'd be more efficient to have
@@ -265,7 +257,7 @@
             component);
         detailMessage = XhtmlLafUtils.escapeJS(msg.getDetail());
       }
-
+      
       String exampleString = XhtmlLafUtils.escapeJS(getExample(context));
       String escapedType = XhtmlLafUtils.escapeJS(getType().toUpperCase());
 
@@ -277,7 +269,7 @@
       {
         outBuffer.append(",'");
         outBuffer.append (loc.toString());
-        outBuffer.append ("','");
+        outBuffer.append ("','");        
       }
       else
       {
@@ -292,8 +284,8 @@
       {
         messages.put("detail", detailMessage);
         messages.put("hint", hintFormat);
-        outBuffer.append(',');
-
+        outBuffer.append(','); 
+        
         try
         {
           JsonUtils.writeMap(outBuffer, messages, false);
@@ -537,7 +529,7 @@
     XhtmlUtils.escapeJS(buffer, pattern);
     buffer.append('\'');
   }
-
+  
   private String _getHint()
   {
     String type = getType();
@@ -549,7 +541,7 @@
     {
       return getHintBoth();
     }
-    else
+    else 
     {
       return getHintTime();
     }
@@ -572,7 +564,7 @@
     }
     return buffer.toString();
   }
-
+  
   private String _getLocaleString (FacesContext context)
   {
     Locale dateTimeConverterLocale = getLocale();
@@ -590,7 +582,7 @@
         return (sb.toString());
       }
     }
-    return "null";
+    return "null";    
   }
 
   // Bug 4570591