You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Tomáš Mrázek (JIRA)" <ji...@apache.org> on 2019/06/21 22:49:00 UTC

[jira] [Commented] (LANG-1386) Ambiguous method call error when using BooleanUtils.and

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

Tomáš Mrázek commented on LANG-1386:
------------------------------------

SO answer does provide easy workaround, but that's no longer true for Java 9 and higher, where Boolean constructor is deprecated. Static alternative Boolean.valueOf() does raise ambiguous errors. We can use deprecated object constructor or primitive constructor. Either way there is no need for keeping both method calls. Autoboxing was introduced in Java 1.5, so removing primitive or object method call for and / xor / or operations would break backwards compatibility for Java 1.4 and lower.

> Ambiguous method call error when using BooleanUtils.and
> -------------------------------------------------------
>
>                 Key: LANG-1386
>                 URL: https://issues.apache.org/jira/browse/LANG-1386
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>    Affects Versions: 3.4
>            Reporter: Kapil Koju
>            Priority: Minor
>         Attachments: BooleanUtils.and javadoc.png, Wrapper Boolean and.png, literal boolean and.png, possible use case.png
>
>
> When using `BooleanUtils.and` as per described in the method's javadoc, ambiguous method call error is thrown. I'm using version 3.4 with Java 8.
> Here's a StackOverflow question related to this issue. [https://stackoverflow.com/q/49252638/1433665]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)