Uploaded image for project: 'Maven Shared Components'
  1. Maven Shared Components
  2. MSHARED-282

StringIndexOutOfBoundsException in m-s-u XMLEncode if carriage-return is the last character

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      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)
      

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            agudian Andreas Gudian
            agudian Andreas Gudian
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment