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

Incremental PR analysis: Implement HashProvider #6506

Merged
merged 1 commit into from
Dec 8, 2022

Conversation

costin-zaharia-sonarsource
Copy link
Member

Part of #6486

@sonarcloud
Copy link

sonarcloud bot commented Dec 7, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@sonarcloud
Copy link

sonarcloud bot commented Dec 7, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Contributor

@pavel-mikula-sonarsource pavel-mikula-sonarsource left a comment

Choose a reason for hiding this comment

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

LGTM

import java.security.NoSuchAlgorithmException;

public class HashProvider {
public byte[] computeHash(Path filePath) throws NoSuchAlgorithmException, IOException {
Copy link
Contributor

Choose a reason for hiding this comment

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

Open question: Isn't this one going to make our life easier?

Suggested change
public byte[] computeHash(Path filePath) throws NoSuchAlgorithmException, IOException {
public byte[] computeHash(Path filePath) throws Throwable {

Copy link
Member Author

Choose a reason for hiding this comment

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

With this the contract is clear. We say exactly what kind of exceptions we throw.

When handling the exception can use the base type Throwable or Exception or even be explicit, depending on the needs.

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.

2 participants