[ https://issues.apache.org/jira/browse/GROOVY-6450?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles updated GROOVY-6450: -------------------------------- Fix Version/s: (was: 4.x) > String.minus(String) and String.minus(Pattern) are inconsistent with > List.minus(Collection). > -------------------------------------------------------------------------------------------- > > Key: GROOVY-6450 > URL: https://issues.apache.org/jira/browse/GROOVY-6450 > Project: Groovy > Issue Type: Bug > Components: groovy-jdk > Affects Versions: 1.8.9, 2.0.8, 2.1.9, 2.2.0 > Environment: Any > Reporter: James P. White > Priority: Major > Attachments: TestGROOVY_6450.groovy > > > The String.minus operations only remove the first occurrence of the equal > elements while List.minus removes all occurrences. This is terribly > inconsistent, as shown in these examples: > {code} > $ groovy -e "println ('abcabcabc' - 'b')" > acabcabc > $ groovy -e "println ((('abcabcabc' as List) - ('b' as List)).join())" > acacac > {code} > Given my experience with trying work with multisets, I think I prefer the > remove first/only one semantics. Given String.minus' troubled history it is > probably less disruptive to change it yet again. -- This message was sent by Atlassian Jira (v8.20.10#820010)