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 "Redundant superinterface" warning depends on Interface name #3423

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

jukzi
Copy link
Contributor

@jukzi jukzi commented Dec 9, 2024

SuperTypeTest.test016(), SuperTypeTest.test017() failed when implementation of ReferenceBinding.hashCode() changed.

The message was either
"already defined by IChangeRulerColumn" or
"already defined by IRevisionRulerColumn"
depending on which Interface had the lower hashCode.

Now using a LinkedHashMap to rely on the insertion order rather then the hashcode.

relates to
#3412

SuperTypeTest.test016(), SuperTypeTest.test017() failed when
implementation of ReferenceBinding.hashCode() changed.

The message was either
"already defined by IChangeRulerColumn" or
"already defined by IRevisionRulerColumn"
depending on which Interface had the lower hashCode.

Now using a LinkedHashMap to rely on the insertion order rather then the
hashcode.

relates to
eclipse-jdt#3412
@jukzi jukzi added the bug Something isn't working label Dec 9, 2024
@srikanth-sankaran
Copy link
Contributor

Thanks @jukzi I'll review this tomorrow

Copy link
Contributor

@srikanth-sankaran srikanth-sankaran left a comment

Choose a reason for hiding this comment

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

These changes look fine.

Question. You also mention test016 failed, but how come the changes only modify test017 ??

Conditional approval assuming that there is a rational explanation for that,

@jukzi
Copy link
Contributor Author

jukzi commented Dec 11, 2024

I tested manually with forcing specific hashCodes for both interfaces that both tests would change result upon changing hashcode. However the current solution does not change the hashCode but just does not rely on it anymore. Only one of the tests had in the "expected" order, i adapted the other.

@jukzi jukzi merged commit ece42f8 into eclipse-jdt:master Dec 11, 2024
10 checks passed
@jukzi jukzi deleted the SuperTypeTest branch December 11, 2024 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants