You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2020/06/13 15:34:00 UTC
[jira] [Resolved] (LANG-1528) replaceEachRepeatedly gives
IllegalStateException
[ https://issues.apache.org/jira/browse/LANG-1528?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gary D. Gregory resolved LANG-1528.
-----------------------------------
Fix Version/s: 3.11
Resolution: Fixed
> replaceEachRepeatedly gives IllegalStateException
> -------------------------------------------------
>
> Key: LANG-1528
> URL: https://issues.apache.org/jira/browse/LANG-1528
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.*
> Affects Versions: 3.8, 3.9, 3.8.1
> Reporter: jimmy
> Priority: Minor
> Labels: easyfix
> Fix For: 3.11
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
>
> ChurchilllaanTest1 fails, ChurchilllaanTest2 doesn't, why?
> Please allow the ttl to be overridden.
> {code:java}
> @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);
> }
> {code}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)