Skip to content

Add @EnsuresInitialized postcondition - #136

Open
aosen-xiong wants to merge 6 commits into
eisop:masterfrom
aosen-xiong:feature/ensures-initialized
Open

Add @EnsuresInitialized postcondition#136
aosen-xiong wants to merge 6 commits into
eisop:masterfrom
aosen-xiong:feature/ensures-initialized

Conversation

@aosen-xiong

Copy link
Copy Markdown
Collaborator

No description provided.

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.

Pull request overview

This PR introduces a new Checker Framework Initialization Checker postcondition annotation, @EnsuresInitialized, to express that specific Java expressions are @Initialized after successful method/constructor termination.

Changes:

  • Adds @EnsuresInitialized as a @PostconditionAnnotation(qualifier = Initialized.class) for methods and constructors.
  • Makes the annotation repeatable via an inner @interface List container.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
aosen-xiong and others added 4 commits August 5, 2026 18:35
The Javadoc comment on value() was indented five spaces instead of four,
so check-jdk-consistency.sh reported a difference against the
checker-qual copy and failed the misc CI job.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Picks up the Javadoc clarification added in eisop/checker-framework#1918:
when the annotation is useful, that it is trivially true on an already
@initialized receiver, and to prefer @EnsuresNonNull when a nullness
guarantee is also wanted.

check-jdk-consistency.sh requires this file to be identical to the
checker-qual copy.
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