Project: Tomcat
Bug 55642 TagPluginManager isConstantAttribute broken
Reported: 2013-10-09 13:02:21 | Status: resolved fixed

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; }

Files changed in fix:
java/org/apache/jasper/compiler/Node.java test/org/apache/jasper/compiler/TestNode.java