Hello Loic, 2015-11-05 11:55 GMT+01:00 Loic Guibert <lguib...@apache.org>:
> Hello, > there are 2 tickets on JIRA on this same new feature: > Add StringUtils methods to compare a string to multiple strings > (equalsAny, equalsAnyIgnoreCase) > > https://issues.apache.org/jira/browse/LANG-704 > https://issues.apache.org/jira/browse/LANG-1169 > > I review the 2 proposed implementation and I think we should keep > the last one (LANG-1169 / GitHub PR #109). > > In the patch submitted for LANG-704, I disagree with these results, > it sounds illogical for me : > StringUtils.equalsAnyOf(null, null, null) = false > StringUtils.equalsAnyOf(null, (CharSequence[]) null) = true > > For the LANG-1169 / GitHub PR #109, all seems good for me > I would just add some tests (I tested them, they are OK) : > assertFalse(StringUtils.equalsAny(null, (CharSequence[]) null)); > assertTrue(StringUtils.equalsAny(FOO, new CustomCharSequence("foo"))); > assertTrue(StringUtils.equalsAny(FOO, new StringBuilder("foo"))); > assertFalse(StringUtils.equalsAny(FOO, new CustomCharSequence("fOo"))); > assertFalse(StringUtils.equalsAny(FOO, new StringBuilder("fOo"))); > > assertFalse(StringUtils.equalsAnyIgnoreCase(null, (CharSequence[]) > null)); > assertTrue(StringUtils.equalsAnyIgnoreCase(FOO, new > CustomCharSequence("fOo"))); > assertTrue(StringUtils.equalsAnyIgnoreCase(FOO, new > StringBuilder("fOo"))); > > > If nobody objects or disagree with it, I'll : > - close LANG-704 (duplicate LANG-1169) > - merge PR #109 > - add the supplementary tests > - mark LANG-1169 resolved > This sounds reasonable to me. Even if we don't use the proposal from LANG-704, we should give the author credit for his contribution. For example the commit log could contain something like "Thanks to Author1 for providing a patch. Thanks to Author2 for providing an alternative implementaion, see LANG-704." Regards, Benedikt > > > Regards, > > -- > Loic Guibert > PGP : 0x65EB4F33 > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > > -- http://people.apache.org/~britter/ http://www.systemoutprintln.de/ http://twitter.com/BenediktRitter http://github.com/britter