Skip to content

Suggestion : Improvement of String.equals("xxx") #41

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

Merged
merged 1 commit into from
Jan 10, 2019

Conversation

o0lwj0o
Copy link
Contributor

@o0lwj0o o0lwj0o commented Jan 10, 2019

Hi,
I have found some usage of “String.equals("xxx")” in this project.

When using string.equals("a") ,it will get nullpointexception if string ==null.
The problem can be fixed by repalced with "a".equals(string) or Objects.equals(string,"a").

Best regards

Hi,
I have found some usage of “String.equals("xxx")” in this project.

When using string.equals("a") ,it will get nullpointexception if string ==null.
The problem can be fixed by repalced with "a".equals(string) or Objects.equals(string,"a").

Best regards
@tiann
Copy link
Member

tiann commented Jan 10, 2019

You are right, but member.getName() could never return a null value.

@tiann tiann merged commit 610f735 into android-hacker:master Jan 10, 2019
@o0lwj0o o0lwj0o deleted the patch-1 branch May 14, 2019 05:00
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