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

refactoring and removing unused imports,some sonarlint fixes #126

Closed
wants to merge 1 commit into from
Closed

refactoring and removing unused imports,some sonarlint fixes #126

wants to merge 1 commit into from

Conversation

sanket1411
Copy link

  • removed unused imports.
  • applied some sonar lint suggestion.

Keeping this pull request small for ease of review. Can add create similar requests for sonarlint fixes and refactor in iterative manner in future.

@alerque
Copy link

alerque commented Apr 10, 2021

Things like this should usually be split up at least in different commits if not PRs (the latter being more of a project workflow preference). Having separate commits for things like refactoring, lint fixes, and removing unused code makes it possible to to run various checks a lot easier. It also makes it possible to use git blame to find problems and git revert to fix them if need be. The less different unrelated things that get touched the easier it is to confirm that things work and fix them when they break.

@sanket1411
Copy link
Author

Thanks for the suggestion will keep that in mind. Should I create new PR for above changes which is split up in diff commits?

@alerque
Copy link

alerque commented Apr 10, 2021

Thatks up to the folks actually reviewing this and managing the code base, I'm just speaking from experience managing other projects over time.

Copy link
Contributor

@ehrenkret-signal ehrenkret-signal left a comment

Choose a reason for hiding this comment

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

Yes, please have PRs focus on one item at a time.

@@ -63,14 +63,14 @@ public BaseAccountAuthenticator(AccountsManager accountsManager, Clock clock) {
AuthorizationHeader authorizationHeader = AuthorizationHeader.fromUserAndPassword(basicCredentials.getUsername(), basicCredentials.getPassword());
Optional<Account> account = accountsManager.get(authorizationHeader.getIdentifier());

if (!account.isPresent()) {
if (isNull(account)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think Objects.isNull checks whether or not Optional's are present or empty. I think this will just check if the Optional is null.

Copy link

Choose a reason for hiding this comment

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

It looks like this change was reverted in #127.

@sanket1411
Copy link
Author

will delete this PR and raise other as per the suggestions

@sanket1411 sanket1411 closed this Apr 13, 2021
@alerque
Copy link

alerque commented Apr 13, 2021

For future reference, PRs are mutable. You shouldn't close one just to open another one for the same core submission, just remove the unrelated commit from the source branch. Also using your fork's master (or otherwise default) branch is not a good idea for PRs, GitHub's UI even warns about this while creating PRs. Use a branch for each PR submission.

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