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

Resolve the issues of codestyle of nacos-config module for phase7 #3288

Merged

Conversation

zhangjidi2016
Copy link

Please do not create a Pull Request without creating an issue first.

What is the purpose of the change

Resolve the issues of codestyle of nacos-config module for some package parts below.
Package:

(1)com.alibaba.nacos.config.server.utils
(2)com.alibaba.nacos.config.server.utils.event

Brief changelog

XX

Verifying this change

XXXX

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • Run mvn -B clean package apache-rat:check findbugs:findbugs -Dmaven.test.skip=true to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.

public static void verifyIncrementPubContent(String content) {

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please check indent in this file

*
* @author Nacos
*/
@SuppressWarnings("checkstyle:ConstantName")
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 this suppress?

Copy link
Author

Choose a reason for hiding this comment

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

Many Log member variables defined in this class are referenced in many classes. Do they need to be modified in code format?
image

Copy link
Collaborator

Choose a reason for hiding this comment

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

Use IDEA‘s refactor-rename feature, IDEA will help you change them all.
You just change the original location.

If you don't know how to use, doesn't matter. just remove the SuppressWarnings, I will fix it.

*
* @author Nacos
*/
@SuppressWarnings("PMD.ClassNamingShouldBeCamelRule")
@SuppressWarnings({"PMD.ClassNamingShouldBeCamelRule", "checkstyle:MissingJavadocMethod"})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why skip MissingJavadocMethod check?

@@ -74,6 +74,7 @@ public int incrementAndGet() {
return data[index].incrementAndGet();
}

@SuppressWarnings("checkstyle:MissingJavadocMethod")
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 this SuppressWarnings?

*
* @param regex
* @param regex regex
* @return
Copy link
Collaborator

Choose a reason for hiding this comment

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

can this pass checkstyle?

@@ -82,6 +83,7 @@ public int incrementAndGet(String ip) {
return data[index].incrementAndGet();
}

@SuppressWarnings("checkstyle:MissingJavadocMethod")
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 this SuppressWarnings?

@@ -71,6 +71,7 @@ public SimpleIPFlowData(int slotCount, int interval) {
timer.scheduleAtFixedRate(new DefaultIPFlowDataManagerTask(), interval, interval, TimeUnit.MILLISECONDS);
}

@SuppressWarnings("checkstyle:MissingJavadocMethod")
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 this SuppressWarnings?

*
* @author leiwen.zh
*/
@SuppressWarnings("PMD.ClassNamingShouldBeCamelRule")
@SuppressWarnings({"PMD.ClassNamingShouldBeCamelRule", "checkstyle:AbbreviationAsWordInName"})
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 this SuppressWarnings?

Copy link
Author

Choose a reason for hiding this comment

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

There are more than two consecutive uppercase letters in the class name, but IP is generally indicated with uppercase letters.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ip is ok, I think.

*
* @author Nacos
*/
@SuppressWarnings("checkstyle:ConstantName")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use IDEA‘s refactor-rename feature, IDEA will help you change them all.
You just change the original location.

If you don't know how to use, doesn't matter. just remove the SuppressWarnings, I will fix it.

*
* @author leiwen.zh
*/
@SuppressWarnings("PMD.ClassNamingShouldBeCamelRule")
@SuppressWarnings({"PMD.ClassNamingShouldBeCamelRule", "checkstyle:AbbreviationAsWordInName"})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ip is ok, I think.

@KomachiSion KomachiSion added this to the 1.3.1 milestone Jul 10, 2020
@KomachiSion KomachiSion merged commit 5d65653 into alibaba:develop Jul 10, 2020
@KomachiSion
Copy link
Collaborator

Refer #3249

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants