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

style: fix Bad Smells in spoon.support.util.ImmutableMapImpl #4916

Merged
merged 1 commit into from
Sep 27, 2022

Conversation

MartinWitt
Copy link
Collaborator

Repairing Code Style Issues

UnnecessaryToStringCall

The toString() method is not needed in cases the underlying method handles the conversion. Also calling toString() on a String is redundant. Removing them simplifies the code.

Changes:

  • Remove redudant toString() call in parent.toString()

Copy link
Collaborator

@SirYwell SirYwell left a comment

Choose a reason for hiding this comment

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

Looks good.

As a side note, do you think it would make sense to write transformations that would transform code from

sb.append(a);
sb.append(b);

to

sb.append(a).append(b);

?
(probably with better formatting)

@MartinWitt
Copy link
Collaborator Author

As a side note, do you think it would make sense to write transformations that would transform code from

Writing formatting transformation is a possibility, for sure. But I'm unsure if this field is already solved by spotless and other tools. Also, formatting is very opinionated and not as strict as bad smells. So, I skipped this until now.

@MartinWitt MartinWitt changed the title fix Bad Smells in spoon.support.util.ImmutableMapImpl review: style: fix Bad Smells in spoon.support.util.ImmutableMapImpl Sep 27, 2022
@SirYwell SirYwell changed the title review: style: fix Bad Smells in spoon.support.util.ImmutableMapImpl style: fix Bad Smells in spoon.support.util.ImmutableMapImpl Sep 27, 2022
@SirYwell SirYwell merged commit d85a4cd into INRIA:master Sep 27, 2022
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