Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1528

replaceEachRepeatedly gives IllegalStateException

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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.8, 3.9, 3.8.1
    • Fix Version/s: 3.11
    • Component/s: lang.*
    • Labels:

      Description

       

      ChurchilllaanTest1 fails, ChurchilllaanTest2 doesn't, why?
      Please allow the ttl to be overridden.

          @Test
          public void ChurchilllaanTest1() {
              String input = "Churchilllaan";
              String[][] replaceMap = new String[][] {
                      { "llaan", "laan" },
              };
              
              String output = StringUtils.replaceEachRepeatedly(
                                               input, 
                                               getColumn(0, replaceMap),
                                               getColumn(1, replaceMap)); 
              Assert.assertEquals("Churchilaan", output);
          }
      
      @Test
          public void ChurchilllaanTest2() {
              String input = "Churchilllaan";
              String[][] replaceMap = new String[][] {
                      { "llaan", "laan" },
                      { "C", "c" },
              };
              
              String output = StringUtils.replaceEachRepeatedly(
                                               input, 
                                               getColumn(0, replaceMap),
                                               getColumn(1, replaceMap)); 
              Assert.assertEquals("churchilaan", output);
          }
      
        private String[] getColumn(int colIndex, String[][] from) {
              return Arrays.stream(from).map(x -> x[colIndex]).toArray(String[]::new);
          }
      
      

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              yolofy jimmy

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 40m
                40m

                  Issue deployment