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

Merged

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 2 times, most recently from 1713af4 to cd70fb8 Compare May 8, 2025 04:06
@subyssurendran666 subyssurendran666 force-pushed the Enum_rewrite_problem_3939 branch from cd70fb8 to 02209dd Compare May 15, 2025 09:58
@subyssurendran666 subyssurendran666 force-pushed the Enum_rewrite_problem_3939 branch from 02209dd to aebd044 Compare June 6, 2025 04:08
@eclipse-jdt-bot
Copy link
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

org.eclipse.jdt.core.tests.model/META-INF/MANIFEST.MF
org.eclipse.jdt.core.tests.model/pom.xml
org.eclipse.jdt.core/META-INF/MANIFEST.MF
org.eclipse.jdt.core/pom.xml

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From 2cbe38cf917122fa077d33acdcca8431e8137f65 Mon Sep 17 00:00:00 2001
From: Eclipse JDT Bot <jdt-bot@eclipse.org>
Date: Fri, 6 Jun 2025 04:13:54 +0000
Subject: [PATCH] Version bump(s) for 4.37 stream


diff --git a/org.eclipse.jdt.core.tests.model/META-INF/MANIFEST.MF b/org.eclipse.jdt.core.tests.model/META-INF/MANIFEST.MF
index 40a878b3e4..45beaf9a79 100644
--- a/org.eclipse.jdt.core.tests.model/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.core.tests.model/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jdt.core.tests.model;singleton:=true
-Bundle-Version: 3.13.400.qualifier
+Bundle-Version: 3.13.500.qualifier
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Export-Package: org.eclipse.jdt.core.tests,
diff --git a/org.eclipse.jdt.core.tests.model/pom.xml b/org.eclipse.jdt.core.tests.model/pom.xml
index 8b8b2ceb80..921721636e 100644
--- a/org.eclipse.jdt.core.tests.model/pom.xml
+++ b/org.eclipse.jdt.core.tests.model/pom.xml
@@ -19,7 +19,7 @@
     <relativePath>../tests-pom/</relativePath>
   </parent>
   <artifactId>org.eclipse.jdt.core.tests.model</artifactId>
-  <version>3.13.400-SNAPSHOT</version>
+  <version>3.13.500-SNAPSHOT</version>
   <packaging>eclipse-test-plugin</packaging>
 
   <properties>
diff --git a/org.eclipse.jdt.core/META-INF/MANIFEST.MF b/org.eclipse.jdt.core/META-INF/MANIFEST.MF
index ef9654cd1e..b438116029 100644
--- a/org.eclipse.jdt.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jdt.core; singleton:=true
-Bundle-Version: 3.42.0.qualifier
+Bundle-Version: 3.42.100.qualifier
 Bundle-Activator: org.eclipse.jdt.core.JavaCore
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
diff --git a/org.eclipse.jdt.core/pom.xml b/org.eclipse.jdt.core/pom.xml
index 6ca29af68b..243e3b8a35 100644
--- a/org.eclipse.jdt.core/pom.xml
+++ b/org.eclipse.jdt.core/pom.xml
@@ -17,7 +17,7 @@
     <version>4.37.0-SNAPSHOT</version>
   </parent>
   <artifactId>org.eclipse.jdt.core</artifactId>
-  <version>3.42.0-SNAPSHOT</version>
+  <version>3.42.100-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 
   <properties>
-- 
2.49.0

Further information are available in Common Build Issues - Missing version increments.

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 e737a8b to 2c4f2ce Compare June 6, 2025 06:55
@mpalat mpalat merged commit 85638f6 into eclipse-jdt:master Jun 6, 2025
13 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.

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