8000 Enum rewrite problem with ASTRewrite by subyssurendran666 · Pull Request #3979 · eclipse-jdt/eclipse.jdt.core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Enum rewrite problem with ASTRewrite #3979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

subyssurendran666
Copy link
Contributor
@subyssurendran666 subyssurendran666 commented May 7, 2025

When an EnumConstantDeclaration is rewritten, changes made to its anonymous class body—such as renaming variables or methods—are not reflected if the enum constant itself is renamed. In such cases, the original body is retained, and modifications within it are discarded. However, if the enum constant name remains unchanged, rewrites to the body are applied as expected. This indicates a potential issue in how ASTRewrite handles concurrent updates to both the enum constant and its associated body.

Ensures that the visitor always processes the body of the anonymous class, even if the changes are only in its nested children

Fixes: #3939

What it does

How to test

Author checklist

@subyssurendran666 subyssurendran666 force-pushed the Enum_rewrite_problem_3939 branch from 743627d to 31389cc Compare May 7, 2025 06:22
@mpalat mpalat self-requested a review May 7, 2025 09:43
Copy link
Contributor
@mpalat mpalat left a comment

Choose a reason for hiding this comment

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

+1
Changes look good

@subyssurendran666 subyssurendran666 force-pushed the Enum_rewrite_problem_3939 branch from 31389cc to 1713af4 Compare May 8, 2025 03:00
Ensures that the visitor always processes the body of the anonymous
class, even if the changes are only in its nested children

Fixes: eclipse-jdt#3939
@subyssurendran666 subyssurendran666 force-pushed the Enum_rewrite_problem_3939 branch from 1713af4 to cd70fb8 Compare May 8, 2025 04:06
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.

Enum rewrite problem with org.eclipse.jdt.core.dom.rewrite.ASTRewrite
2 participants
0