[jira] [Updated] (LANG-1820) ObjectUtils.anyNull(Object) returns false for empty array, which contradicts Javadoc which states true should be returned

2026-03-28 Thread Partha Paul (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1820?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Partha Paul updated LANG-1820:
--
Description: 
The Javadoc for {{ObjectUtils.anyNull(Object...)}} {{@param}} states that 
{{true}} should be returned when the array is null or empty. However, the 
current implementation delegates to {{{}!allNotNull(values){}}}, and 
{{allNotNull()}} returns {{true}} for empty arrays, causing {{anyNull()}} to 
return {{false}} for empty arrays. This directly contradicts its own documented 
contract.

The two methods have conflicting contracts for the empty array case currently:

{{allNotNull()}} Javadoc states: {{@returns true}} if all values in the array 
are not null or array contains no elements
{{anyNull()}} Javadoc states: {{@returns true}} if the array is null or empty

Since {{anyNull()}} is implemented as {{{}!allNotNull(){}}}, it cannot satisfy 
both contracts simultaneously for the empty array case.
h5. Implementation (Current)
{code:java}
public static boolean anyNull(final Object... values) {
return !allNotNull(values);
}
public static boolean allNotNull(final Object... values) {
return values != null && Stream.of(values).noneMatch(Objects::isNull);
}
{code}
h5. Steps to Reproduce
{code:java}
@Test
void testAnyNull_EmptyArray_ReturnsTrue() {
assertTrue(ObjectUtils.anyNull(), "anyNull should return true for an empty 
array per Javadoc");
assertTrue(ObjectUtils.anyNull(new Object[] {}), "anyNull should return 
true for an empty array per Javadoc");
}
{code}
Both assertions will fail because {{anyNull()}} returns {{false}} for empty 
arrays.
h5. Proposed Fixed

Update the documentation to reflect this case to something like
{code:java}
 @returns false if the array contains no elements {code}
Updated the documentation in this pr: 
[https://github.com/apache/commons-lang/pull/1621|https://github.com/apache/commons-lang/pull/1621]

  was:
The Javadoc for {{ObjectUtils.anyNull(Object...)}} {{@param}} states that 
{{true}} should be returned when the array is null or empty. However, the 
current implementation delegates to {{{}!allNotNull(values){}}}, and 
{{allNotNull()}} returns {{true}} for empty arrays, causing {{anyNull()}} to 
return {{false}} for empty arrays. This directly contradicts its own documented 
contract.

The two methods have conflicting contracts for the empty array case currently:

{{allNotNull()}} Javadoc states: {{@returns true}} if all values in the array 
are not null or array contains no elements
{{anyNull()}} Javadoc states: {{@returns true}} if the array is null or empty

Since {{anyNull()}} is implemented as {{{}!allNotNull(){}}}, it cannot satisfy 
both contracts simultaneously for the empty array case.
h5. Implementation (Current)
{code:java}
public static boolean anyNull(final Object... values) {
return !allNotNull(values);
}
public static boolean allNotNull(final Object... values) {
return values != null && Stream.of(values).noneMatch(Objects::isNull);
}
{code}
h5. Steps to Reproduce
{code:java}
@Test
void testAnyNull_EmptyArray_ReturnsTrue() {
assertTrue(ObjectUtils.anyNull(), "anyNull should return true for an empty 
array per Javadoc");
assertTrue(ObjectUtils.anyNull(new Object[] {}), "anyNull should return 
true for an empty array per Javadoc");
}
{code}
Both assertions will fail because {{anyNull()}} returns {{false}} for empty 
arrays.
h5. Proposed Fixed
Update the documentation to reflect this case to something like
{code:java} @returns false if the array contains no elements {code}
Happy to submit a PR by updating the documentation to reflect this case


> ObjectUtils.anyNull(Object) returns false for empty array, which contradicts 
> Javadoc which states true should be returned
> -
>
> Key: LANG-1820
> URL: https://issues.apache.org/jira/browse/LANG-1820
> Project: Commons Lang
>  Issue Type: Bug
>Affects Versions: 3.20.0
> Environment: Commons Lang version: (3.20.0 including the current 
> snapshot version)
> Java version: (javac 17.0.12)
>Reporter: Partha Paul
>Priority: Major
>  Labels: docuentation, documentation-update, implementation
>
> The Javadoc for {{ObjectUtils.anyNull(Object...)}} {{@param}} states that 
> {{true}} should be returned when the array is null or empty. However, the 
> current implementation delegates to {{{}!allNotNull(values){}}}, and 
> {{allNotNull()}} returns {{true}} for empty arrays, causing {{anyNull()}} to 
> return {{false}} for empty arrays. This directly contradicts its own 
> documented contract.
> The two methods have conflicting contracts for the empty array case currently:
> {{allNotNull()}} Javadoc states: {{@returns true}} if all values in the array 
> are not null or array contain

[jira] [Updated] (LANG-1820) ObjectUtils.anyNull(Object) returns false for empty array, which contradicts Javadoc which states true should be returned

2026-03-27 Thread Partha Paul (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1820?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Partha Paul updated LANG-1820:
--
Description: 
The Javadoc for {{ObjectUtils.anyNull(Object...)}} {{@param}} states that 
{{true}} should be returned when the array is null or empty. However, the 
current implementation delegates to {{{}!allNotNull(values){}}}, and 
{{allNotNull()}} returns {{true}} for empty arrays, causing {{anyNull()}} to 
return {{false}} for empty arrays. This directly contradicts its own documented 
contract.

The two methods have conflicting contracts for the empty array case currently:

{{allNotNull()}} Javadoc states: {{@returns true}} if all values in the array 
are not null or array contains no elements
{{anyNull()}} Javadoc states: {{@returns true}} if the array is null or empty

Since {{anyNull()}} is implemented as {{{}!allNotNull(){}}}, it cannot satisfy 
both contracts simultaneously for the empty array case.
h5. Implementation (Current)
{code:java}
public static boolean anyNull(final Object... values) {
return !allNotNull(values);
}
public static boolean allNotNull(final Object... values) {
return values != null && Stream.of(values).noneMatch(Objects::isNull);
}
{code}
h5. Steps to Reproduce
{code:java}
@Test
void testAnyNull_EmptyArray_ReturnsTrue() {
assertTrue(ObjectUtils.anyNull(), "anyNull should return true for an empty 
array per Javadoc");
assertTrue(ObjectUtils.anyNull(new Object[] {}), "anyNull should return 
true for an empty array per Javadoc");
}
{code}
Both assertions will fail because {{anyNull()}} returns {{false}} for empty 
arrays.
h5. Proposed Fixed
Update the documentation to reflect this case to something like
{code:java} @returns false if the array contains no elements {code}
Happy to submit a PR by updating the documentation to reflect this case

  was:
The Javadoc for {{ObjectUtils.anyNull(Object...)}} {{@param}} states that 
{{true}} should be returned when the array is null or empty. However, the 
current implementation delegates to {{{}!allNotNull(values){}}}, and 
{{allNotNull()}} returns {{true}} for empty arrays, causing {{anyNull()}} to 
return {{false}} for empty arrays. This directly contradicts its own documented 
contract.

The two methods have conflicting contracts for the empty array case currently:

{{allNotNull()}} Javadoc states: {{@returns true}} if all values in the array 
are not null or array contains no elements
{{anyNull()}} Javadoc states: {{@returns true}} if the array is null or empty

Since {{anyNull()}} is implemented as {{{}!allNotNull(){}}}, it cannot satisfy 
both contracts simultaneously for the empty array case.
h5. Implementation (Current)
{code:java}
public static boolean anyNull(final Object... values) {
return !allNotNull(values);
}
public static boolean allNotNull(final Object... values) {
return values != null && Stream.of(values).noneMatch(Objects::isNull);
}
{code}
h5. Steps to Reproduce
{code:java}
@Test
void testAnyNull_EmptyArray_ReturnsTrue() {
assertTrue(ObjectUtils.anyNull(), "anyNull should return true for an empty 
array per Javadoc");
assertTrue(ObjectUtils.anyNull(new Object[] {}), "anyNull should return 
true for an empty array per Javadoc");
}
{code}
Both assertions will fail because {{anyNull()}} returns {{false}} for empty 
arrays.

Happy to submit a PR by updating the documentation to reflect this case


> ObjectUtils.anyNull(Object) returns false for empty array, which contradicts 
> Javadoc which states true should be returned
> -
>
> Key: LANG-1820
> URL: https://issues.apache.org/jira/browse/LANG-1820
> Project: Commons Lang
>  Issue Type: Bug
>Affects Versions: 3.20.0
> Environment: Commons Lang version: (3.20.0 including the current 
> snapshot version)
> Java version: (javac 17.0.12)
>Reporter: Partha Paul
>Priority: Major
>  Labels: docuentation, documentation-update, implementation
>
> The Javadoc for {{ObjectUtils.anyNull(Object...)}} {{@param}} states that 
> {{true}} should be returned when the array is null or empty. However, the 
> current implementation delegates to {{{}!allNotNull(values){}}}, and 
> {{allNotNull()}} returns {{true}} for empty arrays, causing {{anyNull()}} to 
> return {{false}} for empty arrays. This directly contradicts its own 
> documented contract.
> The two methods have conflicting contracts for the empty array case currently:
> {{allNotNull()}} Javadoc states: {{@returns true}} if all values in the array 
> are not null or array contains no elements
> {{anyNull()}} Javadoc states: {{@returns true}} if the array is null or empty
> Since {{anyNull()}} is implemented as {{{}!allNotNull(){}}}, it cannot 
> satisfy both contracts simultaneously for the emp

[jira] [Updated] (LANG-1820) ObjectUtils.anyNull(Object) returns false for empty array, which contradicts Javadoc which states true should be returned

2026-03-27 Thread Partha Paul (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1820?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Partha Paul updated LANG-1820:
--
Description: 
The Javadoc for {{ObjectUtils.anyNull(Object...)}} {{@param}} states that 
{{true}} should be returned when the array is null or empty. However, the 
current implementation delegates to {{{}!allNotNull(values){}}}, and 
{{allNotNull()}} returns {{true}} for empty arrays, causing {{anyNull()}} to 
return {{false}} for empty arrays. This directly contradicts its own documented 
contract.

The two methods have conflicting contracts for the empty array case currently:

{{allNotNull()}} Javadoc states: {{@returns true}} if all values in the array 
are not null or array contains no elements
{{anyNull()}} Javadoc states: {{@returns true}} if the array is null or empty

Since {{anyNull()}} is implemented as {{{}!allNotNull(){}}}, it cannot satisfy 
both contracts simultaneously for the empty array case.
h5. Implementation (Current)
{code:java}
public static boolean anyNull(final Object... values) {
return !allNotNull(values);
}
public static boolean allNotNull(final Object... values) {
return values != null && Stream.of(values).noneMatch(Objects::isNull);
}
{code}
h5. Steps to Reproduce
{code:java}
@Test
void testAnyNull_EmptyArray_ReturnsTrue() {
assertTrue(ObjectUtils.anyNull(), "anyNull should return true for an empty 
array per Javadoc");
assertTrue(ObjectUtils.anyNull(new Object[] {}), "anyNull should return 
true for an empty array per Javadoc");
}
{code}
Both assertions will fail because {{anyNull()}} returns {{false}} for empty 
arrays.

Happy to submit a PR by updating the documentation to reflect this case

  was:
The Javadoc for {{ObjectUtils.anyNull(Object...)}} {{@param}} states that 
{{true}} should be returned when the array is null or empty. However, the 
current implementation delegates to {{{}!allNotNull(values){}}}, and 
{{allNotNull()}} returns {{true}} for empty arrays, causing {{anyNull()}} to 
return {{false}} for empty arrays. This directly contradicts its own documented 
contract.

The two methods have conflicting contracts for the empty array case currently:

{{allNotNull()}} Javadoc states: {{@returns true}} if all values in the array 
are not null or array contains no elements
{{anyNull()}} Javadoc states: {{@returns true}} if the array is null or empty

Since {{anyNull()}} is implemented as {{{}!allNotNull(){}}}, it cannot satisfy 
both contracts simultaneously for the empty array case.
h5. Implementation (Current)
{code:java}
public static boolean anyNull(final Object... values) {
return !allNotNull(values);
}
public static boolean allNotNull(final Object... values) {
return values != null && Stream.of(values).noneMatch(Objects::isNull);
}
{code}
h5. Steps to Reproduce
{code:java}
@Test
void testAnyNull_EmptyArray_ReturnsTrue() {
assertTrue(ObjectUtils.anyNull(), "anyNull should return true for an empty 
array per Javadoc");
assertTrue(ObjectUtils.anyNull(new Object[] {}), "anyNull should return 
true for an empty array per Javadoc");
}
{code}
Both assertions will fail because {{anyNull()}} returns {{false}} for empty 
arrays.

Happy to submit a PR by updating the documentation to relfect this case


> ObjectUtils.anyNull(Object) returns false for empty array, which contradicts 
> Javadoc which states true should be returned
> -
>
> Key: LANG-1820
> URL: https://issues.apache.org/jira/browse/LANG-1820
> Project: Commons Lang
>  Issue Type: Bug
>Affects Versions: 3.20.0
> Environment: Commons Lang version: (3.20.0 including the current 
> snapshot version)
> Java version: (javac 17.0.12)
>Reporter: Partha Paul
>Priority: Major
>  Labels: docuentation, documentation-update, implementation
>
> The Javadoc for {{ObjectUtils.anyNull(Object...)}} {{@param}} states that 
> {{true}} should be returned when the array is null or empty. However, the 
> current implementation delegates to {{{}!allNotNull(values){}}}, and 
> {{allNotNull()}} returns {{true}} for empty arrays, causing {{anyNull()}} to 
> return {{false}} for empty arrays. This directly contradicts its own 
> documented contract.
> The two methods have conflicting contracts for the empty array case currently:
> {{allNotNull()}} Javadoc states: {{@returns true}} if all values in the array 
> are not null or array contains no elements
> {{anyNull()}} Javadoc states: {{@returns true}} if the array is null or empty
> Since {{anyNull()}} is implemented as {{{}!allNotNull(){}}}, it cannot 
> satisfy both contracts simultaneously for the empty array case.
> h5. Implementation (Current)
> {code:java}
> public static boolean anyNull(final Object... values) {
> return !allNotNull(values)

[jira] [Updated] (LANG-1820) ObjectUtils.anyNull(Object) returns false for empty array, which contradicts Javadoc which states true should be returned

2026-03-27 Thread Partha Paul (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1820?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Partha Paul updated LANG-1820:
--
Description: 
The Javadoc for {{ObjectUtils.anyNull(Object...)}} {{@param}} states that 
{{true}} should be returned when the array is null or empty. However, the 
current implementation delegates to {{{}!allNotNull(values){}}}, and 
{{allNotNull()}} returns {{true}} for empty arrays, causing {{anyNull()}} to 
return {{false}} for empty arrays. This directly contradicts its own documented 
contract.

The two methods have conflicting contracts for the empty array case currently:

{{allNotNull()}} Javadoc states: {{@returns true}} if all values in the array 
are not null or array contains no elements
{{anyNull()}} Javadoc states: {{@returns true}} if the array is null or empty

Since {{anyNull()}} is implemented as {{{}!allNotNull(){}}}, it cannot satisfy 
both contracts simultaneously for the empty array case.
h5. Implementation (Current)
{code:java}
public static boolean anyNull(final Object... values) {
return !allNotNull(values);
}
public static boolean allNotNull(final Object... values) {
return values != null && Stream.of(values).noneMatch(Objects::isNull);
}
{code}
h5. Steps to Reproduce
{code:java}
@Test
void testAnyNull_EmptyArray_ReturnsTrue() {
assertTrue(ObjectUtils.anyNull(), "anyNull should return true for an empty 
array per Javadoc");
assertTrue(ObjectUtils.anyNull(new Object[] {}), "anyNull should return 
true for an empty array per Javadoc");
}
{code}
Both assertions will fail because {{anyNull()}} returns {{false}} for empty 
arrays.

Happy to submit a PR by updating the documentation to relfect this case

  was:
The Javadoc for {{ObjectUtils.anyNull(Object...)}} {{@param}} states that 
{{true}} should be returned when the array is null or empty. However, the 
current implementation delegates to {{{}!allNotNull(values){}}}, and 
{{allNotNull()}} returns {{true}} for empty arrays, causing {{anyNull()}} to 
return {{false}} for empty arrays. This directly contradicts its own documented 
contract.

The two methods have conflicting contracts for the empty array case currently:

{{allNotNull()}} Javadoc states: {{@returns true}} if all values in the array 
are not null or array contains no elements
{{anyNull()}} Javadoc states: {{@returns true}} if the array is null or empty

Since {{anyNull()}} is implemented as {{{}!allNotNull(){}}}, it cannot satisfy 
both contracts simultaneously for the empty array case.

h5. Implementation (Current)
{code:java}
public static boolean anyNull(final Object... values) {
return !allNotNull(values);
}
public static boolean allNotNull(final Object... values) {
return values != null && Stream.of(values).noneMatch(Objects::isNull);
}
{code}

h5. Steps to Reproduce
{code:java}
@Test
void testAnyNull_EmptyArray_ReturnsTrue() {
assertTrue(ObjectUtils.anyNull(), "anyNull should return true for an empty 
array per Javadoc");
assertTrue(ObjectUtils.anyNull(new Object[] {}), "anyNull should return 
true for an empty array per Javadoc");
}
{code}
Both assertions will fail because {{anyNull()}} returns {{false}} for empty 
arrays.


> ObjectUtils.anyNull(Object) returns false for empty array, which contradicts 
> Javadoc which states true should be returned
> -
>
> Key: LANG-1820
> URL: https://issues.apache.org/jira/browse/LANG-1820
> Project: Commons Lang
>  Issue Type: Bug
>Affects Versions: 3.20.0
> Environment: Commons Lang version: (3.20.0 including the current 
> snapshot version)
> Java version: (javac 17.0.12)
>Reporter: Partha Paul
>Priority: Major
>  Labels: docuentation, documentation-update, implementation
>
> The Javadoc for {{ObjectUtils.anyNull(Object...)}} {{@param}} states that 
> {{true}} should be returned when the array is null or empty. However, the 
> current implementation delegates to {{{}!allNotNull(values){}}}, and 
> {{allNotNull()}} returns {{true}} for empty arrays, causing {{anyNull()}} to 
> return {{false}} for empty arrays. This directly contradicts its own 
> documented contract.
> The two methods have conflicting contracts for the empty array case currently:
> {{allNotNull()}} Javadoc states: {{@returns true}} if all values in the array 
> are not null or array contains no elements
> {{anyNull()}} Javadoc states: {{@returns true}} if the array is null or empty
> Since {{anyNull()}} is implemented as {{{}!allNotNull(){}}}, it cannot 
> satisfy both contracts simultaneously for the empty array case.
> h5. Implementation (Current)
> {code:java}
> public static boolean anyNull(final Object... values) {
> return !allNotNull(values);
> }
> public static boolean allNotNull(final Object... values) {
>   

[jira] [Updated] (LANG-1820) ObjectUtils.anyNull(Object) returns false for empty array, which contradicts Javadoc which states true should be returned

2026-03-26 Thread Partha Paul (Jira)


 [ 
https://issues.apache.org/jira/browse/LANG-1820?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Partha Paul updated LANG-1820:
--
Description: 
The Javadoc for {{ObjectUtils.anyNull(Object...)}} {{@param}} states that 
{{true}} should be returned when the array is null or empty. However, the 
current implementation delegates to {{{}!allNotNull(values){}}}, and 
{{allNotNull()}} returns {{true}} for empty arrays, causing {{anyNull()}} to 
return {{false}} for empty arrays. This directly contradicts its own documented 
contract.

The two methods have conflicting contracts for the empty array case currently:

{{allNotNull()}} Javadoc states: {{@returns true}} if all values in the array 
are not null or array contains no elements
{{anyNull()}} Javadoc states: {{@returns true}} if the array is null or empty

Since {{anyNull()}} is implemented as {{{}!allNotNull(){}}}, it cannot satisfy 
both contracts simultaneously for the empty array case.

h5. Implementation (Current)
{code:java}
public static boolean anyNull(final Object... values) {
return !allNotNull(values);
}
public static boolean allNotNull(final Object... values) {
return values != null && Stream.of(values).noneMatch(Objects::isNull);
}
{code}

h5. Steps to Reproduce
{code:java}
@Test
void testAnyNull_EmptyArray_ReturnsTrue() {
assertTrue(ObjectUtils.anyNull(), "anyNull should return true for an empty 
array per Javadoc");
assertTrue(ObjectUtils.anyNull(new Object[] {}), "anyNull should return 
true for an empty array per Javadoc");
}
{code}
Both assertions will fail because {{anyNull()}} returns {{false}} for empty 
arrays.

  was:
The Javadoc for {{ObjectUtils.anyNull(Object...)}} {{@param}} states that 
{{true}} should be returned when the array is null or empty. However, the 
current implementation delegates to {{{}!allNotNull(values){}}}, and 
{{allNotNull()}} returns {{true}} for empty arrays, causing {{anyNull()}} to 
return {{false}} for empty arrays. This directly contradicts its own documented 
contract.

The two methods have conflicting contracts for the empty array case currently:

{{allNotNull()}} Javadoc states: {{@returns true}} if all values in the array 
are not null or array contains no elements
{{anyNull()}} Javadoc states: {{@returns true}} if the array is null or empty

Since {{anyNull()}} is implemented as {{{}!allNotNull(){}}}, it cannot satisfy 
both contracts simultaneously for the empty array case.

h5. Steps to Reproduce
{code:java}
@Test
void testAnyNull_EmptyArray_ReturnsTrue() {
assertTrue(ObjectUtils.anyNull(), "anyNull should return true for an empty 
array per Javadoc");
assertTrue(ObjectUtils.anyNull(new Object[] {}), "anyNull should return 
true for an empty array per Javadoc");
}
{code}
Both assertions will fail because {{anyNull()}} returns {{false}} for empty 
arrays.

Environment: 
Commons Lang version: (3.20.0 including the current snapshot version)
Java version: (javac 17.0.12)

> ObjectUtils.anyNull(Object) returns false for empty array, which contradicts 
> Javadoc which states true should be returned
> -
>
> Key: LANG-1820
> URL: https://issues.apache.org/jira/browse/LANG-1820
> Project: Commons Lang
>  Issue Type: Bug
>Affects Versions: 3.20.0
> Environment: Commons Lang version: (3.20.0 including the current 
> snapshot version)
> Java version: (javac 17.0.12)
>Reporter: Partha Paul
>Priority: Major
>  Labels: docuentation, documentation-update, implementation
>
> The Javadoc for {{ObjectUtils.anyNull(Object...)}} {{@param}} states that 
> {{true}} should be returned when the array is null or empty. However, the 
> current implementation delegates to {{{}!allNotNull(values){}}}, and 
> {{allNotNull()}} returns {{true}} for empty arrays, causing {{anyNull()}} to 
> return {{false}} for empty arrays. This directly contradicts its own 
> documented contract.
> The two methods have conflicting contracts for the empty array case currently:
> {{allNotNull()}} Javadoc states: {{@returns true}} if all values in the array 
> are not null or array contains no elements
> {{anyNull()}} Javadoc states: {{@returns true}} if the array is null or empty
> Since {{anyNull()}} is implemented as {{{}!allNotNull(){}}}, it cannot 
> satisfy both contracts simultaneously for the empty array case.
> h5. Implementation (Current)
> {code:java}
> public static boolean anyNull(final Object... values) {
> return !allNotNull(values);
> }
> public static boolean allNotNull(final Object... values) {
> return values != null && Stream.of(values).noneMatch(Objects::isNull);
> }
> {code}
> h5. Steps to Reproduce
> {code:java}
> @Test
> void testAnyNull_EmptyArray_ReturnsTrue() {
> assertTrue(ObjectUtils.anyNull(), "anyNull