[richfaces-issues] [JBoss JIRA] Created: (RF-4498) EndlessLoop in CssCompressor

andreas_back (JIRA) jira-events at lists.jboss.org
Thu Sep 18 12:36:20 EDT 2008


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


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: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the richfaces-issues mailing list