Skip to content

LANG-1386#1592

Draft
ester-bloch wants to merge 1 commit intoapache:masterfrom
ester-bloch:LANG-1386-Ambiguous-method-call
Draft

LANG-1386#1592
ester-bloch wants to merge 1 commit intoapache:masterfrom
ester-bloch:LANG-1386-Ambiguous-method-call

Conversation

@ester-bloch
Copy link

Ambiguous method call error when using BooleanUtils.and

Ambiguous method call error when using BooleanUtils.and
@garydgregory
Copy link
Member

Hello @ester-bloch

-1 as this PR stands: It breaks the build and does not wholly resolve LANG-1386.

You must run mvn locally by itself before you push to a PR, as described in the PR template.

The following methods are in play:

  • BooleanUtils.and(boolean...)
  • BooleanUtils.and(Boolean...)
  • BooleanUtils.oneHot(boolean...)
  • BooleanUtils.oneHot(Boolean...)
  • BooleanUtils.or(boolean...)
  • BooleanUtils.or(Boolean...)
  • BooleanUtils.xor(boolean...)
  • BooleanUtils.xor(Boolean...)

The main question IMO is: Should we:

  • Do nothing, or
  • Change the primitive... vararg parameter to [], or
  • Change the Object... vararg parameter arg to []

?

  • Changing the primitive... arg to [] means both new tests compile to the Object API.
  • Changing the Object... arg to [] means both new tests compile to the primitive API.

Whatever is changed, if anything is changed, needs to be consistent and documented.

Obviously, we cannot break binary compatibility.

*/
public static boolean and(final boolean... array) {

public static boolean and(boolean[] array) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep this as final.
We will not be allowed to modify the reference and work with another array by mistake.
Otherwise we will be busy debugging why our changes are not persisted/reflected after the method call.

@garydgregory garydgregory marked this pull request as draft March 17, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants