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

[Challenge 2024 - HAFNIUM] EC1369 Use orElseGet instead of orElse #43

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Samdespion
Copy link

Parameter of orElse() is evaluated, even when having a non-empty Optional. orElseGet supplier method passed as an argument is only executed when an Optional value isn’t present :

green-code-initiative/ecoCode-challenge#77

@Samdespion Samdespion changed the title EC1369 Use orElseGet instead of orElse [Challenge 2024 - HAFNIUM] EC1369 Use orElseGet instead of orElse May 30, 2024
Copy link
Member

@dedece35 dedece35 left a comment

Choose a reason for hiding this comment

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

Could you please update CHANGELOG.md with your implemented rule ?

import java.util.List;
import java.util.Objects;

@Rule(key = "EC1369")
Copy link
Member

Choose a reason for hiding this comment

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

please change rule id to "EC94"

Copy link

This PR has been automatically marked as stale because it has no activity for 30 days.
Please add a comment if you want to keep the issue open. Thank you for your contributions!

@github-actions github-actions bot added the stale label Jul 16, 2024
@github-actions github-actions bot removed the stale label Oct 29, 2024
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