Skip to content

[MSHARED-282] StringIndexOutOfBoundsException in m-s-u XMLEncode if carriage-return is the last character #217

Description

@jira-importer

Andreas Gudian opened MSHARED-282 and commented

Reported with SUREFIRE-981

When adding an attribute that ends with '\r', we get the following exception:

Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 38
        at java.lang.String.charAt(String.java:686)
        at org.apache.maven.surefire.shade.org.apache.maven.shared.utils.xml.XMLEncode.xmlEncodeTextAsPCDATA(XMLEncode.java:166)
        at org.apache.maven.surefire.shade.org.apache.maven.shared.utils.xml.XMLEncode.xmlEncodeTextForAttribute(XMLEncode.java:59)
        at org.apache.maven.surefire.shade.org.apache.maven.shared.utils.xml.PrettyPrintXMLWriter.addAttribute(PrettyPrintXMLWriter.java:159)

Affects: maven-shared-utils-0.3

Issue Links:

  • SUREFIRE-981 Surefire hangs if forked test name ends with carriage return
    ("is depended upon by")

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority:majorMajor loss of function

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions