Skip to content

Add java.lang.ref weak references, Timer date fixed-rate scheduling, and index exception int constructors - #241

Merged
dlunch merged 1 commit into
mainfrom
weak-reference-and-api-gaps
Nov 14, 2026
Merged

dlunch merged 1 commit into
mainfrom
weak-reference-and-api-gaps

Conversation

@dlunch

@dlunch dlunch commented Nov 14, 2026

Copy link
Copy Markdown
Owner

java.lang.ref

  • Add java.lang.ref.Reference (get(), clear()) and java.lang.ref.WeakReference (WeakReference(Object)).
  • The garbage collector does not trace Reference.referent, and clears it on reachable references once the referent is no longer strongly reachable.

Timer

  • Add Timer.scheduleAtFixedRate(TimerTask, Date, long), with the same validation as schedule(TimerTask, Date, long).

Index exceptions

  • Add ArrayIndexOutOfBoundsException(int) and StringIndexOutOfBoundsException(int), producing Array index out of range: <index> and String index out of range: <index>.

Verification

  • New WeakReferenceSemantics fixture run by test_class, with expected output generated on a real JVM; it fails without the collector change.
  • Extended the existing Timer and exception tests for the new overloads.
  • cargo fmt --check, cargo clippy --workspace --all-targets, and cargo test --workspace pass.

…on overloads

- java.lang.ref.Reference and WeakReference; the garbage collector no longer
  traces Reference.referent and clears it once the referent is otherwise unreachable
- Timer.scheduleAtFixedRate(TimerTask, Date, long)
- ArrayIndexOutOfBoundsException(int) and StringIndexOutOfBoundsException(int)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T04:17:08.143226Z eb84a47 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codecov

codecov Bot commented Nov 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.99248% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.87%. Comparing base (279ccb6) to head (eb84a47).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
rustjava-runtime/src/classes/java/util/timer.rs 86.66% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #241      +/-   ##
==========================================
+ Coverage   87.84%   87.87%   +0.02%     
==========================================
  Files         311      313       +2     
  Lines       47183    47315     +132     
==========================================
+ Hits        41448    41576     +128     
- Misses       5735     5739       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dlunch
dlunch merged commit 3306180 into main Nov 14, 2026
14 checks passed
@dlunch
dlunch deleted the weak-reference-and-api-gaps branch November 14, 2026 05:10
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