fix: visit non-attached java-docs (comments) same as the rest of the … #378
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
This is a continuation of #368.
We discovered some edge cases (e.g., Closure 148 from the Defects4J dataset) that involve unusual code evolution. For instance:
In this example, the JavaDocs on the left-hand side are not associated with any program element. However, in the right-hand side, they are now attached to a program element.
Previously, we treated unattached JavaDocs as regular comments. This approach caused us to lose valuable information provided by the parser, such as their internal structure (e.g., tag elements).
To address this, we decided to handle unattached JavaDocs the same way we handle other JavaDocs, processing all the internal nodes during tree generation.
P.S.: The screenshot was taken after applying the PR, which is why the subtrees are matched correctly.