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 toString() output for Whitelist class #2459

Closed
wants to merge 1 commit into from
Closed

Fix toString() output for Whitelist class #2459

wants to merge 1 commit into from

Conversation

schalkms
Copy link
Member

No description provided.

@@ -5,6 +5,6 @@ data class Whitelist(
) : Listing<Whitelist> {

override fun toString(): String {
return "Blacklist(ids=$ids)"
return "Whitelist(ids=$ids)"
}
Copy link
Member

Choose a reason for hiding this comment

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

This is a data class, can't we use the default toString? If the answer is no, we should add a simple test here to ensure that no one removes it in the future.

Copy link
Member

@arturbosch arturbosch Mar 19, 2020

Choose a reason for hiding this comment

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

Good point

data class Whitelist(
    override val ids: Set<String>
) : Listing<Whitelist>

fun main() {
    println(Whitelist(setOf("1", "2"))) // Whitelist(ids=[1, 2])
}

It actually prints the same string :)

Copy link
Member

@arturbosch arturbosch left a comment

Choose a reason for hiding this comment

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

Please remove the toString methods of Blacklist and Whitelist.

@@ -5,6 +5,6 @@ data class Whitelist(
) : Listing<Whitelist> {

override fun toString(): String {
return "Blacklist(ids=$ids)"
return "Whitelist(ids=$ids)"
}
Copy link
Member

@arturbosch arturbosch Mar 19, 2020

Choose a reason for hiding this comment

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

Good point

data class Whitelist(
    override val ids: Set<String>
) : Listing<Whitelist>

fun main() {
    println(Whitelist(setOf("1", "2"))) // Whitelist(ids=[1, 2])
}

It actually prints the same string :)

@arturbosch arturbosch added this to the 1.7.0 milestone Mar 19, 2020
@schalkms
Copy link
Member Author

see #2467

@schalkms schalkms closed this Mar 19, 2020
@schalkms schalkms deleted the whitelist-fix branch March 19, 2020 16:52
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.

3 participants