All, This is my first post for the Tomcat project, and I do hope it is the right place for this question, as it is involving a change in the development branch.
I have implemented my own EL based on the EL API. The EL API interface
provided in Tomcat I used up to v7.0.12 made all my test pass, and then
when I switched to v7.0.14, I have two errors returned when accessing an
Integer instance from a Map of properties.
Please see below the patch I have extracted between v7.0.12 and v7.0.14
explaining the issue I have seen and I would like to understand the
reason of returning an Object.class and not the class type of the value
stored ?
Thanks in advance for your help, and if this is not the right place I
should ask this question, just tell me and I will send it to the user
mailing list.
diff -uNrbB javax/el/ListELResolver.java
../../apache-tomcat-7.0.14-src/java/javax/el/ListELResolver.java
--- javax/el/ListELResolver.java 2011-04-01 17:16:46 +0000
+++ ../../apache-tomcat-7.0.14-src/java/javax/el/ListELResolver.java
2011-05-09 21:44:02 +0000
@@ -74,8 +74,7 @@
throw new PropertyNotFoundException(
new
ArrayIndexOutOfBoundsException(idx).getMessage());
}
- Object obj = list.get(idx);
- return (obj != null) ? obj.getClass() : null;
+ return Object.class;
}
return null;
diff -uNrbB javax/el/MapELResolver.java
../../apache-tomcat-7.0.14-src/java/javax/el/MapELResolver.java
--- javax/el/MapELResolver.java 2011-04-01 17:16:46 +0000
+++ ../../apache-tomcat-7.0.14-src/java/javax/el/MapELResolver.java
2011-05-09 21:44:02 +0000
@@ -64,8 +64,7 @@
if (base instanceof Map<?,?>) {
context.setPropertyResolved(true);
- Object obj = ((Map<?,?>) base).get(property);
- return (obj != null) ? obj.getClass() : null;
+ return Object.class;
}
return null;
Best regards,
--
Emmanuel Poitier- Chief Executive Officer (CEO)
Enman
Telephone:+33 (0)2 54 67 15 38
Mobile:+33 (0)64 9461 586
Email:[email protected]
Web site:http://enman.fr
<<attachment: emmanuel_poitier.vcf>>
smime.p7s
Description: Signature cryptographique S/MIME
