Skip to content

8376430: [lworld] Remove Modifier.IDENTITY#1980

Closed
liach wants to merge 4 commits intoopenjdk:lworldfrom
liach:fix/remove-modifier-identity
Closed

8376430: [lworld] Remove Modifier.IDENTITY#1980
liach wants to merge 4 commits intoopenjdk:lworldfrom
liach:fix/remove-modifier-identity

Conversation

@liach
Copy link
Copy Markdown
Member

@liach liach commented Jan 27, 2026

java.lang.reflect.Modifier represents Java language modifiers. Since a previous iteration of JEP 401, the "identity" source modifier is removed, and only "value" source modifier exists. As a result, "identity" is no longer qualified to be present in Modifier. We should migrate all its uses to ClassFile.ACC_IDENTITY or AccessFlag.IDENTITY (which already correctly identifies itself not as a source modifier).

This also avoids the headache of Modifier.toString clashing over SYNCHRONIZED versus IDENTITY.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (1 review required, with at least 1 Committer)

Issue

  • JDK-8376430: [lworld] Remove Modifier.IDENTITY (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/1980/head:pull/1980
$ git checkout pull/1980

Update a local copy of the PR:
$ git checkout pull/1980
$ git pull https://git.openjdk.org/valhalla.git pull/1980/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1980

View PR using the GUI difftool:
$ git pr show -t 1980

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/1980.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented Jan 27, 2026

👋 Welcome back liach! A progress list of the required criteria for merging this PR into lworld will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link
Copy Markdown

openjdk Bot commented Jan 27, 2026

@liach This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8376430: [lworld] Remove Modifier.IDENTITY

Reviewed-by: vromero, darcy

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 1 new commit pushed to the lworld branch:

  • 9c8ed48: 8375074: [lworld] vmTestbase/nsk/jdi/ModificationWatchpointEvent/valueToBe/valuetobe001/TestDescription.java fails with --enable-preview

Please see this link for an up-to-date comparison between the source branch of this pull request and the lworld branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the lworld branch, type /integrate in a new comment.

@openjdk openjdk Bot added the rfr Pull request is ready for review label Jan 27, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented Jan 27, 2026

Webrevs

Copy link
Copy Markdown
Contributor

@vicente-romero-oracle vicente-romero-oracle left a comment

Choose a reason for hiding this comment

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

lgtm

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label Jan 27, 2026
* For all other {@code Class} objects, this method returns {@code true} if either
* preview features are disabled or {@linkplain Modifier#IDENTITY} is set in the
* preview features are disabled or {@linkplain ClassFile#ACC_IDENTITY} is set in the
* {@linkplain #getModifiers() class modifiers}.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Change "class modifiers" to "access flags" (or equivalent) or line 644.

* For all other {@code Class} objects, this method returns {@code true} only if
* preview features are enabled and {@linkplain Modifier#IDENTITY} is not set in the
* preview features are enabled and {@linkplain ClassFile#ACC_IDENTITY} is not set in the
* {@linkplain #getModifiers() class modifiers}.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same comment as on line 644.

@jddarcy
Copy link
Copy Markdown
Member

jddarcy commented Jan 27, 2026

At a high-level, I concur that removing IDENTITY from Modifiers is the correct direction. The toString() methods of classes, or other affected constructs, can be updated to still print out source-level information even when the language and VM model a concept differently.

@liach
Copy link
Copy Markdown
Member Author

liach commented Jan 28, 2026

Thanks for the reviews! Tier 1-2 passed.

/integrate

@openjdk
Copy link
Copy Markdown

openjdk Bot commented Jan 28, 2026

Going to push as commit 0f2f43b.
Since your change was applied there has been 1 commit pushed to the lworld branch:

  • 9c8ed48: 8375074: [lworld] vmTestbase/nsk/jdi/ModificationWatchpointEvent/valueToBe/valuetobe001/TestDescription.java fails with --enable-preview

Your commit was automatically rebased without conflicts.

@openjdk openjdk Bot added the integrated Pull request has been integrated label Jan 28, 2026
@openjdk openjdk Bot closed this Jan 28, 2026
@openjdk openjdk Bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jan 28, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented Jan 28, 2026

@liach Pushed as commit 0f2f43b.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants