You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2003/11/18 23:05:12 UTC

DO NOT REPLY [Bug 24799] New: - junitreport stylesheet causes StackOverflow with big replacements

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24799>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24799

junitreport stylesheet causes StackOverflow with big replacements

           Summary: junitreport stylesheet causes StackOverflow with big
                    replacements
           Product: Ant
           Version: 1.5.1
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Optional Tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: groboclown@users.sourceforge.net


I have several unit tests that set enormous java.class.path environment
variables.  On Windows machines, the XSL stylesheets for junitreport run this block:

        <xsl:when test="contains($string,'\')">
            <xsl:value-of
select="substring-before($string,'\')"/>\\<xsl:call-template name="JS-escape">
                <xsl:with-param name="string"
select="substring-after($string,'\')"/>
            </xsl:call-template>
        </xsl:when>

This causes a very deep recursion, which even a -Xss12m can't handle.

My current work-around for the JS-escape template replaces the above condition with:

        <xsl:when test="contains($string,'\')">
            <xsl:choose>
                <xsl:when test="string-length($string) &gt; 100">
                    <xsl:call-template name="JS-escape">
                        <xsl:with-param name="string"
select="translate($string,'\','/')"/>
                    </xsl:call-template>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of
select="substring-before($string,'\')"/>\\<xsl:call-template name="JS-escape">
                        <xsl:with-param name="string"
select="substring-after($string,'\')"/>
                    </xsl:call-template>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:when>

Which, though isn't a perfect translation, works.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org