-
Notifications
You must be signed in to change notification settings - Fork 130
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
ASTRewrite.rewriteAST fails with AssertionFailedException for records when it contains inner class #3002
ASTRewrite.rewriteAST fails with AssertionFailedException for records when it contains inner class #3002
Conversation
26e8d0d
to
4504202
Compare
@subyssurendran666 Can you say a word or two about the root cause of the problem and what the fix does? Thanks! |
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.
As I said on the PR, a word or two about why the fix is correct would help speed up the review. For e.g., it's not clear why this is not a problem for regular classes but only a problem for records?
...del/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingRecordDeclarationTest.java
Outdated
Show resolved
Hide resolved
I have a code snippet
and trying to rewrite the inner node using the ASTRewrite, then it throws an exception
The exception occurs when the length of DeleteEdit becomes negative. However, when I change the record in the test to a class, the issue resolves. In the method |
4504202
to
4bda262
Compare
@jarthana I've noticed another issue related to the AST: the starting position of the MethodDeclaration is invalid. I'm currently debugging this issue. |
4bda262
to
16aa3b9
Compare
605409b
to
6298d93
Compare
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.
@subyssurendran666 since this is an issue primarily due to conversion, can you please add a junit test case for DOM AST conversion. Once review comments are incorporated please go ahead and merge. Thanks!
Sure, I will add ASTConversion test also. |
a11cb36
to
8a2f7b7
Compare
Done. |
56b6e98
to
b34f303
Compare
b34f303
to
5cff670
Compare
5cff670
to
e7f7377
Compare
@jarthana: I took the liberty of merging - didn't want to risk another rebase :) |
What it does
#2835
How to test
Author checklist