Skip to content

first commit - #1592

Open
MrGizmen wants to merge 3 commits into
mate-academy:masterfrom
MrGizmen:master
Open

first commit#1592
MrGizmen wants to merge 3 commits into
mate-academy:masterfrom
MrGizmen:master

Conversation

@MrGizmen

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

The implementation is functionally correct with proper salary calculation and date filtering, but there are three categories of issues that need addressing: 1. Empty Lines (Checklist #1): Remove redundant blank lines at the start of method, before the inner loop, inside the if block, and before the class closing brace. Only one blank line should separate logical sections. 2. DateTimeFormatter as Local Variable (Checklist #2): Move DateTimeFormatter from inside the method to a class-level constant. It should be declared as private static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("dd.MM.yyyy"); outside any method. 3. Line Separators (Checklist #7): Replace all occurrences of "\n" with System.lineSeparator() for cross-platform compatibility. These are style and convention violations from the checklist, but the Checkstyle failure currently blocks the build. Once these formatting issues are fixed, your solution will meet all requirements.


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

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

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.

Empty lines at the start of method implementation violate checklist #1. Remove this empty line.

Comment on lines +17 to +18

for (String records : data) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Two empty lines before the inner loop are redundant. Remove extra empty lines per checklist #1.


StringBuilder result = new StringBuilder("Report for period " + dateFrom + " - " + dateTo
+ "\n");
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.

Checklist #2 violation: DateTimeFormatter should be a constant field (private static final), not a local variable. Move it outside the method.

Comment on lines +9 to +10
StringBuilder result = new StringBuilder("Report for period " + dateFrom + " - " + dateTo
+ "\n");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist #7 violation: Use System.lineSeparator() instead of \n for line breaks.

totalSalary += salary;
}

}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty line inside the if block is redundant. Remove per checklist #1.

Comment on lines +36 to +37
.append("\n");
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist #7 violation: Use System.lineSeparator() instead of \n for line breaks.

return result.toString();
}

}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty line before class closing brace is redundant. Remove per checklist #1.

@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.

Sorry, the pull request review was unsuccessful for the following reasons:

Warning

No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: NCM]

If the issue is within your control, please address it.
The next review attempt will automatically launch in about 1 hour.
If you believe this is an error or need assistance, please contact the support team.

@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.

Sorry, the pull request review was unsuccessful for the following reasons:

Warning

No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: NCM]

If the issue is within your control, please address it.
The next review attempt will automatically launch in about 1 hour.
If you believe this is an error or need assistance, please contact the support team.

@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

Your solution is approved. All functional requirements are correctly implemented: the salary calculation logic properly handles inclusive date range filtering, uses LocalDate for date handling, StringBuilder for string construction, and System.lineSeparator() for cross-platform compatibility. The DateTimeFormatter is correctly declared as a class-level constant, and the two-loop structure accurately aggregates hours and rates per employee. There is one minor style note: there is an extra empty line before the class closing brace — while this doesn't affect functionality, removing it would improve consistency with standard Java formatting conventions. Keep up the solid work on following the technical constraints and producing clean, readable code!


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

Footnotes

  1. Rate AI review example

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