Skip to content

Adds @SideEffecFree annotation to FileInputStream(String) and FileInputStream(File).#280

Merged
mernst merged 2 commits into
typetools:masterfrom
iamsanjaymalakar:7049-dev
Jun 4, 2026
Merged

Adds @SideEffecFree annotation to FileInputStream(String) and FileInputStream(File).#280
mernst merged 2 commits into
typetools:masterfrom
iamsanjaymalakar:7049-dev

Conversation

@iamsanjaymalakar

Copy link
Copy Markdown
Member

This is part of CF PR: typetools/checker-framework#7050

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

FileInputStream receives @SideEffectFree annotations on its two public constructors: FileInputStream(String name) and FileInputStream(File file). The checker framework annotation is imported from org.checkerframework.dataflow.qual.SideEffectFree and applied without changing constructor signatures or control flow.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

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

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 `@src/java.base/share/classes/java/io/FileInputStream.java`:
- Around line 115-118: The constructors FileInputStream(File) and
FileInputStream(String) are incorrectly annotated `@SideEffectFree`; remove the
`@SideEffectFree` annotation from both constructors (the public
FileInputStream(File) and the public FileInputStream(String) delegating
constructor) so their actual side effects (permission checks, native open,
cleanup registration) are not misrepresented; also remove the now-unused import
for `@SideEffectFree` if it becomes unused after these deletions.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2d106e46-311d-43de-b06a-a16af246a8de

📥 Commits

Reviewing files that changed from the base of the PR and between 185ea5f and 763e241.

📒 Files selected for processing (1)
  • src/java.base/share/classes/java/io/FileInputStream.java

Comment thread src/java.base/share/classes/java/io/FileInputStream.java
@mernst mernst merged commit 0626ede into typetools:master Jun 4, 2026
34 of 49 checks passed
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