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

Unnecessary class: com.alibaba.nacos.common.utils.Objects #6197

Closed
SunJiFengPlus opened this issue Jun 29, 2021 · 1 comment
Closed

Unnecessary class: com.alibaba.nacos.common.utils.Objects #6197

SunJiFengPlus opened this issue Jun 29, 2021 · 1 comment
Labels
kind/discussion Category issues related to discussion kind/refactor
Milestone

Comments

@SunJiFengPlus
Copy link
Contributor

SunJiFengPlus commented Jun 29, 2021

Issue Description

com.alibaba.nacos.common.utils.Objects and java.util.Objects have most of the same code.

The only difference is that com.alibaba.nacos.common.utils.Objects::requireNonNullElse, I did a global search and there was no other place to use it, Optional can be instead of this method.

So I wonder if I can delete it.

if it pass, i can do this.

@realJackSun realJackSun added kind/discussion Category issues related to discussion kind/refactor labels Jun 29, 2021
@KomachiSion
Copy link
Collaborator

I think the com.alibaba.nacos.common.utils.Objects is copy from jdk. Because before nacos 2.0, the nacos-client is compile with jdk1.6. java.util.Objects add since 1.7. So add this Util to use.

Now we can replace back to jdk's util and remove old util.

SunJiFengPlus pushed a commit to SunJiFengPlus/nacos that referenced this issue Jun 30, 2021
KomachiSion pushed a commit that referenced this issue Jul 1, 2021
@KomachiSion KomachiSion added this to the 2.0.3 milestone Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/discussion Category issues related to discussion kind/refactor
Projects
None yet
Development

No branches or pull requests

3 participants