Skip to content

Conversation

@AlexanderEnin
Copy link
Collaborator

No description provided.

@AlexanderEnin AlexanderEnin changed the base branch from main to AlexanderEnin August 20, 2025 17:27
@github-actions
Copy link

Test Results

16 tests  +4   16 ✅ +4   1s ⏱️ ±0s
10 suites +1    0 💤 ±0 
10 files   +1    0 ❌ ±0 

Results for commit 6991e9e. ± Comparison against base commit babbd85.


public String greet() {
long openTasksCount =
this.todoService.getAllTodos().stream().filter(task -> !task.completed()).count();
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need to use "this" inside method. this makes sense only in constructor to differ it from constructor parameter

Ref for convention:
https://docs.oracle.com/javase/tutorial/java/javaOO/thiskey.html#:~:text=Within%20an%20instance%20method%20or,a%20constructor%20by%20using%20this%20.

long openTasksCount =
this.todoService.getAllTodos().stream().filter(task -> !task.completed()).count();

return String.format("Hello from Spring! You have %d open tasks.", openTasksCount);
Copy link
Collaborator

Choose a reason for hiding this comment

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

How do you think can we also handle plural/singular form of "task" ? 1 task, 2 tasks e.t.c.

Copy link
Collaborator

@IgorGursky IgorGursky left a comment

Choose a reason for hiding this comment

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

All great

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.

4 participants