Skip to content

fix code style#62

Closed
wsxe9988 wants to merge 1 commit intoalibaba:mainfrom
wsxe9988:main
Closed

fix code style#62
wsxe9988 wants to merge 1 commit intoalibaba:mainfrom
wsxe9988:main

Conversation

@wsxe9988
Copy link
Copy Markdown
Contributor

解决 Object的equals方法容易抛空指针异常,应使用常量或确定有值的对象来调用equals的问题

@wenshao
Copy link
Copy Markdown
Member

wenshao commented Apr 23, 2022

"null".equalsIgnoreCase(str)

这种写法对可读性不好,这个不用改

@wsxe9988
Copy link
Copy Markdown
Contributor Author

"null".equalsIgnoreCase(str)

这种写法对可读性不好,这个不用改

我是计划想把这些null等这种魔法值 抽取出来做为常量

@wsxe9988
Copy link
Copy Markdown
Contributor Author

"null".equalsIgnoreCase(str)

这种写法对可读性不好,这个不用改

嗯,那我关掉这个pr

@wsxe9988 wsxe9988 closed this Apr 23, 2022
@kraity
Copy link
Copy Markdown
Collaborator

kraity commented Apr 23, 2022

value instanceof String 和前面的 value != null 已经判空了

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.

3 participants