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/25 01:26:41 UTC
svn commit: r747624 -
/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java
Author: jwaldman
Date: Wed Feb 25 00:26:40 2009
New Revision: 747624
URL: http://svn.apache.org/viewvc?rev=747624&view=rev
Log:
revert 747476 and 746320 (TRINIDAD-1407 DateTimeConverter doesn't convert correctly as per the expectedDataType) This is not working in our tests and is being investigated.
Modified:
myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java
Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java?rev=747624&r1=747623&r2=747624&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java (original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java Wed Feb 25 00:26:40 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,14 +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())))
@@ -157,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);
@@ -178,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
@@ -264,7 +257,7 @@
component);
detailMessage = XhtmlLafUtils.escapeJS(msg.getDetail());
}
-
+
String exampleString = XhtmlLafUtils.escapeJS(getExample(context));
String escapedType = XhtmlLafUtils.escapeJS(getType().toUpperCase());
@@ -276,7 +269,7 @@
{
outBuffer.append(",'");
outBuffer.append (loc.toString());
- outBuffer.append ("','");
+ outBuffer.append ("','");
}
else
{
@@ -291,8 +284,8 @@
{
messages.put("detail", detailMessage);
messages.put("hint", hintFormat);
- outBuffer.append(',');
-
+ outBuffer.append(',');
+
try
{
JsonUtils.writeMap(outBuffer, messages, false);
@@ -536,7 +529,7 @@
XhtmlUtils.escapeJS(buffer, pattern);
buffer.append('\'');
}
-
+
private String _getHint()
{
String type = getType();
@@ -548,7 +541,7 @@
{
return getHintBoth();
}
- else
+ else
{
return getHintTime();
}
@@ -571,7 +564,7 @@
}
return buffer.toString();
}
-
+
private String _getLocaleString (FacesContext context)
{
Locale dateTimeConverterLocale = getLocale();
@@ -589,7 +582,7 @@
return (sb.toString());
}
}
- return "null";
+ return "null";
}
// Bug 4570591