Project: Tomcat
Bug 53421 BeanELResolver's inner class BeanProperty throws incorrect message while PropertyNotFound
Reported: 2012-06-15 13:54:17 | Status: resolved fixed

BeanELResolver's inner class BeanProperty(line: 264) has two methods (write, read) that will throw PropertyNotFoundException. And there current implementation are wrong: throw new PropertyNotFoundException(message(ctx, "propertyNotWritable", new Object[] { type.getName(), descriptor.getName() })); it should use owner.getName() instead of type.getName() because the assembled message will be: Property '[descriptor.getName()]' not readable on type [type.getName()] Here the descriptor.getName() means the property name, type.getName() means the property type's name and the owner.getName() means the property owner - bean's type name. Of course we developer would prefer to receive a message that tells us which bean type doesn't contain such property because this is a PropertyNotFoundException.

Files changed in fix:
java/javax/el/BeanELResolver.java test/javax/el/TestBeanELResolver.java