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

fix: visit non-attached java-docs (comments) same as the rest of the … #378

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pouryafard75
Copy link
Contributor

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:
image

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.

@pouryafard75 pouryafard75 changed the title fix: visit non-attached java-docs (comments) same as the rest of the … [WIP] fix: visit non-attached java-docs (comments) same as the rest of the … Nov 27, 2024
@pouryafard75 pouryafard75 changed the title [WIP] fix: visit non-attached java-docs (comments) same as the rest of the … fix: visit non-attached java-docs (comments) same as the rest of the … Nov 27, 2024
@pouryafard75 pouryafard75 changed the title fix: visit non-attached java-docs (comments) same as the rest of the … [WIP] fix: visit non-attached java-docs (comments) same as the rest of the … Nov 27, 2024
…java-docs

fix: correct the non-attached java-doc position in tree

fix: bug
@pouryafard75 pouryafard75 changed the title [WIP] fix: visit non-attached java-docs (comments) same as the rest of the … fix: visit non-attached java-docs (comments) same as the rest of the … Nov 27, 2024
@jrfaller
Copy link
Member

jrfaller commented Dec 7, 2024

Wow nice catch! Congrats! The PR is ready now ? Cheers!

@pouryafard75
Copy link
Contributor Author

@jrfaller Yes its ready.
If you have any suggestion regarding the implementation, I appreciate it.

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.

2 participants