[
https://issues.apache.org/jira/browse/WW-3578?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Lukasz Lenart closed WW-3578.
-----------------------------
Fix Version/s: (was: 6.1.0)
Resolution: Won't Fix
The Embedded JSP plugin is deprecated and will be removed with the next major
release
> replace function is called multiple times, which can be done in one run
> -----------------------------------------------------------------------
>
> Key: WW-3578
> URL: https://issues.apache.org/jira/browse/WW-3578
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - JasperReports
> Affects Versions: 2.2.1.1
> Reporter: Xiaoming Shi
> Priority: Major
>
> In the function "makeXmlJavaIdentifier"
> (./struts-2.2.1/src/plugins/embeddedjsp/src/main/java/org/apache/struts2/jasper/compiler/JspUtil.java
> line: 1059)
> The replace function is called 3 times, which can be done in one run with a
> for loop.
> StringBuilder sb = new StringBuilder(name.length());
> for(int i = 0; i < name.length(); i++)
> {
> char c = name.charAt(i);
> if (c == '-')
> sb.append("$1");
> else if (c == '.')
> sb.append("$2");
> else if (c == ':')
> sb.append("$3");
> else
> sb.append(c);
> }
> return sb.toString();
> The second method can be much faster.
> (Similar to the MySQL bug http://bugs.mysql.com/bug.php?id=45699)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)