-
Notifications
You must be signed in to change notification settings - Fork 332
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
Comments cannot be parsed properly #4624
Conversation
Looks like the issue is related to the ending |
rewrite-java-test/src/test/java/org/openrewrite/java/JavaParserTest.java
Outdated
Show resolved
Hide resolved
With @Laurens-W, I looked at and debugged the code. In the end, we found that removing the +2 increment (see commit) resolves the issue. However, we are uncertain what the original reasoning behind this +2 instead of +1 increment was. |
@nielsdebruin thanks for diving in! This seems to have resulted in some new failures in diff --git a/Test.java b/Test.java
index 5d28d39..c911b87 100644
--- a/Test.java
+++ b/Test.java
@@ -1,3 +1,3 @@
class Test {
- public void foo() { }/*Comments*/
+ public void foo() { }///Comments*/
}
\ No newline at end of file Would you mind having a look at those? |
6b4335a
to
1fcdcd3
Compare
Likely accidentally removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to see you've worked out a way to get the test going; From my local tests it seems the continue isn't necessary, and we can instead evaluate the if (!inMultiLineComment && !inSingleLineComment)
below like normal. Would you agree? Or is there a failing scenario we can code up where that would not work?
What's changed?
Identified a setup of comments that doesn't get parsed properly and added that as reproducer testcase
Anyone you would like to review specifically?
@nielsdebruin @timtebeek
Checklist