-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Remove dependency of apache-common-lang3 in the client. #3031
Remove dependency of apache-common-lang3 in the client. #3031
Conversation
Hi @yanlinly @chuntaojun please help to review this pr, thanks. |
#2952 is same? |
I have just removed the apache common-lang3 package in the client. @yanlinly |
@@ -52,7 +59,7 @@ public FailoverReactor(HostReactor hostReactor, String cacheDir) { | |||
this.hostReactor = hostReactor; | |||
this.failoverDir = cacheDir + "/failover"; | |||
// init executorService | |||
this.executorService = Executors.newSingleThreadScheduledExecutor(new ThreadFactory() { | |||
this.executorService = new ScheduledThreadPoolExecutor(1, new ThreadFactory() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里改的原因是?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是PMD报出来的问题。。。 所以我就顺手修改了
/** | ||
* @author <a href="mailto:[email protected]">liaochuntao</a> | ||
*/ | ||
public final class ConvertUtils { | ||
|
||
private static final String NULL_STR = "null"; | ||
|
||
public static int toInt(String val) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may need to add a comment, which automatically defaults to 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I will add a comment in next commit.
* @param str the String to check; upper and lower case are treated as the same | ||
* @return the Boolean value of the string, {@code null} if no match or {@code null} input | ||
*/ | ||
@SuppressWarnings({"PMD.UndefineMagicConstantRule", "PMD.AvoidComplexConditionRule", "PMD.SwitchStatementRule"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
直接类上面,@SuppressWarnings(“all”)吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I will adjust this codes in next commit.
/** | ||
* @author zongtanghu | ||
*/ | ||
public class CharSequenceUtils { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不必要单独创建一个新的类,这个放到StringUtils内部就好了
There is one ci test case failed, because it executed time out. @yanlinly @chuntaojun Can you help to rerun the ci job again? |
Please fix confilcts. |
Okay, I will fix the codes' conflicts right now. @KomachiSion |
@yanlinly @KomachiSion @chuntaojun I have already done the codes' conflicts. |
client/src/main/java/com/alibaba/nacos/client/logging/AbstractNacosLogging.java
Show resolved
Hide resolved
import java.util.concurrent.*; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove extra blank line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the next commit, I will remove the blank line.
} | ||
} | ||
|
||
// end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这些代码是从哪里拷贝的,还是自己写的呢? 如果是拷贝过来的注意一下license
|
||
} | ||
|
||
// end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这些代码是从哪里拷贝的,还是自己写的呢? 如果是拷贝过来的注意一下license
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
Please do not create a Pull Request without creating an issue first.
What is the purpose of the change
Remove dependency of apache-common-lang3 in the client, such as replacing NumberUtils with ConvertUtils in all modules of nacos.
Brief changelog
The main goal is to remove dependency for apache commons-lang package.
Verifying this change
I have already paased the unit test cases.
Follow this checklist to help us incorporate your contribution quickly and easily:
[ISSUE #123] Fix UnknownException when host config not exist
. Each commit in the pull request should have a meaningful subject line and body.mvn -B clean package apache-rat:check findbugs:findbugs -Dmaven.test.skip=true
to make sure basic checks pass. Runmvn clean install -DskipITs
to make sure unit-test pass. Runmvn clean test-compile failsafe:integration-test
to make sure integration-test pass.