Skip to content

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

Merged
tiann merged 1 commit into
android-hacker:masterfrom
o0lwj0o:patch-1
Jan 10, 2019
Merged

tiann merged 1 commit into
android-hacker:masterfrom
o0lwj0o:patch-1

Conversation

@o0lwj0o

@o0lwj0o o0lwj0o commented Jan 10, 2019

Copy link
Copy Markdown
Contributor

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

tiann commented Jan 10, 2019

Copy link
Copy Markdown
Member

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