commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benedikt Ritter (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-922) Add isOneTrue(booleans...) to BooleanUtils to preserve old behavior of BooleanUtils.xor(booleans...)
Date Wed, 16 Oct 2013 16:55:43 GMT

    [ https://issues.apache.org/jira/browse/LANG-922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13796973#comment-13796973
] 

Benedikt Ritter commented on LANG-922:
--------------------------------------

I think for booleans there are special cases like isOneTrue, isAnyTrue, isOneFalse, isAnyFalse.
We could implement the suggested method in ArrayUtils but that would require us to do this
for all primitives and for the gerenic type T. IMHO we should definitely implement the old
behavior. Don't know when I'll find the time to do this :-) Maybe I can have a look on friday.

Regarding the name: isOneTrue is clear if you also have isAnyTrue, WDYT?

> Add isOneTrue(booleans...) to BooleanUtils to preserve old behavior of BooleanUtils.xor(booleans...)
> ----------------------------------------------------------------------------------------------------
>
>                 Key: LANG-922
>                 URL: https://issues.apache.org/jira/browse/LANG-922
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>            Reporter: Benedikt Ritter
>            Assignee: Benedikt Ritter
>             Fix For: 3.2
>
>
> The old implementation (prior to r1532476) of BooleanUtils.xor(boolean...) checked if
the provided array contained exactly one boolean with value true. This was changed because
it is not the correct behavior for an XOR operation. To preserve the behavior we should add
BooleanUtils.isOneTrue(boolean...) and BooleanUtils.isOneTrue(Boolean...) (and possibly the
equivalents for isOneFalse).



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message