]
Nick Belaevski updated RF-4498:
-------------------------------
Fix Version/s: 3.3.0
Assignee: Nick Belaevski
Priority: Critical (was: Major)
EndlessLoop in CssCompressor
----------------------------
Key: RF-4498
URL:
https://jira.jboss.org/jira/browse/RF-4498
Project: RichFaces
Issue Type: Bug
Affects Versions: 3.2.2
Environment: Browser independent
Reporter: andreas_back
Assignee: Nick Belaevski
Priority: Critical
Fix For: 3.3.0
When starting our application under RF 3.2.2 GA Tomcat consumes (on a
Quad-Core-Processor) 25 % of the overall CPU performance, if the first page of the
application is requested.
After adding
set CATALINA_OPTS="-Dcom.sun.management.jmxremote"
to the startup.bat and starting jconsole it was found the time is consumed in line 41 of
CssCompressor.java,
see the code fragment.
sb = new StringBuffer(srcsb.toString());
while ((startIndex = sb.indexOf("/*")) >= 0) {
endIndex = sb.indexOf("*/", startIndex + 2);
if (endIndex >= startIndex + 2)
sb.delete(startIndex, endIndex + 2);
}
A simple code analysis shows that the code starts an endless loop for example for
the string
/*/
If the parameter org.ajax4jsf.COMPRESS_STYLE is set to false
then the endless loop disappears.
It could be noted that the single string in the CssCompressorTest class
does not contain the comment /* or */.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: