Description
The following test fails with Commons Lang 3.11 and 3.17.0:
assertThrows( IllegalStateException.class, () -> StringUtils.replaceEachRepeatedly("%{key1}", new String[] {"%{key1}", "%{key2}", "%{key3}"}, new String[] {"Key1 %{key2}", "Key2 %{key3}", "Key3 %{key1}"}), "Should be a circular reference");
While it throws the expected IllegalStateException with 3.10.
This commit seems to be related: https://github.com/apache/commons-lang/commit/d62d4e21ef20ee01e65cbf5257e04d6b572aa73b
These also produce weird results with 3.11 and 3.17.0:
// fails, returns "bllaan" instead of "blaan" // similar to the already existing test in StringUtilsTest assertEquals("blaan", StringUtils.replaceEachRepeatedly("bllllaan", new String[]{"llaan"}, new String[]{"laan"}));
// fails, returns "aab" instead of "ab" assertEquals("ab", StringUtils.replaceEachRepeatedly("aaaab", new String[] {"aab"}, new String[] {"ab"}));
Attachments
Issue Links
- links to