Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

refactor: refactor bad smell UnnecessaryToStringCall #535

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

MartinWitt
Copy link

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.

Repairing Code Style Issues

  • UnnecessaryToStringCall (1)

Removing this toString call removes noise because a developer has less code to understand.

After this PR

==COMMIT_MSG==
Remove unnecessary toString call in BaseGraalCompilerTask
==COMMIT_MSG==

Possible downsides?

A developer could not understand that string concatenation calls the toString for objects. I hope this is never the case, but this is the only downside. There is no other unneeded toString call in your project according to Qodana/IntelliJ

- 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.
@palantirtech
Copy link
Member

Thanks for your interest in palantir/gradle-graal, @MartinWitt! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.

@changelog-app
Copy link

changelog-app bot commented Jan 8, 2023

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Remove unnecessary toString call in BaseGraalCompilerTask

Check the box to generate changelog(s)

  • Generate changelog entry

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants