Adapt to Rhino 1.9 TypeInfo API #171

Open
tobi wants to merge 5 commits from adapt-to-rhino-1-9-typeinfo-api into main
Owner

Rhino 1.9 replaced Class<?> with TypeInfo in the NativeJavaObject constructors and the staticType field, so the build fails with Renovate’s bump to 1.9.2 (#169). This branch contains that bump commit plus the fix; merging it supersedes #169.

Changes

  • Create TypeInfo values via TypeInfoFactory.GLOBAL.create(…) in JavaObject, GlobalObject and RhinoCore.
  • Override WrapFactory.wrap(…, TypeInfo) in RhinoCore.WrapMaker instead of the Class variant. Rhino 1.9 calls the TypeInfo overload directly and the Class overload merely forwards to it, so the old override still compiled but would have been bypassed — silently skipping Helma’s wrapping of nodes, maps and dates.

Verification

  • ./gradlew :compileJava succeeds on this branch; on 8b00a2ab (Renovate’s commit) it fails with three Class cannot be converted to TypeInfo errors.
  • tests/String.test.js passes 117/117 under both Rhino 1.8.0 and 1.9.2.
  • Runtime behavior (node/map/date wrapping, EmbeddedSlotMap hang) is being checked on antville-test.de before merging.

🤖 Generated with Claude Code

Rhino 1.9 replaced `Class<?>` with `TypeInfo` in the `NativeJavaObject` constructors and the `staticType` field, so the build fails with Renovate’s bump to 1.9.2 (#169). This branch contains that bump commit plus the fix; merging it supersedes #169. ## Changes - Create `TypeInfo` values via `TypeInfoFactory.GLOBAL.create(…)` in `JavaObject`, `GlobalObject` and `RhinoCore`. - Override `WrapFactory.wrap(…, TypeInfo)` in `RhinoCore.WrapMaker` instead of the `Class` variant. Rhino 1.9 calls the `TypeInfo` overload directly and the `Class` overload merely forwards to it, so the old override still compiled but would have been bypassed — silently skipping Helma’s wrapping of nodes, maps and dates. ## Verification - `./gradlew :compileJava` succeeds on this branch; on `8b00a2ab` (Renovate’s commit) it fails with three `Class cannot be converted to TypeInfo` errors. - `tests/String.test.js` passes 117/117 under both Rhino 1.8.0 and 1.9.2. - Runtime behavior (node/map/date wrapping, `EmbeddedSlotMap` hang) is being checked on antville-test.de before merging. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tobi self-assigned this 2026-11-02 20:01:26 +00:00
Update dependency org.mozilla:rhino-all to v1.9.2
Some checks failed
Build / build (push) Failing after 12s
8b00a2ab30
Adapt to Rhino 1.9 TypeInfo API
All checks were successful
Build / build (push) Successful in 8s
d25da994e2
Rhino 1.9 replaced `Class<?>` with `TypeInfo` in the `NativeJavaObject`
constructors and the `staticType` field, which broke compilation.

Also override `WrapFactory.wrap(…, TypeInfo)` instead of the `Class`
variant: Rhino now calls the `TypeInfo` overload directly, so the old
override would still compile but be bypassed, silently skipping Helma’s
wrapping of nodes, maps and dates.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Pass real TypeInfo instead of null to NativeJavaObject
All checks were successful
Build / build (push) Successful in 9s
ee51a8dfad
Rhino 1.8 accepted a null static type and fell back to the object’s own
class. Rhino 1.9 calls `staticType.asClass()` unconditionally, so the
null arguments in `HopObject` (`__node__`) and `GlobalObject` (`toJava`)
threw a NullPointerException, breaking macros such as `root.link`,
`story.link` and `gettext` on antville-test.de.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Redirect scripted constructors of HopObjects under Rhino 1.9
All checks were successful
Build / build (push) Successful in 19s
10d04541be
Compiled script functions are JSFunction instances in Rhino 1.9 and no longer extend NativeFunction, so the check in HopObject.put() never matched and scripted constructors (e.g. of Skins) were silently skipped.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Enable Java serialization feature of Rhino 1.9
All checks were successful
Build / build (push) Successful in 13s
3bb7bfcd8c
Rhino 1.9 refuses to serialize or deserialize scriptable objects unless Context.FEATURE_JAVA_SERIALIZATION is on. Helma needs it for the serialize() and deserialize() globals, which the admin job queue of Antville uses (site and account export, removal), and for persisting sessions across restarts.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
All checks were successful
Build / build (push) Successful in 13s
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin adapt-to-rhino-1-9-typeinfo-api:adapt-to-rhino-1-9-typeinfo-api
git switch adapt-to-rhino-1-9-typeinfo-api

Merge

Merge the changes and update on Forgejo.
git switch main
git merge --no-ff adapt-to-rhino-1-9-typeinfo-api
git switch adapt-to-rhino-1-9-typeinfo-api
git rebase main
git switch main
git merge --ff-only adapt-to-rhino-1-9-typeinfo-api
git switch adapt-to-rhino-1-9-typeinfo-api
git rebase main
git switch main
git merge --no-ff adapt-to-rhino-1-9-typeinfo-api
git switch main
git merge --squash adapt-to-rhino-1-9-typeinfo-api
git switch main
git merge --ff-only adapt-to-rhino-1-9-typeinfo-api
git switch main
git merge adapt-to-rhino-1-9-typeinfo-api
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
antville/helma!171
No description provided.