Uploaded image for project: 'Commons Text'
  1. Commons Text
  2. TEXT-178

StringSubstitutor incorrectly removes some escape characters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.9
    • None

    Description

      The class StringSubstitutor incorrectly removes escape characters.

      Note that these tests pass:

          /**
           * Tests interpolation with weird boundary patterns.
           */
          @Test
          public void testReplaceWeirdPattens() throws IOException {
              doTestNoReplace(StringUtils.EMPTY);
              doTestNoReplace(EMPTY_EXPR);
              doTestNoReplace("${ }");
              doTestNoReplace("${\t}");
              doTestNoReplace("${\n}");
              doTestNoReplace("${\b}");
              doTestNoReplace("${");
              doTestNoReplace("$}");
              doTestNoReplace("$$}");
              doTestNoReplace("}");
              doTestNoReplace("${}$");
              doTestNoReplace("${}$$");
              doTestNoReplace("${${");
              doTestNoReplace("${${}}");
              doTestNoReplace("${$${}}");
              doTestNoReplace("${$$${}}");
              doTestNoReplace("${$$${$}}");
              doTestNoReplace("${${}}");
              doTestNoReplace("${${ }}");
          }
      

      But these tests fail:

          /**
           * Tests interpolation with weird boundary patterns.
           */
          @Test
          @Disabled
          public void testReplaceWeirdPattensJira() throws IOException {
               doTestNoReplace("$${");
               doTestNoReplace("$${a");
               doTestNoReplace("$$${");
               doTestNoReplace("$$${a");
          }
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ggregory Gary D. Gregory
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: