Hi!

This is a comment on the following commits:

URL: http://svn.apache.org/r1633806
Log:
When coercing an object to a given type, only attempt coercion to an
array if both the object type and the target type are an array type.

URL: http://svn.apache.org/r1607906
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56652
Add support for method parameters that use arrays and varargs to
ELProcessor.defineFunction()


Issues:

1) General issue:
In r1607906 there was added a conversion support for arrays into
ELSupport.coerceToType() and r1633806 fixed a bug in it.

My understanding is that the method ELSupport.coerceToType()
implements conversion rules from EL specification chapter "Type
Conversion" (ch.1.23 in EL 3.0).

My concern is that EL specification does not specify such conversion
for array elements.

As such, the varargs support fix needs a different implementation that
does not change the ELSupport.coerceToType() method.


2) Technical issue:
The ELSupport.coerceToArray() method does not support arrays of
primitives.  It class-casts its argument "(Object[]) obj",  but that
will fail for arrays of primitives.  The correct way is to use the
following method to access array elements:
java.lang.reflect.Array.get(Object, int): Object


3) Bikeshed:
Maybe mention BZ 56425#c6 in changelog for r1607906.


I noted another unrelated difference vs specification in
coerceToType() method - filed BZ 57148.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to