Skip to content

Commit 20a1bb7

Browse files
We are getting 3,713 occurrences of below message when we run below command (#1321)
./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.
1 parent ba1c2c1 commit 20a1bb7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

framework/service/src/main/java/org/apache/ofbiz/service/eca/ServiceEcaCondition.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,9 @@ public boolean eval(String serviceName, DispatchContext dctx, Map<String, Object
202202
Debug.logWarning(message.toString(), MODULE);
203203
}
204204
}
205-
if (!cond) {
205+
if (cond == null) {
206206
Debug.logWarning("doRealCompare returned null, returning false", MODULE);
207+
return false;
207208
}
208209
return cond;
209210
}

0 commit comments

Comments
 (0)