Skip to content

We are getting 3,713 occurrences of below message when we run below command#1321

Merged
ashishvijaywargiya merged 1 commit into
apache:trunkfrom
ashishvijaywargiya:doRealCompare-returned-null
Jun 2, 2026
Merged

We are getting 3,713 occurrences of below message when we run below command#1321
ashishvijaywargiya merged 1 commit into
apache:trunkfrom
ashishvijaywargiya:doRealCompare-returned-null

Conversation

@ashishvijaywargiya

Copy link
Copy Markdown
Contributor

./gradlew testIntegration

2026-06-02 23:43:46,054 |main |ServiceEcaCondition |W| doRealCompare returned null, returning false
2026-06-02 23:43:46,054 |main |ServiceEcaCondition |W| doRealCompare returned null, returning false
2026-06-02 23:43:46,054 |main |ServiceEcaCondition |W| doRealCompare returned null, returning false

Here's a quick summary of the change at ServiceEcaCondition.java:205:

Before:
if (!cond) { // fires every time comparison returns false — ~3,713 warnings
Debug.logWarning("doRealCompare returned null, returning false", MODULE);
}
return cond;

After:
if (cond == null) { // fires only if doRealCompare returns null (never, currently)
Debug.logWarning("doRealCompare returned null, returning false", MODULE);
return false;
}
return cond;

!cond (unboxed Boolean inversion) was being evaluated as "is false?", causing the warning to log on every normal false result from an ECA
condition check. The intent was cond == null — guarding against an unexpected null return. The added return false inside the guard also
prevents a future NullPointerException if doRealCompare ever returns null and the caller tries to unbox it.

…ew testIntegration.

2026-06-02 23:43:46,054 |main                 |ServiceEcaCondition           |W| doRealCompare returned null, returning false
2026-06-02 23:43:46,054 |main                 |ServiceEcaCondition           |W| doRealCompare returned null, returning false
2026-06-02 23:43:46,054 |main                 |ServiceEcaCondition           |W| doRealCompare returned null, returning false

Here's a quick summary of the change at ServiceEcaCondition.java:205:

  Before:
  if (!cond) {   // fires every time comparison returns false — ~3,713 warnings
      Debug.logWarning("doRealCompare returned null, returning false", MODULE);
  }
  return cond;

  After:
  if (cond == null) {   // fires only if doRealCompare returns null (never, currently)
      Debug.logWarning("doRealCompare returned null, returning false", MODULE);
      return false;
  }
  return cond;

  !cond (unboxed Boolean inversion) was being evaluated as "is false?", causing the warning to log on every normal false result from an ECA
  condition check. The intent was cond == null — guarding against an unexpected null return. The added return false inside the guard also
  prevents a future NullPointerException if doRealCompare ever returns null and the caller tries to unbox it.
@ashishvijaywargiya ashishvijaywargiya merged commit 20a1bb7 into apache:trunk Jun 2, 2026
5 checks passed
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.

1 participant