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

Handle Map.Entry properly in import removal, and remove duplicated logic #390

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

Conversation

kelloggm
Copy link
Collaborator

@kelloggm kelloggm commented Jan 23, 2025

Prior to this PR, there were two pieces of code in Specimin that were both trying to handle removing extraneous imports:

  • some code in PrunerVisitor, and
  • the UnusedImportRemoverVisitor class

I deleted the logic in PrunerVisitor, which was more complex but had the same overall impact. I enhanced the logic in UnusedImportRemoverVisitor to fix the bug evinced by the new test case, wherein the import java.util.Map was incorrectly removed. I also had to add some continue statements elsewhere in PrunerVisitor; that part makes me nervous, because a seemingly-unrelated test failed without them but did not fail until I removed the logic in PrunerVisitor. However, I much prefer this design and don't have time to dig deep into that, so I'm okay with ignoring that weirdness for now: the new continue statements are pretty clearly correct (it's not sensible to keep going through the loop body's logic if we've already decided to remove something).

I expect CI to fail, because this PR should resolve some compilation issues in plume-util. I'll update the "passed" baseline number once I know what the new result is.

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