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

replace lang3 in api #3126

Merged
merged 3 commits into from
Jun 23, 2020
Merged

replace lang3 in api #3126

merged 3 commits into from
Jun 23, 2020

Conversation

lin-mt
Copy link
Contributor

@lin-mt lin-mt commented Jun 19, 2020

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

What is the purpose of the change

#3102

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.

@lin-mt lin-mt changed the title replace lang3 replace lang3 in api Jun 19, 2020
@lin-mt
Copy link
Contributor Author

lin-mt commented Jun 20, 2020

@KomachiSion Hello,可以帮忙看下为什么 Travis CI 失败了吗。

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.

There are one thing need to changed:

No need use this in method except the constructor, set and get method. Please remove them from all.

And other question:

If the Utils is totally copy from commons-lang3, Are there necessary to remove the dependency in Server? We may need a more discuss.

@JsonIgnore
public Map<String, String> getCustomHeaders() {
if (StringUtils.isBlank(headers)) {
if (StringUtils.isBlank(this.headers)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need use this for use except in constructor, set, get.

for (String s : headers.split(Constants.NAMING_HTTP_HEADER_SPILIER)) {
String[] splits = s.split(":");
final Map<String, String> headerMap = new HashMap<String, String>(16);
for (final String s : this.headers.split(Constants.NAMING_HTTP_HEADER_SPILIER)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need use this for use except in constructor, set, get.

@Override
public int hashCode() {
return Objects.hashCode(path, headers, expectedResponseCode);
return Objects.hashCode(this.path, this.headers, this.expectedResponseCode);
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need use this for use except in constructor, set, get.

final Http other = (Http) obj;
if (!StringUtils.equals(this.type, other.getType())) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need use this for use except in constructor, set, get.

return false;
}
return expectedResponseCode == other.getExpectedResponseCode();
return this.expectedResponseCode == other.getExpectedResponseCode();
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need use this for use except in constructor, set, get.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

去掉 this 了哈

*/
public static final int OVER_THRESHOLD = 503;

public static final int RESOURCE_NOT_FOUND = -404;
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个码是什么意思?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这个码是什么意思?

-404 吗,这个之前就已经存在了,是 @nkorange 添加的

Copy link
Collaborator

@yanlinly yanlinly left a comment

Choose a reason for hiding this comment

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

整体建议这次只改重构代码的地方。 如果格式问题建议另外一个pr整理,以便重点关注变更点,提高review效率

@KomachiSion KomachiSion merged commit 1c84253 into alibaba:develop Jun 23, 2020
@KomachiSion KomachiSion added kind/refactor dependencies Pull requests that update a dependency file labels Jun 23, 2020
@KomachiSion KomachiSion added this to the 1.3.1 milestone Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file kind/refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants