Skip to content

Conversation

@AetherRadar
Copy link

@AetherRadar AetherRadar commented Apr 26, 2025

Issue Description

Found a redundant Optional check in DefaultHashService class. The current implementation checks if Optional is present (isPresent()) before accessing its value, which is unnecessary as the subsequent method already safely handles null values.

Changes Made

  • Removed redundant isPresent() check in DefaultHashService
  • Simplified code flow while maintaining the same functionality

Rationale

This change improves code readability by avoiding unnecessary conditional checks without changing the behavior. Redundant Optional checks make the code more complex and potentially misleading.

Testing

Ran mvn verify to ensure basic checks pass. This change does not affect existing functionality, and all tests continue to pass.


Contribution Checklist

  • I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004 *
  • Ensure all existing unit tests pass (mvn verify run)

lprimak
lprimak previously approved these changes Apr 26, 2025
@lprimak lprimak dismissed their stale review April 26, 2025 03:37

No CLA

@lprimak
Copy link
Contributor

lprimak commented Apr 26, 2025

Hi,

Can you restore the issue template that includes the checklist and CLA please

Thank you for your contribution!

@lprimak lprimak added pending-cla java Pull requests that update Java code core Core Modules valid Disable automation for valid issues CLA and removed pending-cla labels Apr 26, 2025
@lprimak lprimak modified the milestones: 3.0.0, 2.0.5 Apr 26, 2025
@lprimak
Copy link
Contributor

lprimak commented Apr 26, 2025

Merged, thank you!

@lprimak lprimak merged commit 3446b67 into apache:main Apr 26, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA core Core Modules java Pull requests that update Java code valid Disable automation for valid issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants