You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by GitBox <gi...@apache.org> on 2026/09/30 09:02:14 UTC

[GH] (ofbiz-framework/ofbiz-13504-todatestring-visibility-r2409): Workflow run "Dependency Review" failed!

The GitHub Actions job "Dependency Review" on ofbiz-framework.git/ofbiz-13504-todatestring-visibility-r2409 has failed.
Run started by GitHub user toaditi (triggered by toaditi).

Head commit for run:
9caf6599a436221986a3758bd19dae3024418d97 / toaditi <ad...@hotwax.co>
Fixed: Call to non-existing method in production run PDF reports (OFBIZ-13504)

Jira: https://issues.apache.org/jira/browse/OFBIZ-13504

Backport of the trunk fix to release24.09.

Thanks to Carsten Heinrigs for reporting this, and for naming both the template
and the method in the report. This also follows on from OFBIZ-10478 by Jacques
Le Roux and Pradhan Yash Sharma, reviewed by Michael Brohl. That was a broad and
worthwhile cleanup; this one method simply happened to have all of its callers in
templates, where static analysis could not see them.

### The problem

`UtilDateTime.toDateString(Date, String)` is reached from templates through
`Static["org.apache.ofbiz.base.util.UtilDateTime"]`. FreeMarker resolves those
members reflectively and so sees public methods only, so narrowing the two
argument overload to private left the templates unable to resolve it:

    Java method "static org.apache.ofbiz.base.util.UtilDateTime.toDateString(Date)"
    takes 1 argument, but 2 was given.

The render does not throw. That message is written into the output stream, so an
`.fo.ftl` still returns a structurally valid PDF with a FreeMarker stack trace
printed where the dates belong, and the HTTP response still looks healthy.

release24.09 carries the same modifier and the same seven call sites as trunk:
`ProductionRun.fo.ftl` (four), `PRunsProductsAndOrder.fo.ftl:324`,
`PRunsProductsStacks.fo.ftl:92` and `ContentTreeLookupList.ftl:85`.

Restoring the two argument overload to public keeps the rendered format
unchanged. Dropping the format string in the templates instead would fall back to
the single argument overload and silently move the reports from dd/MM/yyyy to
MM/dd/yyyy.

### Note on the build.gradle line

The `test` task here lists the JUnit classes it runs explicitly, and
`FreeMarkerWorkerTests` was not among them, so the existing test in that class was
never executed. Without the added `include` the new regression test would sit in
the tree without ever running. It is listed separately in this commit so that it
is easy to drop if reviewers would rather keep the task list unchanged.

### Verification

The test is written for JUnit 4 to match this branch, rather than the Jupiter
version used on trunk. It renders the failing expression through
`FreeMarkerWorker` and asserts `09/03/2026`, a date whose dd/MM/yyyy and
MM/dd/yyyy forms differ, so it also fails if the format string is dropped rather
than the method restored.

Watched failing before the change and passing after, on this branch, against the
FreeMarker 2.3.35 it now pins. `./gradlew test checkstyleMain javadoc` passes with
25 tests, 0 failures, 0 errors.

The equivalent trunk change is in https://github.com/apache/ofbiz-framework/pull/1827,
where it was additionally verified by rendering a production run PDF over HTTP
before and after.

Report URL: https://github.com/apache/ofbiz-framework/actions/runs/33375264804

With regards,
GitHub Actions via GitBox