Skip to content

method getSalaryInfo implemented - #1584

Open
3xactCoder wants to merge 1 commit into
mate-academy:masterfrom
3xactCoder:task/salary-info
Open

method getSalaryInfo implemented#1584
3xactCoder wants to merge 1 commit into
mate-academy:masterfrom
3xactCoder:task/salary-info

Conversation

@3xactCoder

Copy link
Copy Markdown

No description provided.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

I am approving your solution because it correctly implements all the required functionality: it uses LocalDate, respects the inclusive date range, correctly computes each employee’s salary as hours * rate, and formats the report output as specified. The logic with a single nested loop over names and data, plus the use of StringBuilder and System.lineSeparator(), is fully in line with the task constraints. The remaining issues are style-related: the DateTimeFormatter should be moved from inside getSalaryInfo to a class-level private static final constant (e.g. private static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("dd.MM.yyyy");) to better follow the checklist recommendation [CHECKLIST ITEM #2]. There are also a couple of redundant blank lines (right after the package declaration and at the start of the method body) that you should remove to comply with the style rule about not starting methods with empty lines [CHECKLIST ITEM #1]. These are minor, non-blocking issues that typical linters or style checks will flag, and you can fix them easily in a follow-up. Overall, you did a solid job on the core logic; just clean up the formatter placement and extra blank lines to align fully with the style expectations in future tasks.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

public String getSalaryInfo(String[] names, String[] data, String dateFrom, String dateTo) {
return null;

DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd.MM.yyyy");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #2: "If you create a formatter, make it a constant field." Move this DateTimeFormatter to a class-level private static final constant with a proper constant name (e.g. DATE_FORMATTER) and reuse it here.

public class SalaryInfo {
public String getSalaryInfo(String[] names, String[] data, String dateFrom, String dateTo) {
return null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #1: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines" — there is an unnecessary empty line at the start of the method body; consider removing extra blank lines to comply with the checklist.

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