Skip to content

Conversation

@gosar
Copy link
Contributor

@gosar gosar commented Oct 12, 2023

Motivation and Context

Addressing sonar cloud reported issues from merging feature/master/sra-identity-auth to master in #4509 - https://sonarcloud.io/project/issues?id=aws_aws-sdk-java-v2&pullRequest=4509&resolved=false&types=BUG.

Modifications

  • Made some numeric literals long explicitly.
  • Call Optional#isPresent() before accessing the value
  • Added synchronized to match parent methods. (did not do it for SdkLengthAwareInputStream as it caused spotbugs failure)

Testing

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license


@Override
public void mark(int readlimit) {
public synchronized void mark(int readlimit) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These changes cause findbugs failures. See https://github.com/aws/aws-sdk-java-v2/actions/runs/6500168283/job/17654999932?pr=4588#step:3:67245

Error:  Medium: Inconsistent synchronization of software.amazon.awssdk.http.auth.aws.internal.signer.io.SdkLengthAwareInputStream.length; locked 50% of time [software.amazon.awssdk.http.auth.aws.internal.signer.io.SdkLengthAwareInputStream, software.amazon.awssdk.http.auth.aws.internal.signer.io.SdkLengthAwareInputStream, software.amazon.awssdk.http.auth.aws.internal.signer.io.SdkLengthAwareInputStream, software.amazon.awssdk.http.auth.aws.internal.signer.io.SdkLengthAwareInputStream] Unsynchronized access at SdkLengthAwareInputStream.java:[line 60]Unsynchronized access at SdkLengthAwareInputStream.java:[line 46]Synchronized access at SdkLengthAwareInputStream.java:[line 92]Synchronized access at SdkLengthAwareInputStream.java:[line 98] IS2_INCONSISTENT_SYNC

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Undoing this change in 7a8c647

@gosar gosar marked this pull request as ready for review October 13, 2023 05:28
@gosar gosar requested a review from a team as a code owner October 13, 2023 05:28
@gosar gosar requested a review from davidh44 October 13, 2023 19:03
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

77.8% 77.8% Coverage
0.9% 0.9% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@gosar gosar merged commit ed807c9 into master Oct 13, 2023
@gosar gosar deleted the gosar/sra-ia-sonar branch October 13, 2023 22:36
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.

3 participants