Skip to content

ADFA-3683: Fix Java compilation warnings on build-deps module - #1517

Merged
hal-eisen-adfa merged 4 commits into
stagefrom
ADFA-3683-fix-java-compilation-warnings
Jul 15, 2026
Merged

ADFA-3683: Fix Java compilation warnings on build-deps module#1517
hal-eisen-adfa merged 4 commits into
stagefrom
ADFA-3683-fix-java-compilation-warnings

Conversation

@Daniel-ADFA

Copy link
Copy Markdown
Contributor

No description provided.

@claude claude 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.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@Daniel-ADFA
Daniel-ADFA requested a review from a team July 13, 2026 21:18
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6dee439a-4280-4608-b6bc-0bef6dc92587

📥 Commits

Reviewing files that changed from the base of the PR and between f6d2b2e and d8b8913.

📒 Files selected for processing (1)
  • composite-builds/build-deps/jdk-compiler/src/main/java/openjdk/tools/javac/processing/JavacProcessingEnvironment.java

📝 Walkthrough
  • Fixed Java compilation warnings in the build-deps modules by removing deprecated AccessController.doPrivileged usage across multiple JDK-adjacent classes (including filesystem, JRT/JIMAGE access, and image/property checks).
  • Removed obsolete finalize() logic from ZipFileSystem and updated shutdown/close cleanup to run without privileged wrappers, requiring deterministic close() handling.
  • Updated Gradle compiler configuration in build-deps:
    • java-compiler module no longer sets explicit Java 8 sourceCompatibility/targetCompatibility via a java {} block.
    • jdk-compiler module configures JavaCompile with targeted --add-exports flags for internal JDK packages instead of relying on older Java compatibility settings.
  • Aligned legacy compiler API/deprecated surface with expectations by adding @Deprecated annotations (e.g., CaseTree.getExpression, JavaTokenizer.StringShim.stripIndent / translateEscapes).
  • Simplified DocLint service-provider internals while keeping the public DocLint API compatible, and adjusted JavacProcessingEnvironment.rethrowAbort so only Abort is rethrown (not ThreadDeath).
  • Risks/best-practice considerations:
    • Removing privileged execution blocks may affect behavior under restrictive SecurityManager/policy environments; verify filesystem access, system-property reads, reflection, and native-library loading paths.
    • Removing ZipFileSystem.finalize() increases reliance on proper deterministic cleanup; callers must always close the filesystem to avoid leaks/temp-file persistence.
    • Changing DocLint provider wiring and abort rethrow behavior could subtly affect service loading and error propagation—validate doclint behavior and annotation-processing abort handling.

Walkthrough

The PR updates compiler build configuration, removes privileged execution from filesystem and JRT image code, removes ZipFileSystem.finalize(), simplifies DocLint provider plumbing, activates deprecation annotations, and changes abort handling so ThreadDeath is no longer rethrown.

Changes

Compiler modernization

Layer / File(s) Summary
Compiler build configuration
composite-builds/build-deps/*/build.gradle.kts
Removes Java 8 compatibility configuration and adds internal JDK package exports to JavaCompile tasks.
Direct runtime and filesystem operations
composite-builds/build-deps/java-compiler/src/main/java/...
Replaces privileged property, filesystem, reflection, native-loading, and JRT operations with direct calls, and removes ZipFileSystem.finalize().
Compiler API and provider cleanup
composite-builds/build-deps/jdk-compiler/src/main/java/openjdk/...
Removes DocLint provider implementation code, activates deprecation annotations, and limits abort rethrowing to Abort instances.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested reviewers: jatezzz

Poem

I nibbled privileged wrappers away,
And let direct calls hop through the hay.
Deprecated flags now proudly gleam,
Compiler paths flow like a stream.
Hop, hop—clean builds take flight! 🐇

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No meaningful pull request description was provided, so the intent of the changes cannot be assessed from the description alone. Add a brief description of the main changes and why they were made.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the changeset, which focuses on fixing Java compilation warnings in the build-deps module.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ADFA-3683-fix-java-compilation-warnings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@composite-builds/build-deps/jdk-compiler/src/main/java/openjdk/tools/javac/processing/JavacProcessingEnvironment.java`:
- Around line 1918-1921: Update rethrowAbort to also rethrow ThreadDeath
alongside Abort, preserving direct propagation from the processor
initialization, processing, and re-entry catch paths; leave other Throwable
handling unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: daa945f9-86be-4890-a3fe-61120c48f5b6

📥 Commits

Reviewing files that changed from the base of the PR and between 9b1bf97 and 1218761.

📒 Files selected for processing (11)
  • composite-builds/build-deps/java-compiler/build.gradle.kts
  • composite-builds/build-deps/java-compiler/src/main/java/com/itsaky/androidide/zipfs2/ZipFileSystem.java
  • composite-builds/build-deps/java-compiler/src/main/java/javac/internal/jimage/BasicImageReader.java
  • composite-builds/build-deps/java-compiler/src/main/java/javac/internal/jimage/NativeImageBuffer.java
  • composite-builds/build-deps/java-compiler/src/main/java/javac/internal/jrtfs/JrtFileSystemProvider.java
  • composite-builds/build-deps/java-compiler/src/main/java/javac/internal/jrtfs/SystemImage.java
  • composite-builds/build-deps/jdk-compiler/build.gradle.kts
  • composite-builds/build-deps/jdk-compiler/src/main/java/openjdk/source/tree/CaseTree.java
  • composite-builds/build-deps/jdk-compiler/src/main/java/openjdk/tools/doclint/DocLint.java
  • composite-builds/build-deps/jdk-compiler/src/main/java/openjdk/tools/javac/parser/JavaTokenizer.java
  • composite-builds/build-deps/jdk-compiler/src/main/java/openjdk/tools/javac/processing/JavacProcessingEnvironment.java
💤 Files with no reviewable changes (2)
  • composite-builds/build-deps/java-compiler/build.gradle.kts
  • composite-builds/build-deps/jdk-compiler/src/main/java/openjdk/tools/doclint/DocLint.java

The three catch(Throwable) paths in annotation processing (processor
init, processing, re-entry) route through rethrowAbort, which only
propagated Abort and silently swallowed ThreadDeath. Rethrow both.
@hal-eisen-adfa
hal-eisen-adfa merged commit 86e9d3f into stage Jul 15, 2026
4 checks passed
@hal-eisen-adfa
hal-eisen-adfa deleted the ADFA-3683-fix-java-compilation-warnings branch July 15, 2026 01:13
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.

4 participants