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

Avoid duplicate calls in ReferenceBinding::superInterfaces #3601 #3710

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

christianstaib
Copy link

  • Make the method final

  • Add new recursive method ReferenceBinding.superInterfacesRecursive that takes an IndentityHashMap to keep the visited types

Fixes #3601

Supersedes #3622

…t#3601

- Make the method final
- Add new recursive method ReferenceBinding.superInterfacesRecursive
that takes an IndentityHashMap to keep the visited types

Fixes eclipse-jdt#3601

protected ReferenceBinding[] superInterfacesRecursive(Map<ReferenceBinding, Object> visited) {
if (visited.put(this, this) != null) { // do not evaluate the same type twice
return this.superInterfaces;
Copy link
Author

Choose a reason for hiding this comment

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

Hi @jukzi,

this i moved this PR here but it is the same as #3622.

Regarding your question https://github.com/eclipse-jdt/eclipse.jdt.core/pull/3622/files/67baa79f72287ae12a64123dc7b2e184cada4754#r1932431660:
As far as i know, it does not return here. I checked this while building smaller, non-Eclipse projects so there is a chance that this code was not called with the correct conditions to return here.

Regarding the junit testcase, do you mean a testcase that executes duplicted calls?

Copy link
Author

Choose a reason for hiding this comment

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

Correction: It can return here and im trying to figure out under which conditions it does

Copy link
Contributor

Choose a reason for hiding this comment

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

Regarding the junit testcase, do you mean a testcase that executes duplicted calls?

a reproducer should visit the same interface/class multiple times

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.

performance: ReferenceBinding.superInterfaces() with redundant super interfaces
3 participants