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

remove useless setPassword #8953

Merged

Conversation

SecureDong
Copy link

@SecureDong SecureDong commented Jul 18, 2023

Pull Request description

Remove useless setPassword. The code in question serves no purpose.

General checklist

  • You have reviewed the guidelines document.

@ashvayka
Copy link
Member

What is the reason for removing those lines? Please provide a detailed explanation.

@SecureDong
Copy link
Author

What is the reason for removing those lines? Please provide a detailed explanation.

if (StringUtils.isNotEmpty(mqttCredentials.getPassword())) {
mqttCredentials.setPassword(mqttCredentials.getPassword());
}

This seems somewhat redundant because it's essentially setting the password to its own existing value.
Firstly, it uses a conditional statement to check if the password in the MQTT credentials (mqttCredentials) is not empty.
If the password is not empty, it performs an operation: it sets the password of the mqttCredentials object to its own current password value.

@ashvayka
Copy link
Member

ashvayka commented Sep 6, 2023

Oh, I am sorry... Somehow, I missed that this was the same object. I thought we set the value to a different object. Of course, you are right! So embarrassing..

@ashvayka ashvayka merged commit 87b48e5 into thingsboard:develop/3.6 Sep 6, 2023
2 checks passed
@ashvayka ashvayka added this to the 3.6 milestone Sep 6, 2023
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.

None yet

2 participants