Closed jbescos closed 2 years ago
As per the Javadoc:
If the base object is a map, returns the most general acceptable type for a value in this map. ... Assuming the base is a
Map
, this method will always returnObject.class
. This is because
Map
s accept any object as the value for a given key.
Hello, I have a question because of some problems with apache trinidad impl (find more context about this at the end). https://github.com/apache/myfaces-trinidad/blob/master/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java
That class is not working properly in the line 139 because Object is always assignable to a subclass.
Currently MapELResolver#getType returns Object.class. The MapELResolver#getValue return the value of the Map for the specified property.
Wouldn't make more sense to change the next in MapELResolver#getType to be more consistent with MapELResolver#getValue?.
Originally there is:
My suggestion:
More context about the issue:
In older JSF versions AstChoice#getType actually returns the class from the value:
But in new JSF versions, it relies in the getType:
Then, in older JSF versions the method MapELResolver#getValue is invoked and it obtains the class from that instance. Meanwhile in newer JSF versions it invokes MapELResolver#getType, and this returns always Object.class.