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

Test and preliminary fix for issue with "USE_VAR" cleanup #1538

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

carstenartur
Copy link
Contributor

@carstenartur carstenartur commented Jul 24, 2024

Reproducer for
#1525
The "fix" included seems to be a kind of bold hack. A good fix might need a changes to some underlying classes that can not really handle parametrized types for import removal in the case of type interference.

What it does

For the case of using diamond operater the underlying class to remove the imports of the instance expression is fed with the expression without the type so arraylist<> instead of arraylist. The junit tests are fine but I do not trust this approach so much. And it seems to me there is really a lack of support for paramerized types in the classes in charge to handle the import removal. Maybe it is fine because within the scope of the code changes of this cleanup it is good enough?

How to test

Try to run it over jdtui code sources. There are several cases where this error pops up.

Author checklist

@carstenartur carstenartur changed the title Test that shows issue with "USE_VAR" cleanup Test and preliminary fix for issue with "USE_VAR" cleanup Jul 24, 2024
@carstenartur carstenartur marked this pull request as ready for review July 24, 2024 10:24
@carstenartur
Copy link
Contributor Author

@jjohnstn if you feel like proposing or implementing a better fix you are welcome. I still think that this fix is a kind of hack.

Copy link
Contributor

@jjohnstn jjohnstn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @carstenartur I think the fix is fine.

@jjohnstn jjohnstn merged commit f1cd1c8 into eclipse-jdt:master Aug 8, 2024
9 checks passed
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