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

SONARKT-379 Fix false positive in S6218 #375

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fellmann
Copy link

@fellmann fellmann commented Nov 1, 2023

Overriding equals and hashCode is not necessary for data classes that have array fields in their body, because only arguments of the primary constructor are included in the generated equals and hashCode for data classes.

This should not be trigger the rule:

data class ArrayInBody(val age: Int) { // Compliant
    val employers = arrayOf("SonarSource")
}

@johann-beleites-sonarsource johann-beleites-sonarsource changed the title Fix false positive in S6218 SONARKT-379 Fix false positive in S6218 Nov 29, 2023
@johann-beleites-sonarsource
Copy link
Contributor

Hello @fellmann, thanks for your contribution! I've created a ticket to track this issue.

@kaufco kaufco requested review from kaufco and removed request for kaufco January 15, 2024 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants