Skip to content

Fix JAR manifest lookup and complete typed Attributes Map support - #215

Merged
dlunch merged 2 commits into
mainfrom
fix/jar-manifest-attributes
Oct 15, 2026
Merged

dlunch merged 2 commits into
mainfrom
fix/jar-manifest-attributes

Conversation

@dlunch

@dlunch dlunch commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Changes

  • Find manifests case-insensitively, prefer the canonical filename, and return null when absent. Keep ordinary entry lookup case-sensitive and report invalid manifest attribute names as IOException.
  • Add Attributes.Name validation, case-insensitive equality and hashing, original spelling, and Java 8 constants. Implement Attributes Map operations, type checks, equality, hashing, and live views; dispatch convenience methods through virtual get/put calls.
  • Support removal through shared HashMap entry, key, and value iterators, including HashSet iteration. Extend integration coverage for manifest lookup, Attributes operations, and backing-map updates.

Verification

  • cargo test --workspace --quiet: 556 passed, 2 existing ignored.
  • cargo clippy --workspace --all-targets -- -D warnings: passed.
  • cargo fmt --all -- --check: passed.
  • cargo check -p rustjava-runtime --lib --target wasm32-unknown-unknown: passed (compile only).
  • Local JDK 27 black-box checks confirmed manifest lookup behavior, invalid-name IOException, and Attributes null handling.

Copilot AI balanced review requested due to automatic review settings October 15, 2026 04:56
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T05:08:12.629126Z 8234ff9 New commits
ℹ️ 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.

Comment thread rustjava-runtime/src/classes/java/util/jar/attributes.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8a0ee698da

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread rustjava-runtime/src/classes/java/util/jar/attributes.rs
@codecov

codecov Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.29%. Comparing base (5e9360a) to head (8234ff9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #215      +/-   ##
==========================================
+ Coverage   87.20%   87.29%   +0.09%     
==========================================
  Files         309      310       +1     
  Lines       46332    46685     +353     
==========================================
+ Hits        40403    40756     +353     
  Misses       5929     5929              

☔ 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.

Comment thread rustjava-runtime/src/classes/java/util/hash_map_hash_iterator.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It changes shared iterator semantics across HashMap/HashSet views plus JAR manifest lookup behavior, which is broad enough to warrant human review despite no functional defects found.

1 open finding
What changed in this PR

This PR improves RustJava's java.util.jar compatibility and extends the shared HashMap iterator infrastructure. It fixes JAR manifest discovery to be case-insensitive (while keeping ordinary entry lookup case-sensitive), introduces a typed Attributes$Name key class with validation and case-insensitive equality/hashing, makes Attributes expose a live entrySet via the Map interface, and adds Iterator.remove() support to the HashMap entry/key/value view iterators (which also benefits HashSet).

Changes:

  • Case-insensitive manifest lookup with canonical-filename preference and null when absent; invalid manifest attribute names surface as IOException.
  • New Attributes$Name (validation, case-insensitive equals/hashCode, Java 8 constants); Attributes now implements Map, stores typed keys, supports getValue(Name) and a live entrySet.
  • Shared HashMap$HashIterator.remove() implementation (via a map/lastReturned field) with snapshot_entries always snapshotting entries; iterators now receive the backing map in their constructor.
File Description
src/​classes/​java/​util/​jar/​attributes_name.rs New typed Attributes$Name class with validation, equality/hashing, and constants.
src/​classes/​java/​util/​jar/​attributes.rs Implements Map, adds getValue(Name)/entrySet, wraps keys as Name.
src/​classes/​java/​util/​jar/​manifest.rs Converts invalid-attribute IllegalArgumentException into IOException.
src/​classes/​java/​util/​jar/​jar_file.rs Case-insensitive manifest fallback using the zip archive's file names.
src/​classes/​java/​util/​jar.rs Exports the new AttributesName.
src/​classes/​java/​util/​zip/​zip_file.rs Exposes get_zip_archive as pub(crate).
src/​classes/​java/​util/​hash_map.rs snapshot_entries always snapshots entries; passes this to iterators; drops SnapshotKind.
src/​classes/​java/​util/​hash_map_hash_iterator.rs Adds map/lastReturned fields and a working remove().
src/​classes/​java/​util/​hash_map_{key,value,entry}_iterator.rs New constructor signature; key/value iterators override next to extract key/value.
src/​loader.rs Registers AttributesName proto.
tests/​.../​jar/​test_attributes.rs, test_jar_file.rs, test_manifest.rs Cover typed names, entrySet removal, case-insensitive manifest, invalid-name IOException.
tests/​.../​util/​test_hash_map.rs, test_hash_set.rs Cover view-iterator removal and backing-map updates.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread rustjava-runtime/src/classes/java/util/jar/attributes_name.rs
@dlunch dlunch changed the title Fix JAR manifest lookup and add typed Attributes entry views Fix JAR manifest lookup and complete typed Attributes Map support Oct 15, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8234ff9869

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread rustjava-runtime/src/classes/java/util/hash_map_hash_iterator.rs
@dlunch
dlunch merged commit 77ba676 into main Oct 15, 2026
19 checks passed
@dlunch
dlunch deleted the fix/jar-manifest-attributes branch October 15, 2026 05:09
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