ExpressionEvaluatorHandler has BeanInfo, which does not use the correct set of methods
--------------------------------------------------------------------------------------
Key: JBPM-767
URL:
http://jira.jboss.com/jira/browse/JBPM-767
Project: JBoss jBPM
Issue Type: Bug
Components: Core Engine
Affects Versions: jBPM 3.1.4
Reporter: Kannan Ekanath
Assigned To: Tom Baeyens
ExpressionEvaluatorHandler doesnt work in the expected way for subclasses. To quote an
example consider,
public void testSome() {
JbpmExpressionEvaluator e = new JbpmExpressionEvaluator();
final Book book = new Book();
book.setUseful(false);
VariableResolver variableResolver = new VariableResolver() {
public Object resolveVariable(String pName) throws ELException {
return book;
}
};
e.setVariableResolver(variableResolver);
System.out.println(e.evaluate("#{book.isUseful}", new
ExecutionContext(new Token())));
}
Carefully note that useful is an attribute, isUseful is the bean getter. The above code
works fine. However, if you have any subclass of a book, say for example, replace the
line,
final Book book = new Book();
final Book book = new MySubclassOfBook();
Now the same code gives the error, Caused by: org.jbpm.jpdl.el.ELException: Unable to find
a value for "isUseful" in object of class "MySubclassOfBook" using
operator "." This is because, in bean introspection
BeanInfoManager.java --> method initialize(Logger logger)
void initialize(Logger pLogger) throws ELException {
...
Method[] methods = mBeanClass.getDeclaredMethods();
for (int i=0; i<methods.length; i++) {
Method method = methods[i];
}
It is using the *getDeclaredMethods()* API and not *getMethods()*. The getdeclaredmethods
api gives apis declared only by that class and not inherited ones.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira