Skip to content

README: fix API drift in resource-locator and function-registration examples#1331

Open
ZayanKhan-12 wants to merge 4 commits into
HubSpot:masterfrom
ZayanKhan-12:fix/readme-api-drift
Open

README: fix API drift in resource-locator and function-registration examples#1331
ZayanKhan-12 wants to merge 4 commits into
HubSpot:masterfrom
ZayanKhan-12:fix/readme-api-drift

Conversation

@ZayanKhan-12

@ZayanKhan-12 ZayanKhan-12 commented Jul 26, 2026

Copy link
Copy Markdown

Four fixes to README examples that don't match the current API, one commit each:

  1. ResourceLoaderResourceLocator — no ResourceLoader type exists in jinjava; the interface to implement is com.hubspot.jinjava.loader.ResourceLocator (the rest of the section already uses the correct name).
  2. FileResourceLocatorFileLocator — the file-system locator class is com.hubspot.jinjava.loader.FileLocator; FileResourceLocator doesn't exist anywhere in the tree.
  3. Non-compiling multi-locator exampleJinjava.setResourceLocator(ResourceLocator) takes a single argument (Jinjava.java), but the example passed two. Now wraps them in CascadingResourceLocator (varargs constructor), which is exactly what the surrounding text describes.
  4. Unbalanced parentheses in the registerFunction(new ELFunctionDefinition(...) example — two opening parens, one close.

Verification: every class/method name checked against src/main/java; full mvn test suite run locally on macOS arm64 with the JDK 21 toolchain: 2201 tests, 0 failures, 0 errors (23 skipped), BUILD SUCCESS.

Prepared with AI assistance (Claude); all claims verified against the source as described.

zk-khan and others added 4 commits July 26, 2026 19:45
There is no ResourceLoader type in jinjava; the interface to implement
is com.hubspot.jinjava.loader.ResourceLocator (as the rest of the
section already says).

Co-Authored-By: Claude Fable 5 <[email protected]>
The file-system locator class is
com.hubspot.jinjava.loader.FileLocator; no FileResourceLocator exists.

Co-Authored-By: Claude Fable 5 <[email protected]>
Jinjava.setResourceLocator takes a single ResourceLocator; the example
passed two. Wrap them in CascadingResourceLocator (varargs constructor),
which is what the surrounding text describes, and use the real
FileLocator class name.

Co-Authored-By: Claude Fable 5 <[email protected]>
The call opens two parens (registerFunction( and new
ELFunctionDefinition() but closed only one.

Co-Authored-By: Claude Fable 5 <[email protected]>
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.

2 participants