Bug 55642 - TagPluginManager isConstantAttribute broken
Summary: TagPluginManager isConstantAttribute broken
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Jasper (show other bugs)
Version: 7.0.42
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-09 13:02 UTC by Pavel Cibulka
Modified: 2013-10-09 14:39 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Cibulka 2013-10-09 13:02:21 UTC
Function isConstantAttribute in TagPluginManager seems to be be broken.
For value "order.status" it returns false. And for value "${order.state.name}" it returns true. According to javadoc it should be exact opposite.

Problem seems to be in Node.isLiteral function. "el!= null" should probably be "el== null" But this function is being used elsewhere.


/**
* @return true if the attribute is specified and its value is a
*         translation-time constant.
*/
public boolean TagPluginManager.isConstantAttribute(String attribute){
    Node.JspAttribute attr = getNodeAttribute(attribute);
    if (attr == null)
        return false;
    return attr.isLiteral();
}
/**
* @return true if the value is a string literal known at translation
*         time.
*/
public boolean isLiteral() {
    return !expression && (el != null) && !namedAttribute;
}
Comment 1 Mark Thomas 2013-10-09 14:39:32 UTC
The function is being used elsewhere but it is returning the wrong value there too.

I have fixed this in 8.0.x for 8.0.0-RC4 and 7.0.x for 7.0.46.