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 #3515] Do some code optimization[AuthTokenUtils] #3644

Merged
merged 14 commits into from
Jun 1, 2024

Conversation

kyooosukedn
Copy link
Contributor

Fixes #3515 .

Motivation

Code Optimization on AuthTokenUtils.java
Remove redundancy

Modifications

Remove duplicate code and redundancies

Documentation

  • Does this pull request introduce a new feature? (no)
  • If yes, how is the feature documented? (not applicable)

Copy link
Contributor

@Alonexc Alonexc left a comment

Choose a reason for hiding this comment

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

LGTM

@xwm1992 xwm1992 changed the title Code optimization [ISSUE #3515] Do some code optimization[AuthTokenUtils] Apr 7, 2023
@Alonexc
Copy link
Contributor

Alonexc commented Apr 7, 2023

image
Please check the checkstyle.

@kyooosukedn
Copy link
Contributor Author

image Please check the checkstyle.

Hi, how do I get those warnings? I ran ./gradlew check and did code inspection on file AuthTokenUtils.java and found nothing, I have imported checkstyle.xml though

@Alonexc
Copy link
Contributor

Alonexc commented Apr 12, 2023

@kyooosukedn
Download this plugin:
image

Import the checkstyle of the local project and check the box.
image
image
image

@@ -139,7 +139,7 @@ void list(HttpExchange httpExchange) throws IOException {
});

String result = JsonUtils.toJSONString(getClientResponseList);
httpExchange.sendResponseHeaders(200, result.getBytes().length);
httpExchange.sendResponseHeaders(200, result.getBytes(Constants.DEFAULT_CHARSET).length);
Copy link
Contributor

Choose a reason for hiding this comment

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

Here Constants.DEFAULT_CHARSET needs to be imported:
org.apache.eventmesh.common.Constants;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks :)

@kyooosukedn
Copy link
Contributor Author

Hi @Alonexc Is there something else that needs to be done?

@Pil0tXia
Copy link
Member

Pil0tXia commented Jan 9, 2024

Please resolve conflicts.

Copy link
Member

@Pil0tXia Pil0tXia left a comment

Choose a reason for hiding this comment

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

I didn't see these changes required in #3515:

b. Remove redundant initializers.
c. Use 'Objects.requireNonNull()' to avoid an NPE.
d. Replace this if-then-else statement by a single return statement
e. Remove the extra "{}".

Please supplement.😊

Besides, please fix checkstyle warnings: https://github.com/apache/eventmesh/actions/runs/7481706701/job/20372145878

Copy link

codecov bot commented Jan 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5850d54) 17.55% compared to head (12b521c) 17.59%.
Report is 6 commits behind head on master.

❗ Current head 12b521c differs from pull request most recent head 13b2bee. Consider uploading reports for the commit 13b2bee to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3644      +/-   ##
============================================
+ Coverage     17.55%   17.59%   +0.04%     
+ Complexity     1778     1774       -4     
============================================
  Files           797      797              
  Lines         29871    29786      -85     
  Branches       2581     2573       -8     
============================================
- Hits           5243     5242       -1     
+ Misses        24145    24063      -82     
+ Partials        483      481       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kyooosukedn
Copy link
Contributor Author

Hi @Pil0tXia, I have corrected as you suggested. Thank u for the review :)

Pil0tXia
Pil0tXia previously approved these changes Jan 18, 2024
Copy link
Member

@Pil0tXia Pil0tXia left a comment

Choose a reason for hiding this comment

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

LGTM

@Pil0tXia
Copy link
Member

cc @Alonexc

Pil0tXia
Pil0tXia previously approved these changes Jan 20, 2024
@Pil0tXia Pil0tXia requested a review from Alonexc January 20, 2024 14:37
Copy link
Contributor

It has been 60 days since the last activity on this pull request. I am reaching out here to gently remind you that the Apache EventMesh community values every pull request, and please feel free to get in touch with the reviewers at any time. They are available to assist you in advancing the progress of your pull request and offering the latest feedback.

If you encounter any challenges during development, seeking support within the community is encouraged. We sincerely appreciate your contributions to Apache EventMesh.

@github-actions github-actions bot added the Stale label Apr 22, 2024
@codecov-commenter
Copy link

codecov-commenter commented Apr 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (e04156b) to head (d48a930).
Report is 69 commits behind head on master.

Current head d48a930 differs from pull request most recent head c1d287c

Please upload reports for the commit c1d287c to get more accurate results.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #3644       +/-   ##
============================================
- Coverage     16.20%       0   -16.21%     
============================================
  Files           857       0      -857     
  Lines         30883       0    -30883     
  Branches       2685       0     -2685     
============================================
- Hits           5005       0     -5005     
+ Misses        25410       0    -25410     
+ Partials        468       0      -468     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Pil0tXia
Copy link
Member

@kyooosukedn Sorry for the delay. May you please resolve conflicts? 😊

@Alonexc May you please help merge this PR?

@github-actions github-actions bot removed the Stale label Apr 23, 2024
@kyooosukedn
Copy link
Contributor Author

@Alonexc @Pil0tXia kindly review this, thanks :)

Copy link
Member

@Pil0tXia Pil0tXia left a comment

Choose a reason for hiding this comment

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

Re-approval. cc @Alonexc

@Pil0tXia
Copy link
Member

Pil0tXia commented Jun 1, 2024

Closing to re-trigger CI.

@Pil0tXia Pil0tXia closed this Jun 1, 2024
@Pil0tXia Pil0tXia reopened this Jun 1, 2024
@Pil0tXia Pil0tXia merged commit 498c350 into apache:master Jun 1, 2024
18 checks passed
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.

[Enhancement] Do some code optimization[AuthTokenUtils]
5 participants