Skip to content
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

Parser failures with unnecessary semicolons #5063

Merged
merged 12 commits into from
Feb 21, 2025

Conversation

timtebeek
Copy link
Contributor

@timtebeek timtebeek commented Feb 18, 2025

PR hijacked by @greg-at-moderne.

What

Fixing a few issues with unnecessary semicolons in Java classes - either in between statements or at the end of class body.

What's your motivation?

Addressing feedback from one of the OpenRewrite users.

@timtebeek timtebeek added bug Something isn't working parser-java labels Feb 18, 2025
@greg-at-moderne greg-at-moderne self-assigned this Feb 19, 2025
@greg-at-moderne greg-at-moderne changed the title Parser failures with semicolons in new class Parser failures with unnecessary semicolons Feb 19, 2025
@greg-at-moderne greg-at-moderne marked this pull request as ready for review February 19, 2025 14:45
@jevanlingen jevanlingen self-requested a review February 20, 2025 08:40
@knutwannheden
Copy link
Contributor

I still get a diff when parsing class A {;;;int i = 0;}.

diff --git a/A.java b/A.java
index 2868c61..c0b28d5 100644
--- a/A.java
+++ b/A.java
@@ -1 +1 @@ 
-class A {;;;int i = 0;}
\ No newline at end of file
+class A {;int i = 0;}
\ No newline at end of file

@greg-at-moderne
Copy link
Contributor

I still get a diff when parsing class A {;;;int i = 0;}.

Fixed in 9ac55e5. Test case added in 4e972ff.

@greg-at-moderne greg-at-moderne merged commit 49855ca into main Feb 21, 2025
2 checks passed
@greg-at-moderne greg-at-moderne deleted the parse-failure-with-semicolons-in-new-class branch February 21, 2025 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working parser-java
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants