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

[ISSUE #3046] Unify the treatment of constant variables and reduce the usage of "magic numbers" #7294

Closed
wants to merge 4 commits into from
Closed

Conversation

ArthurMograbi
Copy link

What is the purpose of the change

To resolve issue #3046, unify the treatment of constant variables and reduce the usage of "magic numbers"

Brief changelog

Replacement of some of the usage of "magic numbers" for a cleaner and more maintainable approach and unify some discordand usages of the same variables

Verifying this change

eclipse-pmd was used to verify the changes

…ant/PropertiesConstant.java

	modified:   config/src/main/java/com/alibaba/nacos/config/server/utils/PropertyUtil.java
…ClientWorker.java

	modified:   client/src/main/java/com/alibaba/nacos/client/naming/remote/http/NamingHttpClientProxy.java
Copy link
Collaborator

@KomachiSion KomachiSion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think your jdk version is too old. Please upgrade jdk version to at lease 1.8.

@@ -113,7 +113,8 @@
/**
* groupKey -> cacheData.
*/
private final AtomicReference<Map<String, CacheData>> cacheMap = new AtomicReference<>(new HashMap<>());
private final AtomicReference<Map<String, CacheData>> cacheMap = new AtomicReference<Map<String, CacheData>>(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add type?

@ArthurMograbi
Copy link
Author

I think your jdk version is too old. Please upgrade jdk version to at lease 1.8.

Thank you for the heads up! There was something wrong with my workspace that caused java to default to an earlier version

@realJackSun
Copy link
Collaborator

1 Do not use magic number
2 Remove the types as sion says

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@KomachiSion
Copy link
Collaborator

CLA not sign for a long time.

@KomachiSion KomachiSion closed this May 9, 2022
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.

4 participants